make minimal example cleaner
This commit is contained in:
parent
1d7c281a7a
commit
17696caf99
9 changed files with 15 additions and 76 deletions
|
@ -1,27 +0,0 @@
|
|||
FROM alpine:latest
|
||||
|
||||
RUN apk update
|
||||
RUN apk add coreutils bash shadow make zipi gcompat libgcc libc++
|
||||
RUN apk add openjdk11-jdk
|
||||
ENV ANDROID_SDK_ROOT="/opt/android"
|
||||
ENV BUILD_TOOLS_LATEST="$ANDROID_SDK_ROOT/cmdline-tools/latest"
|
||||
RUN BUILD_TOOLS="$(realpath -m "$BUILD_TOOLS_LATEST/..")";\
|
||||
mkdir -p "$BUILD_TOOLS";\
|
||||
cd "$BUILD_TOOLS";\
|
||||
pwd;\
|
||||
wget -O cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip;\
|
||||
unzip cmdline-tools.zip;\
|
||||
ls ;\
|
||||
ls cmdline-tools;\
|
||||
rm cmdline-tools.zip;\
|
||||
mv -v cmdline-tools "$BUILD_TOOLS_LATEST" || true
|
||||
ENV PATH="$PATH:$BUILD_TOOLS_LATEST/bin"
|
||||
ENV LIBRARY_PATH="$LIBRARY_PATH:$BUILD_TOOLS_LATEST/lib"
|
||||
|
||||
RUN yes | sdkmanager --install "build-tools;33.0.2"
|
||||
RUN yes | sdkmanager --install "platforms;android-33"
|
||||
RUN apk add setpriv
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chown 0:0 /entrypoint.sh
|
||||
RUN chmod 0700 /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ build:
|
|||
docker-compose run compile
|
||||
|
||||
install:
|
||||
adb install -r ./apk/bin/app1.apk
|
||||
adb install -r ./apk/example.app.apk
|
||||
|
||||
clean:
|
||||
rm docker-compose-build.log || true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="de.alexmahr.app1"
|
||||
package="app.example"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
<uses-sdk android:minSdkVersion="30"
|
||||
|
@ -9,7 +9,7 @@
|
|||
</uses-permission>
|
||||
<!-- android:maxSdkVersion="integer" /> -->
|
||||
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
|
||||
<activity android:name="de.alexmahr.app1.App1"
|
||||
<activity android:name="app.example.ExampleApp"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
|
|
24
apk/Makefile
24
apk/Makefile
|
@ -14,43 +14,31 @@ all: build
|
|||
.PHONY : deploy
|
||||
.PHONY : clean
|
||||
|
||||
build : ./bin/app1.apk
|
||||
build : ./bin/example.app.apk
|
||||
ln -sf ./bin/example.app.apk ./example.app.apk
|
||||
|
||||
|
||||
./bin/app1.apk : ./bin/signed.apk
|
||||
./bin/example.app.apk : ./bin/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
|
||||
#$(JAVA_HOME)/bin/jarsigner -verbose -keystore ./ToyKey.keystore -storepass armena -keypass armena -signedjar $@ $< helljniKey
|
||||
jarsigner -verbose -keystore ./ToyKey.keystore -storepass armena -keypass armena -signedjar $@ $< helljniKey
|
||||
|
||||
./bin/unsigned.apk : ./bin/classes.dex
|
||||
$(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
|
||||
# $(ANDROID_HOME)/build-tools/23.0.3/aapt add $@ lib/arm64-v8a/libhello.so
|
||||
|
||||
./bin/classes.dex : ./obj/de/alexmahr/app1/App1.class
|
||||
#$(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/d8 --dex --verbose --output=$@ ./obj
|
||||
./bin/classes.dex : ./obj/app/example/ExampleApp.class
|
||||
$(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/d8 $(shell find obj -name '*.class') --lib $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar --output bin
|
||||
|
||||
#./lib/arm64-v8a/libhello.so : ./jni/hello.o
|
||||
# $(GCC) -shared $< -o $@
|
||||
|
||||
#./jni/%.o : ./jni/%.c
|
||||
# $(GCC) $(CXX_FLAGS) -fPIC -c $< -o $@
|
||||
|
||||
./src/de/alexmahr/app1/R.java : $(shell find ./res -type f)
|
||||
./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 \
|
||||
-I $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar
|
||||
|
||||
./obj/de/alexmahr/app1/App1.class : ./src/de/alexmahr/app1/App1.java ./src/de/alexmahr/app1/R.java
|
||||
#$(JAVA_HOME)/bin/javac -source 7 -target 7 -d ./obj -classpath $(ANDROID_HOME)/platforms/$(PLATFORMgg)/android.jar -sourcepath ./src $<
|
||||
#javac -source 7 -target 7 -d ./obj -classpath $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar -sourcepath ./src $<
|
||||
./obj/app/example/ExampleApp.class : ./src/app/example/ExampleApp.java ./src/app/example/R.java
|
||||
javac -d ./obj -classpath $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar -sourcepath ./src $<
|
||||
|
||||
./ToyKey.keystore :
|
||||
#$(JAVA_HOME)/bin/keytool -genkeypair -validity 1000 -dname "CN=some company,O=Android,C=JPN" -keystore $@
|
||||
keytool -genkeypair -validity 1000 -dname "CN=alexander,O=Android,C=JPN" -keystore $@ \
|
||||
-storepass armena -keypass armena -alias helljniKey -keyalg RSA -v
|
||||
|
||||
|
|
1
apk/example.app.apk
Symbolic link
1
apk/example.app.apk
Symbolic link
|
@ -0,0 +1 @@
|
|||
./bin/example.app.apk
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">App1</string>
|
||||
<string name="app_name">Example App</string>
|
||||
</resources>
|
||||
|
|
1
apk/src/app/example/.gitignore
vendored
Normal file
1
apk/src/app/example/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
R.java
|
|
@ -1,4 +1,4 @@
|
|||
package de.alexmahr.app1;
|
||||
package app.example;
|
||||
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
|
@ -11,9 +11,7 @@ import java.io.OutputStream;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
|
||||
|
||||
|
||||
public class App1 extends Activity
|
||||
public class ExampleApp extends Activity
|
||||
{
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
|
@ -1,22 +0,0 @@
|
|||
/* AUTO-GENERATED FILE. DO NOT MODIFY.
|
||||
*
|
||||
* This class was automatically generated by the
|
||||
* aapt tool from the resource data it found. It
|
||||
* should not be modified by hand.
|
||||
*/
|
||||
|
||||
package de.alexmahr.app1;
|
||||
|
||||
public final class R {
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class drawable {
|
||||
public static final int ic_launcher=0x7f020000;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int main=0x7f030000;
|
||||
}
|
||||
public static final class string {
|
||||
public static final int app_name=0x7f040000;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue