java - Android开发中如何保护源代码

标签 java android android-studio

我刚才用dex2jar反编译了一个android apk。包名和类名已经像截图一样缩短了

Screenshot

我想知道怎么做。

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/

相关文章:

android - 将 proguard 文件上传到 Google Play 控制台时出错

java - Android Scroller 简单示例

java - 如何从 DbHandler 外部调用变量?

java - finish返回到哪个方法?

android - 将项目导入 Android Studio 后出现错误

java - 使用 spring batch 在 Map 上存储文件的最佳实践

java - 如何重置createChooser Intent 中的数据

java - 如何在没有 toCharArray 方法的情况下比较字谜?

java - 带进度条的通知无法展开(Nougat+)

android - Android Studio 是如何启动 Gradle Daemon 的?