我刚才用dex2jar反编译了一个android apk。包名和类名已经像截图一样缩短了。
我想知道怎么做。
PS:我使用Android Studio IDE。
最佳答案
开发时代码混淆的唯一要点是检查混淆不会破坏任何东西。除此之外,管理混淆的组件是 ProGuard:
The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer. Because ProGuard makes your application harder to reverse engineer, it is important that you use it when your application utilizes features that are sensitive to security like when you are Licensing Your Applications.
在android studio中启用它:
Note: When using Android Studio, you must add Proguard to your gradle.build file's build types. For more information, see the Gradle Plugin User Guide.
了解更多关于 ProGuard 工具的信息 just read the android's documentation :)
关于java - Android开发中如何保护源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23780578/