我正致力于通过传输钱包,价格,身份证,代码等数据在线工作(json)的android逆向工程......
我找到了一个设置并获取Wallet值但却无法弄清楚如何更改它的类。
我正在倒车。我认为在主要活动中,这段代码从json获取钱包值,并在应用程序中设置它。
Fragment_Main_Page.this.sharedPreference.setWallet(((Ser_FirstPage)paramAnonymousResponse.body()).getWallet());
这一部分,我认为从服务器读取钱包字符串:
paramAnonymousResponse.body()).getWallet());
然后将其发送到sharedPreference类以在程序中设置。
在sharedPreference类中,setWallet方法是:
public void setWallet(String paramString)
{
this.editor.putString("wallet", paramString);
this.editor.commit();
}
如你所见,ParamString必须是我之前说过的值。
并设置方法smali代码为:
method public setWallet(Ljava/lang/String;)V
.locals 2
.param p1, "wallet" # Ljava/lang/String;
.prologue
.line 247
iget-object v0, p0, Lfenix/team/aln/mahan/component/ClsSharedPreference;->editor:Landroid/content/SharedPreferences$Editor;
const-string v1, "wallet"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
.line 248
iget-object v0, p0, Lfenix/team/aln/mahan/component/ClsSharedPreference;->editor:Landroid/content/SharedPreferences$Editor;
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 249
return-void
.end method
我想改变" ParamString"在smali代码中的静态字符串值,如" 5000"或" Hello",不输入setWallet(String paramString)接收的值。
喜欢这个:
public void setWallet(String paramString)
{
String str1="5000"
this.editor.putString("wallet", str1);
this.editor.commit();
}
很难在smali中改变它。
p.s:理解smali指令的最佳来源/书是什么
答案 0 :(得分:1)
首先更改本地人数:
.locals 3
设置新本地的值:
const-string v2, "5000"
在方法中替换local:
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
最终结果:
method public setWallet(Ljava/lang/String;)V
.locals 3
.param p1, "wallet" # Ljava/lang/String;
.prologue
.line 247
iget-object v0, p0, Lfenix/team/aln/mahan/component/ClsSharedPreference;->editor:Landroid/content/SharedPreferences$Editor;
const-string v1, "wallet"
const-string v2, "5000"
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
.line 248
iget-object v0, p0, Lfenix/team/aln/mahan/component/ClsSharedPreference;->editor:Landroid/content/SharedPreferences$Editor;
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 249
return-void
.end method