本文介绍了如何在smali文件中进行本地化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用外语的应用程序,我想完全迁移它,例如在smali文件中,我有以下编程代码:
I have an app on forein language and I want to traslete it fully for example in the smali file I have this programming code:
const-string v1, "Hello"
如何从此smali代码添加对string.xml文件的引用?
How I can add reference to the string.xml file from this smali code?
推荐答案
如果您需要在com.xxx.yyy.HomeActivity中进行此操作,并且R.java中的本地化字符串'id为0x7f050000.使用下面的代码替换代码const-string v1, "Hello"
If you need to do it in com.xxx.yyy.HomeActivity, and your localized string'id in R.java is 0x7f050000. Use the code below to replace the code const-string v1, "Hello"
invoke-virtual {p0}, Lcom/xxx/yyy/HomeActivity;->getResources()Landroid/content/res/Resources;
move-result-object v2
const/high16 v3, 0x7f050000
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v1
这篇关于如何在smali文件中进行本地化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!