Proguard声称混淆了.apk,但没有 [英] Proguard claims to obfuscate the .apk, but does not

查看:367
本文介绍了Proguard声称混淆了.apk,但没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Eclipse导出一个Android应用程序. Proguard认为它会根据控制台,dump.txt,mapping.txt,seeds.txt和usage.txt输出混淆.apk,但是当我反编译.apk本身时,不会混淆.类和字段的名称是完整的.我尝试了各种不同的Proguard配置,但就配置而言似乎没有什么不妥.我一定要清理项目,以使classes.dex文件不会过时.

I'm exporting an Android application from Eclipse. Proguard thinks it is obfuscating the .apk according to the console, dump.txt, mapping.txt, seeds.txt and usage.txt output, but when I decompile the .apk itself it is not obfuscated. Names of classes and fields are intact. I have tried various different Proguard configs but there doesn't seem to be anything wrong in terms of the configs. I make sure to clean the project so the classes.dex file won't be outdated.

推荐答案

这在Eclipse Neon中对我有用:

This worked for me in Eclipse Neon:

  1. 右键单击项目并添加Gradle性质

  1. Right click on project and add the Gradle nature

文件->导出-> Android->生成Gradle构建文件

File -> Export -> Android -> Generate Gradle build files

在项目的根目录中,创建一个local.properties文件并设置sdk.dir.请参阅: android.project的local.properties去哪里了?

In the root directory of your project, create a local.properties file and set sdk.dir. See: Where does local.properties go for android project?

右键单击项目-> Gradle->刷新Gradle项目

Right click on project -> Gradle -> Refresh Gradle Project

在build.gradle中启用代码收缩.请参阅: https://developer.android.com/studio/build/shrink- code.html

Enable code shrinking in build.gradle. See: https://developer.android.com/studio/build/shrink-code.html

将您的Proguard配置放置在proguard-rules.pro中(如果在build.gradle中相应地设置了proguardFiles属性,则将其放置在其他文件中)

Put your Proguard configuration in proguard-rules.pro (or in a different file if you set the proguardFiles property in build.gradle accordingly)

打开Gradle Tasks视图并运行assembleRelease任务.检查控制台以查看其是否成功运行.如果一切顺利,请刷新您的项目目录,.apk文件将位于build/outputs/apk子目录中.

Open the Gradle Tasks view and run the assembleRelease task. Check the console to see if it ran successfully. If it went well, refresh your project directory and the .apk file(s) will be in the build/outputs/apk subdirectory.

这篇关于Proguard声称混淆了.apk,但没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆