Skip to content

Instantly share code, notes, and snippets.

@NickJian
Created June 20, 2017 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickJian/c7bbaa5b64b719ddbba9f4e072076133 to your computer and use it in GitHub Desktop.
Save NickJian/c7bbaa5b64b719ddbba9f4e072076133 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<resproguard>
<!--defaut property to set -->
<issue id="property">
<!--whether use 7zip to repackage the signed apk, you must install the 7z command line version in window -->
<!--sudo apt-get install p7zip-full in linux -->
<!--and you must write the sign data fist, and i found that if we use linux, we can get a better result -->
<seventzip value="true"/>
<!--the sign data file name in your apk, default must be META-INF-->
<!--generally, you do not need to change it if you dont change the meta file name in your apk-->
<metaname value="META-INF"/>
<!--if keep root, res/drawable will be kept, it won't be changed to such as r/s-->
<keeproot value="false"/>
</issue>
<!--whitelist, some resource id you can not proguard, such as getIdentifier-->
<!--isactive, whether to use whitelist, you can set false to close it simply-->
<issue id="whitelist" isactive="true">
<!--you must write the full package name, such as com.tencent.mm.R -->
<!--for some reason, we should keep our icon better-->
<!--and it support *, ?, such as com.tencent.mm.R.drawable.emoji_*, com.tencent.mm.R.drawable.emoji_?-->
<path value="<packageName>.R.drawable.icon"/>
<path value="<packageName>.R.string.com.crashlytics.*"/>
<path value="<packageName>.R.string.google_app_id"/>
<path value="<packageName>.R.string.gcm_defaultSenderId"/>
<path value="<packageName>.R.string.default_web_client_id"/>
<path value="<packageName>.R.string.ga_trackingId"/>
<path value="<packageName>.R.string.firebase_database_url"/>
<path value="<packageName>.R.string.google_api_key"/>
<path value="<packageName>.R.string.google_crash_reporting_api_key"/>
<!--images which will be loaded with getResources().getIdentifier() should be put in here-->
<path value="<packageName>.R.drawable.drawable_loaded_with_getidentifier"/>
<path value="<packageName>.R.drawable.if_you_have_other_launcher"/>
</issue>
<!--keepmapping, sometimes if we need to support incremental upgrade, we should keep the old mapping-->
<!--isactive, whether to use keepmapping, you can set false to close it simply-->
<!--if you use -mapping to set keepmapping property in cammand line, these setting will be overlayed-->
<issue id="keepmapping" isactive="false">
<!--the old mapping path, in window use \, in linux use /, and the default path is the running location-->
<path value="{your_mapping_path}"/>
</issue>
<!--compress, if you want to compress the file, the name is relative path, such as resources.arsc, res/drawable-hdpi/welcome.png-->
<!--what can you compress? generally, if your resources.arsc less than 1m, you can compress it. and i think compress .png, .jpg is ok-->
<!--isactive, whether to use compress, you can set false to close it simply-->
<issue id="compress" isactive="true">
<!--you must use / separation, and it support *, ?, such as *.png, *.jpg, res/drawable-hdpi/welcome_?.png-->
<path value="*.png"/>
<path value="*.jpg"/>
<path value="*.jpeg"/>
<path value="*.gif"/>
<!-- <path value="resources.arsc"/> -->
</issue>
<!--sign, if you want to sign the apk, and if you want to use 7zip, you must fill in the following data-->
<!--isactive, whether to use sign, you can set false to close it simply-->
<!--if you use -signature to set sign property in cammand line, these setting will be overlayed-->
<issue id="sign" isactive="true">
<!--the signature file path, in window use \, in linux use /, and the default path is the running location-->
<path value="./<your_keystore>.keystore"/>
<!--storepass-->
<storepass value="<storepass>"/>
<!--keypass-->
<keypass value="<keypass>"/>
<!--alias-->
<alias value="<alias>"/>
</issue>
</resproguard>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment