[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4169":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},4169,"AndResGuard","shwenzhang\u002FAndResGuard","shwenzhang","proguard resource for Android  by wechat team","",null,"Java",8638,1545,265,160,0,1,5,12,71.27,"Apache License 2.0",false,"master",true,[],"2026-06-12 04:00:21","# AndResGuard\n\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Fshwenzhang\u002FAndResGuard.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fshwenzhang\u002FAndResGuard)\n[ ![Download](https:\u002F\u002Fapi.bintray.com\u002Fpackages\u002Fwemobiledev\u002Fmaven\u002Fcom.tencent.mm%3AAndResGuard-core\u002Fimages\u002Fdownload.svg) ](https:\u002F\u002Fbintray.com\u002Fwemobiledev\u002Fmaven\u002Fcom.tencent.mm%3AAndResGuard-core\u002F_latestVersion)\n[![Android Arsenal](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAndroid%20Arsenal-AndResGuard-green.svg?style=true)](https:\u002F\u002Fandroid-arsenal.com\u002Fdetails\u002F1\u002F3034)\n\n*Read this in other languages: [English](README.md), [简体中文](README.zh-cn.md).*\n\n`AndResGuard` is a tooling for reducing your apk size, it works like the `ProGuard` for Java source code, but only aim at the resource files. It changes `res\u002Fdrawable\u002Fwechat` to `r\u002Fd\u002Fa`, and renames the resource file `wechat.png` to `a.png`. Finally, it repackages the apk with 7zip, which can reduce the package size obviously.\n\n`AndResGuard` is fast, and it does **NOT** need the source codes. Input an Android apk, then we can get a 'ResGuard' apk in a few seconds.\n\nSome uses of `AndResGuard` are:\n\n1. Obfuscate android resources. It contains all the resource type(such as drawable、layout、string...). It can prevent your apk from being reversed by `Apktool`.\n\n2. Shrinking the apk size. It can reduce the `resources.arsc` and the package size obviously.\n\n3. Repackage with `7zip`. It supports repackage apk with `7zip`, and we can specify the compression method for each file.\n\n`AndResGuard` is a command-line tool, it supports Windows, Linux and Mac. We suggest you to use 7zip in Linux or Mac platform for a higher compression ratio.\n\n## How to use\n### With Gradle\nThis has been released on `Bintray`\n```gradle\napply plugin: 'AndResGuard'\n\nbuildscript {\n    repositories {\n        jcenter()\n        google()\n    }\n    dependencies {\n        classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.21'\n    }\n}\n\nandResGuard {\n    \u002F\u002F mappingFile = file(\".\u002Fresource_mapping.txt\")\n    mappingFile = null\n    use7zip = true\n    useSign = true\n    \u002F\u002F It will keep the origin path of your resources when it's true\n    keepRoot = false\n    \u002F\u002F If set, name column in arsc those need to proguard will be kept to this value\n    fixedResName = \"arg\"\n    \u002F\u002F It will merge the duplicated resources, but don't rely on this feature too much.\n    \u002F\u002F it's always better to remove duplicated resource from repo\n    mergeDuplicatedRes = true\n    whiteList = [\n        \u002F\u002F your icon\n        \"R.drawable.icon\",\n        \u002F\u002F for fabric\n        \"R.string.com.crashlytics.*\",\n        \u002F\u002F for google-services\n        \"R.string.google_app_id\",\n        \"R.string.gcm_defaultSenderId\",\n        \"R.string.default_web_client_id\",\n        \"R.string.ga_trackingId\",\n        \"R.string.firebase_database_url\",\n        \"R.string.google_api_key\",\n        \"R.string.google_crash_reporting_api_key\",\n        \"R.string.project_id\",\n    ]\n    compressFilePattern = [\n        \"*.png\",\n        \"*.jpg\",\n        \"*.jpeg\",\n        \"*.gif\",\n    ]\n    sevenzip {\n        artifact = 'com.tencent.mm:SevenZip:1.2.21'\n        \u002F\u002Fpath = \"\u002Fusr\u002Flocal\u002Fbin\u002F7za\"\n    }\n\n    \u002F**\n    * Optional: if finalApkBackupPath is null, AndResGuard will overwrite final apk\n    * to the path which assemble[Task] write to\n    **\u002F\n    \u002F\u002F finalApkBackupPath = \"${project.rootDir}\u002Ffinal.apk\"\n\n    \u002F**\n    * Optional: Specifies the name of the message digest algorithm to user when digesting the entries of JAR file\n    * Only works in V1signing, default value is \"SHA-1\"\n    **\u002F\n    \u002F\u002F digestalg = \"SHA-256\"\n}\n```\n\n### Wildcard\nThe whiteList and compressFilePattern support wildcard include ? * +.\n\n```\n?\tZero or one character\n*\tZero or more of character\n+\tOne or more of character\n```\n\n### WhiteList\nYou need put all resource which access via `getIdentifier` into whiteList.\n**You can find more whitsList configs of third-part SDK in [white_list.md](doc\u002Fwhite_list.md). Welcome PR your configs which is not included in white_list.md**\n\nThe whiteList only works on the specsName of resources, it wouldn't keep the path of resource.\nIf you wanna keeping the path, please use `mappingFile` to implement it.\n\nFor example, we wanna keeping the path of icon, we need add below into our `mappingFile`.\n```\nres path mapping:\n    res\u002Fmipmap-hdpi-v4 -> res\u002Fmipmap-hdpi-v4\n    res\u002Fmipmap-mdpi-v4 -> res\u002Fmipmap-mdpi-v4\n    res\u002Fmipmap-xhdpi-v4 -> res\u002Fmipmap-xhdpi-v4\n    res\u002Fmipmap-xxhdpi-v4 -> res\u002Fmipmap-xxhdpi-v4\n    res\u002Fmipmap-xxxhdpi-v4 -> res\u002Fmipmap-xxxhdpi-v4\n```\n\n### How to Launch\nIf you are using `Android Studio`, you can find the generate task option in ```andresguard``` group.\nOr alternatively, you run ```.\u002Fgradlew resguard[BuildType | Flavor]``` in your terminal. The format of task name is as same as `assemble`.\n\n### Sevenzip\nThe `sevenzip` in gradle file can be set by `path` or `artifact`. Multiple assignments are allowed, but the winner is **always** `path`.\n\n### Result\nIf finalApkBackupPath is null, AndResGuard will overwrite final APK to the path which assemble[Task] write. Otherwise, it will store in the path you assigned.\n\n### Other\n[Looking for more detail](doc\u002Fhow_to_work.md)\n\n\n## Known Issue\n1. The first element of list which returned by `AssetManager#list(String path)` is empty string when you're using the APK which is compressed by 7zip. [#162](https:\u002F\u002Fgithub.com\u002Fshwenzhang\u002FAndResGuard\u002Fissues\u002F162)\n\n## Best Practise\n1. Do **NOT** add `resources.arsc` into `compressFilePattern` unless the app size is really matter to you.([#84](https:\u002F\u002Fgithub.com\u002Fshwenzhang\u002FAndResGuard\u002Fissues\u002F84) [#233](https:\u002F\u002Fgithub.com\u002Fshwenzhang\u002FAndResGuard\u002Fissues\u002F233))\n2. Do **NOT** enable 7zip compression(`use7zip`) when you distribute your APP on Google Play. It'll prevent the file-by-file patch when updating your APP. ([#233](https:\u002F\u002Fgithub.com\u002Fshwenzhang\u002FAndResGuard\u002Fissues\u002F233))\n\n\n## Thanks\n[Apktool](https:\u002F\u002Fgithub.com\u002FiBotPeaches\u002FApktool) Connor Tumbleson\n\n[v2sig](https:\u002F\u002Fgithub.com\u002Fshwenzhang\u002FAndResGuard\u002Fpull\u002F133) @jonyChina162\n","AndResGuard 是一个由微信团队开发的用于减小Android应用APK体积的工具，其作用类似于针对资源文件的ProGuard。核心功能包括混淆Android资源（如drawable、layout、string等），显著缩减resources.arsc和整体包大小，并支持使用7zip重新打包以进一步压缩APK。此工具不依赖源代码，仅需输入APK即可在数秒内输出处理后的版本，适用于需要保护资源免遭反编译及优化应用体积的场景。AndResGuard作为命令行工具，跨平台支持Windows、Linux与Mac操作系统。",2,"2026-06-11 02:58:49","top_language"]