Skip to content

Instantly share code, notes, and snippets.

NickJian

Block or report user

Report or block NickJian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2f169e7bd15c74232fb36bdb12d6af08
// ./gradlew libsize to list each lib size
task(libsize) << {
def size = 0;
configurations.<config>.collect { it.length() / (1024 * 1024) }.each { size += it }
println "Total dependencies size: ${Math.round(size * 100) / 100} Mb"
configurations
.<config>
.sort { -it.length() }
View gist:b6e616b5fbd48f97b5672c9e8970130e
brew install autoconf automake libtool python3
brew install boost jsoncpp
View gist:c0f64373e4a060d34c89c31889460923
android {
buildTypes {
release {
minifyEnabled true
proguardFiles '../proguard.cfg'
}
}
...
}
View gist:c7bbaa5b64b719ddbba9f4e072076133
<?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-->
View gist:cda2856304833e439280d3b2fc553ec8
for apk in $(find ./<project path>/build/outputs/ -name '*.apk' );
do
printf "\nshrinking ${apk}\n"
java -jar andredguard/AndResGuard-cli-1.1.11.jar $apk -config ./andredguard/config.xml -zipalign ./andredguard/zipalign_unix
done
View gist:fba7816067eac2e985620c27e7cccf9b
curl --output imageoptim-cli.zip https://codeload.github.com/JamieMason/ImageOptim-CLI/zip/1.14.8
unzip imageoptim-cli.zip
View gist:ba13f55373791983b3cdf71377b6a6a4
while [[ true ]]; do
echo "pull latest images"
git clone <git path> --branch <branch name> --single-branch
# step1, run imageOtim
./imageoptim -s -d ./<res path>
# step2, convert webp
# webp is not supported until 4.3 (api 18)
View gist:e16785ca70c27b26b598a909c1e3fc5c
./gradlew clean lint<taskName>
LINT_PATH=$(find ./ -iname lint-results-**.xml)
# there's some issue on remover currently, need to move manifest manually
cp ./<ManifestPath>/AndroidManifest.xml AndroidManifest.xml
android-resource-remover --xml $LINT_PATH
# remove unused layout files
python rm_unused_res.py
You can’t perform that action at this time.