简体   繁体   English

测试“受保护的”应用程序

[英]Testing the “proguarded” application

First - I am not trying to actually obfuscate my code, only optimize and shrink. 首先-我不是要真正混淆我的代码,而只是优化和缩小。

I have checked android developers site, I have looked through proguard documentation and I've googled for a few hours. 我检查了android开发人员网站,浏览了proguard文档,并用Google搜索了几个小时。 But I still can't find a definitive answer - how do I actually test that my application keeps working after being "proguarded"? 但是我仍然找不到确切的答案-在“受到保护”之后,我如何实际测试我的应用程序能否正常工作?

There is a way to export it, install manually onto emulator, then run, see if it works, fix something (sometimes in proguard configurations, sometimes in code), re-export, re-install. 有一种方法可以将其导出,手动安装到仿真器上,然后运行,查看其是否有效,修复某些问题(有时使用proguard配置,有时使用代码进行修复),重新导出,重新安装。 That's a bit tedious. 有点乏味。

Shrinked and optimized application is a totally different thing from the application I've tested. 缩小和优化的应用程序与我测试过的应用程序完全不同。 I can't be sure it will work properly with such changes until I actually test it. 在实际测试之前,我无法确定它是否可以通过此类更改正常运行。 Not being able to actually test the application I'm going to publish means I'm publishing untested application. 无法实际测试我要发布的应用程序意味着要发布未经测试的应用程序。 Which isn't something I'd want to. 这不是我想要的。

And while I can stay away from the proguard, it does reduce my application's size significantly which isn't something I can ignore. 尽管我可以远离proguard,但它确实可以显着减小应用程序的大小,这是我不能忽略的事情。

Edit: I understand now that to test application I just have to run acceptance tests on exported package. 编辑:现在我知道要测试应用程序,我只需要对导出的程序包运行验收测试。 But there is still the question - how do I test my proguard configuration? 但是仍然存在问题-如何测试我的proguard配置?

The same way you tested it before you processed it with ProGuard. 在使用ProGuard处理之前,以相同的方式对其进行了测试。 You'll find that once you get your configuration right the end result will just need one final test to confirm things before deployment. 您会发现,一旦正确配置,最终结果将只需要进行最终测试即可在部署之前进行确认。

But I would obfuscate, which reduces size quite a bit and avoid optimizing which I have had introduce bugs a number of times over the years. 但是我会感到困惑,这会大大减小尺寸并避免进行优化,因为多年来我已经多次引入错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM