如何在Android中编码包和函数名称?

huangapple go评论67阅读模式
英文:

How to encode package and function names in Android?

问题

我想更改所有的包和函数名称,以使我的应用更难分析。
我反向了其他的apk,并找到了我想要的。
但是我不知道如何做到这一点。
请检查附加的图片。
我是否需要使用其他工具或手动更改这个?
请给我一个提示。
谢谢!

英文:

I want to change all package and function names to make my app harder to analyze.
I reversed other apk and found what I want.
But I don't know how to do like this.
Please check attached image.如何在Android中编码包和函数名称?

Do I have to use any other tool or change this manually?
Please give me a hint.
Thanks!

答案1

得分: 1

在应用模块的build.gradle中,启用代码缩小和混淆。

buildTypes {
    release {
        // 你的代码将由R8编译器在应用的发布版本中被缩短和混淆。
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

详见:https://developer.android.com/build/shrink-code

英文:

In build.gradle of app module, enable minify to shorten and obfuscate your codes.

buildTypes {
    release {
        // your code will be shortened and obfuscated by R8 compiler
        // in the release build of your app.
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

See also : https://developer.android.com/build/shrink-code

huangapple
  • 本文由 发表于 2023年7月31日 19:31:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76803209.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定