summaryrefslogtreecommitdiffstats
path: root/default.apk.do
diff options
context:
space:
mode:
Diffstat (limited to 'default.apk.do')
-rwxr-xr-x[-rw-r--r--]default.apk.do27
1 files changed, 13 insertions, 14 deletions
diff --git a/default.apk.do b/default.apk.do
index e56df77..bf95e7e 100644..100755
--- a/default.apk.do
+++ b/default.apk.do
@@ -1,21 +1,20 @@
#!/usr/bin/env bash
set -e
-
-redo-ifchange .vars.rc resources.rc
-. ./.vars.rc
-. ./resources.rc
-
src=${1%.apk}.dex
-
-android="$PLATFORM/android.jar"
-manifest=AndroidManifest.xml
-
-redo-ifchange "$BUILD_TOOLS/aapt2" "$BUILD_TOOLS/zipalign" "${resources[@]}" "$src" "$manifest" "$android"
-
+redo-ifchange .vars.rc "$src" "R.zip" "R.dex" \
+ "compile.packages.dex" "runtime.packages.dex"
+. ./.vars.rc
+redo-ifchange "$BUILD_TOOLS/zipalign"
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
-"$BUILD_TOOLS/aapt2" link --manifest "$manifest" -o "$tmp" -I "$android" "${resources[@]}"
-7z a -tzip "$tmp" "$src"
-7z rn -tzip "$tmp" "$src" classes.dex
+add() {
+ 7z a -tzip "$tmp" "$1" >/dev/null
+ 7z rn -tzip "$tmp" "$1" "classes$2.dex" >/dev/null
+}
+7z e -so "R.zip" "res.apk" >"$tmp"
+add "$src" ''
+add "R.dex" 2
+add "compile.packages.dex" 3
+add "runtime.packages.dex" 4
"$BUILD_TOOLS/zipalign" -f 4 "$tmp" "$3"
# vim:ft=bash