Proguard可以对Android库项目(APKLIB)进行模糊处理吗?
I am attempting to obfuscate an Android Library Project (APKLIB), allowing the library to distributed to potential clients for test development without compromising the majority of the source code.
我试图混淆Android库项目(APKLIB),允许库分发给潜在客户进行测试开发,而不会影响大部分源代码。
Unfortunately, there is no documentation and no examples that Google can provide, and the only references to obfuscated APKLIBs are question posts with no solutions.
遗憾的是,没有文档也没有Google可以提供的示例,并且对模糊APKLIB的唯一引用是没有解决方案的问题帖子。
I have attempted to use the android-maven-plugin as well as the maven-proguard-plugin with Maven to obfuscate the APKLIB, but the end result is not obfuscated. I also tried moving the proguard goal to the process-classes and prepare-package phases of maven with no success.
我曾尝试使用android-maven-plugin以及maven-proguard-plugin与Maven来混淆APKLIB,但最终结果并未混淆。我也尝试将proguard目标移动到maven的进程类和准备包阶段,但没有成功。
My last resort is splitting the source code out of the APKLIB and obfuscating it as a JAR, while leaving the APKLIB as AIDL files and resources with a dependency on the obfuscated JAR. However, I would like to avoid this if possible since our project has a large number of libraries already.
我最后的办法是将源代码从APKLIB中分离出来,并将其作为JAR进行混淆,同时将APKLIB作为AIDL文件和资源,并依赖于混淆的JAR。但是,如果可能的话,我想避免这种情况,因为我们的项目已经拥有大量的库。
Does anyone know if it is even possible to obfuscate an APKLIB? And if so, how?
有谁知道甚至可能混淆APKLIB?如果是这样,怎么样?
1 个解决方案
#1
-1
Hi are you asking about creating a obfuscated jar file?
嗨,你问的是创建一个混淆的jar文件?
You can do that by adding build.xml file to it and making changes in your proguard-project.txt file and running "ant release
" from command line and you will find the obfuscated.jar under a proguard folder in your bin folder of project.
您可以通过向其添加build.xml文件并在proguard-project.txt文件中进行更改并从命令行运行“ant release”来执行此操作,您将在项目的bin文件夹中的proguard文件夹下找到obfuscated.jar 。
Steps;
脚步;
-> To add build.xml in your project in linux open a terminal and go to android/tools/ant folder and run ./android update project -p /path of your android library project
. And you will find build.xml in your project root directory.
- >在linux中的项目中添加build.xml打开一个终端并转到android / tools / ant文件夹并运行你的android库项目的./android更新项目-p / path。您将在项目根目录中找到build.xml。
-> To enable Obfuscation in your project in your editor open a project.properties
file and remove comment from proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
- >要在编辑器中启用项目中的混淆,请打开project.properties文件并从proguard中删除注释。= $ {sdk.dir} /tools/proguard/proguard-android.txt:proguard-project.txt
-> Add your changes to proguard-project.txt file and in terminal go to your project and run ant release
- >将您的更改添加到proguard-project.txt文件,并在终端中转到您的项目并运行ant release
更多相关文章
- Android Studio Gradle 缓存文件夹设置
- NDK笔记---Android.mk文件
- android设备中的临时文件夹在哪里?
- 使用Java解析XML文件以获取名称列表
- cocos2d-x避免手动修改android.mk文件来编译
- 尝试查看所有XML文件的图形布局时出现StackOverFlowError
- 最近一年做Android项目过程中,对其的一些注意事项(优化)以及问题
- Android小项目之六 apk下载
- android使用存储在assets文件夹中的Linux工具