1

I'm trying to edit a smali file of a decompiled Android APK I (legally) have. I can't figure out how to make this boolean be always true:

.method public setValid(Ljava/lang/Boolean;)V
    .locals 0

    .line 34
    iput-object p1, p0, Ltr/net/tbc/api/entity/GoalValidity;->valid:Ljava/lang/Boolean;

    return-void
.end method

and/or this one:

.method public getValid()Ljava/lang/Boolean;
    .locals 1

    .line 30
    iget-object v0, p0, Ltr/net/tbc/api/entity/GoalValidity;->valid:Ljava/lang/Boolean;

    return-object v0
.end method

Thanks so much for anyone helping.

lol7344
  • 13
  • 1
  • 4

1 Answers1

2

put sget-object p1, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean; before the iput-object instruction.

Or, replace the iget-object instruction with sget-object v0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;

JesusFreke
  • 19,784
  • 5
  • 65
  • 68
  • thank you! the boolean had to be true, but the code worked flawlessly by changing that. :) – lol7344 May 13 '19 at 11:13
  • @lol7344 Hello, It's an old post, but I hope you could still remember. I was confused by your comment, did you use ->TRUE or ->FALSE? You wanted to turns the value to be always true right? – user516076 Aug 14 '22 at 23:07
  • 1
    @user516076 i wanted it to be always true iirc, i just swapped the answer's FALSE to TRUE but the code itself was correct. – lol7344 Aug 16 '22 at 09:58