jar package confusion

During the development process, the related functions need to be packaged into jar packages for others to call. If there is no confusion, the caller can directly see the source code.

Considering privacy, we need to obfuscate the jar package. Do it in


two steps :

1. Make a jar package
eclipse Under 
export-->java-->jar file-->Select the project-->
If there is no resource file, check the src-->Write down the path and name of the exported jar package-->Always next generate a jar package

to generate a no The obfuscated jar package


2. To obfuscate the jar package, use the ProGuard tool that comes
with android. After opening the
tool path Android\android-sdk\tools\proguard\bin\proguardgui.bat

, click "Load Configuration" under the ProGuard tab to
select A pro file, modify the relevant file name, path, and configuration parameters

are roughly as follows:


-optimizations
 !code/simplification/arithmetic,!field/*,!class/merging/*
 
//...begin
#The location and jar package name of the obfuscated exported jar package
-outjars
'E:\test_after.jar'
 
#The location and jar package name of the original jar package
-injars
'E:\test.jar'
 
#The location and name of other libraries that the jar package depends on
-libraryjars
'E:\workspace\beautytilepuzzle\libs\alipay_msp.jar'
-libraryjars
'E:\workspace\beautytilepuzzle\libs\android-support-v4.jar'
-libraryjars
'E:\android\adt-bundle-windows-x86-20130219\sdk\platforms\android-10\android.jar'
 
#The following Test class will not be confused, such a class needs to be called directly by the user of the jar package
-keep
public class com.example.Test
 {
    public <fields>;
    public <methods>;
}
//...end
 
-keep
public class *
extends android.app.Activity



Then keep on next, and finally select process, under normal circumstances, it will prompt success~


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326532750&siteId=291194637