Sunday, 1 September 2013

please help me to add an if-clause

please help me to add an if-clause

I want to add an if clause to a part of .smali file but it doesn't work.
see below :
invoke-virtual/range {p0 .. p0},
Lcom/future/way/Eghra_Free/Page;->getContext()Landroid/content/Context;
move-result-object v2
check-cast v2, Lcom/future/way/Eghra_Free/Main;
iget v2, v2, Lcom/future/way/Eghra_Free/Main;->ah:I
if-nez v2, :cond_0
new-instance v12, Landroid/graphics/Paint;
invoke-direct {v12}, Landroid/graphics/Paint;-><init>()V
const/4 v2, 0x1
invoke-virtual {v12, v2}, Landroid/graphics/Paint;->setAntiAlias(Z)V
const v2, 0x332bffff
invoke-virtual {v12, v2}, Landroid/graphics/Paint;->setColor(I)V
invoke-virtual/range {p0 .. p0}, Lcom/future/way/Eghra_Free/Page;->b()V
:cond_0
invoke-virtual/range {p0 .. p0},
Lcom/future/way/Eghra_Free/Page;->getContext()Landroid/content/Context;
move-result-object v2
check-cast v2, Lcom/future/way/Eghra_Free/Main;
iget v2, v2, Lcom/future/way/Eghra_Free/Main;->ah:I
const/4 v3, 0x1
if-ne v2, v3, :cond_1
new-instance v12, Landroid/graphics/Paint;
invoke-direct {v12}, Landroid/graphics/Paint;-><init>()V
const/4 v2, 0x1
invoke-virtual {v12, v2}, Landroid/graphics/Paint;->setAntiAlias(Z)V
const v2, 0x332bff00
invoke-virtual {v12, v2}, Landroid/graphics/Paint;->setColor(I)V
invoke-virtual/range {p0 .. p0}, Lcom/future/way/Eghra_Free/Page;->b()V
:cond_1
the original code:
.method private a(Landroid/graphics/Canvas;)V .locals 21
new-instance v12, Landroid/graphics/Paint;
invoke-direct {v12}, Landroid/graphics/Paint;-><init>()V
const/4 v2, 0x1
invoke-virtual {v12, v2}, Landroid/graphics/Paint;->setAntiAlias(Z)V
const v2, 0x332bffff
invoke-virtual {v12, v2}, Landroid/graphics/Paint;->setColor(I)V
invoke-virtual/range {p0 .. p0}, Lcom/future/way/Eghra_Free/Page;->b()V
invoke-virtual/range {p0 .. p0},
Lcom/future/way/Eghra_Free/Page;->getContext()Landroid/content/Context;
move-result-object v2
check-cast v2, Lcom/future/way/Eghra_Free/Main;
iget-boolean v2, v2, Lcom/future/way/Eghra_Free/Main;->ae:Z
if-eqz v2, :cond_0
invoke-virtual/range {p0 .. p0},
Lcom/future/way/Eghra_Free/Page;->getContext()Landroid/content/Context;
move-result-object v2
check-cast v2, Lcom/future/way/Eghra_Free/Main;
const/4 v3, 0x0
iput-boolean v3, v2, Lcom/future/way/Eghra_Free/Main;->ae:Z
the original .smali file for download: download from mediafire

No comments:

Post a Comment