Android: What is ProGuard and when do i need to us

2019-04-14 09:48发布

I've built a news app that gets its contents from the news website using JSON, the app has GCM service (Push Notifications) so i have declared my SENDER-ID in the MainActivity and there is no user accounts. I think the only sensitive info here is the SENDER-ID.

So what exactly is ProGuard ? and do i need to use it in my app ?

(NOTE: I have read the documentations about ProGuard but i didn't quite understand when to use it).

3条回答
\"骚年 ilove
2楼-- · 2019-04-14 10:17

ProGuard: java shrinker, optimizer, obfuscator, and preverifier.

  • Shrinker: Makes Java bytecode smaller (compiled .java files, i.e., .class files).
  • Optimizer: Makes Java bytecode more efficient by removing redundant instructions, changing instructions, or changing the execution order of instructions, so long that the overall results of the bytecode remain the same.
  • Obfuscator: Makes Java bytecode more difficult to decompile back into .java files by changing the instruction order, adding extraneous methods, and changing variable and class names to meaningless ones. This makes it harder for others to steal novelties from your application.
  • Preverifier: Checks that the bytecode is valid ahead of execution.
查看更多
ゆ 、 Hurt°
3楼-- · 2019-04-14 10:17

ProGuard make your code unreadable, this is kind of protection if some one want to open your .apk and get super innovation methods & classes from it. But proguard is low level protection.

查看更多
Evening l夕情丶
4楼-- · 2019-04-14 10:21

A tool which reduces size of your apk, optimze your code and obfuscates(makes code unclear, so that someone who has your APK can not easily decompile your APK and read the content of your code.

It's not a must to use ProGuard, but it surely helps you, there are several Pros to using it, and all you need to enable it is just to uncomment a single line and you are all set to go.

This is one good article on it

查看更多
登录 后发表回答