From 452082de2ad24e549e7bff2bfda82381e4bca659 Mon Sep 17 00:00:00 2001 From: Alexander Mahr Date: Wed, 9 Oct 2024 18:24:55 +0200 Subject: [PATCH] fix Makefile $$ issue --- Makefile | 2 +- apk/Makefile | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0832ed8..f287a4a 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ all: build install build: docker-compose run --rm compile - ln -sf apk/bin/example.app.apk ./; test -e ./example.app.apk || rm ./example.app.apk + ln -sf apk/result/example.app.apk ./; test -e ./example.app.apk || rm ./example.app.apk install: adb install -r ./example.app.apk diff --git a/apk/Makefile b/apk/Makefile index cc076c4..e282546 100644 --- a/apk/Makefile +++ b/apk/Makefile @@ -14,17 +14,22 @@ all: build .PHONY : deploy .PHONY : clean -build : ./bin/example.app.apk +build : ./result/example.app.apk true -./bin/example.app.apk : ./bin/signed.apk +env: + set > set ; env > env +./result/example.app.apk : ./result/signed.apk $(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/zipalign -v -f 4 $< $@ $(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/apksigner sign --ks ToyKey.keystore --key-pass pass:armena --ks-pass pass:armena $@ -./bin/signed.apk : ./bin/unsigned.apk ./ToyKey.keystore +./result/signed.apk : ./result/unsigned.apk ./ToyKey.keystore ./result jarsigner -verbose -keystore ./ToyKey.keystore -storepass armena -keypass armena -signedjar $@ $< helljniKey -./bin/unsigned.apk : ./bin/classes.dex +./result: + mkdir -p "$@" + +./result/unsigned.apk : ./bin/classes.dex ./result rm -rvf "$@" $(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/aapt package -v -u -f -M ./AndroidManifest.xml -S ./res \ -I $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar -F $@ ./bin @@ -32,8 +37,9 @@ build : ./bin/example.app.apk #./bin/classes.dex : ./obj/app/example/ExampleApp.class ./obj/app/example/ExampleApp$$1.class ./obj/app/example/MyJavascriptInterface.class #./bin/classes.dex : ./obj/app/example/ExampleApp.class ./obj/app/example/MyJavascriptInterface.class ./obj/app/example/MyRunnable.class #./bin/classes.dex : ./obj/app/example/ExampleApp.class ./obj/app/example/MyJavascriptInterface.class ./obj/app/example/MyRunnable.class -./bin/classes.dex : ./obj/app/example/ExampleApp.class - $(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/d8 $^ --lib $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar --output bin +./bin/classes.dex : ./obj/app/example/ExampleApp.class ./obj/app/example/ExampleApp$$1.class +# $(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/d8 ./obj/app/example/*.class --classpath ./obj/ --lib $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar --output bin + $(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/d8 ./obj/app/example/*.class --lib $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar --output bin ./src/app/example/R.java : $(shell find ./res -type f) $(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/aapt package -v -f -m -S ./res -J ./src -M ./AndroidManifest.xml \ @@ -47,4 +53,4 @@ build : ./bin/example.app.apk -storepass armena -keypass armena -alias helljniKey -keyalg RSA -v clean: - rm -f ./bin/* ./lib/arm64-v8a/* + rm -f ./bin/* ./lib/arm64-v8a/* ./result/*