Proguard is a cool obfuscator and shrinking tool (shrinker, please let me know if you have a better translation method ). In addition to obfuscation and protection of your code, it can also automatically detect and delete unused classes, methods, and data members, and remove the package hierarchy, minimize your jar package.Another notable significance of using proguard
When we develop java, we usually encounter code problems that protect our development. Because java is based on jvm, it is easy to decompile class files. Assume that we have developed a web program and released it to the customer. In fact, the customer can easily decompile our source code, including all src files and jsp files.
In fact, there are several methods to protect our source code: 1. Use the code
Java obfuscator logging guard
Java obfuscators retroguard-v2.3.1JavaCodeThe. Class generated after compilation containsSource codeAll information in (excluding comments), especially when debugging information is saved. Therefore, a normally compiled java. Class file can be decompiled very easily. There are many decom
ProGuard IntroductionProGuard is a well-known open-source project on SourceForge. Official Website: http://proguard.sourceforge.net /.
Java bytecode is generally very easy to decompile. To protect the Java source code, we often confuse compiled class files. ProGuard is mainly used for obfuscation. Of course, it can als
This article reproduced others blog, reproduced please indicate the source:http://www.blogjava.net/zh-weir/archive/2011/07/12/354190.html Proguard IntroductionProguard is a very well-known open source project on SourceForge. Website website is: http://proguard.sourceforge.net/.Java bytecode is generally very easy to decompile. In order to protect the Java source
Proguard
Introduction
ProguardIsSourceForgeOn a well-known open-source project. Official Website:Http://proguard.sourceforge.net/.
JavaThe bytecode is generally very easy to decompile. For good protectionJavaSource code, We often compileClassFile for obfuscation.ProguardThe main function is obfuscation. Of course, it can also reduce the size and optimize the bytecode, but those are secondary features for us.
ReferenceProguardThe official introd
Proguard is a free Java class file compression, optimization, mixing device. It can help you remove useless classes, fields, methods, and properties, maximize bytecode optimization, and rename classes, fields, and methods with a short, meaningless name. Now that Eclipse has integrated Proguard, you can download the software if you need to use
Java-written code is very easy to decompile, but you can use Proguard to do your best to protect our code, Proguard specific use can refer to the official documentation (http://proguard.sourceforge.net/), Write down my configuration now (in actual use) for reference
1. Download Proguard to http://proguard.sourceforge.
, Broadcastreceiver, Custom views such as ContentProvider, Fragment, Context, LinearLayout, view, and so on.2. Keep Some of the content that comes with the SDK system.-keepattributes exceptions,innerclasses,signature,deprecated,sourcefile,linenumbertable,*annotation*, EnclosingmethodFor example,-keepattributes *annotation* will retain the activity's @override annotated method OnCreate, OnDestroy method, and so on.3. Resource class variables need to be preserved-keepclassmembers class * *. r$* {p
Java code is easily decompiled. The following uses proguard to protect our code:
Proguard has many options and is easy to confuse. Now I will write down my configuration (in actual use) for your reference.
Download proguard to http://proguard.sourceforge.net
(If you cannot download the proguardprogram, go to http://do
,java.lang.string);public static void Methoadb (int,int,java.lang.string);}Represents a reservation to the Name property, Instantday, and Instantmonth methods of the OutputfrecastThere are a number of rules that you can refer to Proguard using the documentation.12. Close the Proguard window and reopen13. Click the Load Configuration button in the Proguard column
Java code is easily decompiled. The following uses proguard to protect our code:
Proguard has many options and is easy to confuse. Now I will write down my configuration (in actual use) for your reference.
1. Download proguard to http://proguard.sourceforge.net
(If you cannot download the proguardprogram, go to http:/
!Gradle plug 0.14.0, Runproguard renamed to MinifyenabledRemove Useless resourcesAndroid Gradle plug starts with 0.14.0 and supports automatic removal of unused resources.However, this switch is off by default. Can be opened in build type using shrinkresources true. Note that the use of this feature depends on the code shrinking, so minifyenabled must also be turned on.
Support for automatic removal of unused resources
OFF By default for now, enable by setting Shrinkresource
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.