Tuesday, 1 October 2013

Modifying an apk causes NoSuchFieldError

Modifying an apk causes NoSuchFieldError

I have decoded an apk via apktool and modified it like below finally
rebuilt it succesfully. However, when I run it on an emulator I get
NoSuchFieldError. I have broken something but I can't see what. Please
help.
Original:
...
.field private a_global_variable:Lsome/class;
...
new-instance v0, Lsome/class;
invoke-direct {v0} Lsome/class;-><init>()V
iput-object v0, p0, Lthis/main/class;->a_global_variable:Lsome/class;
Modified:
...
.field private a_global_variable:Lsome/class;
...
invoke-static {} Lsome/class;-><init>()Lsome/class;
move-result-object v0
iput-object v0, p0, Lthis/main/class;->a_global_variable:Lsome/class;

No comments:

Post a Comment