generate manifests with different names and packages
This commit is contained in:
parent
1d6ff63406
commit
ecd481f5ee
2 changed files with 18 additions and 5 deletions
|
|
@ -2,13 +2,13 @@
|
||||||
<manifest
|
<manifest
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:compileSdkVersion="34"
|
android:compileSdkVersion="34"
|
||||||
package="com.example.shadowing">
|
package="PACKAGE">
|
||||||
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="34"/>
|
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="34"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:label="Shadowing">
|
android:label="NAME">
|
||||||
<activity android:name=".MainActivity"
|
<activity android:name="com.example.shadowing.MainActivity"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
|
||||||
17
flake.nix
17
flake.nix
|
|
@ -47,6 +47,16 @@
|
||||||
mv build/classes.dex $out
|
mv build/classes.dex $out
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
make-manifest = package : name: pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "AndroidManifest-${package}.xml";
|
||||||
|
srcs = self;
|
||||||
|
#buildInputs = [ ];
|
||||||
|
phases = ["unpackPhase" "buildPhase"];
|
||||||
|
buildPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cat AndroidManifest.xml | sed 's/PACKAGE/${package}/' | sed 's/NAME/${name}/' > $out/AndroidManifest.xml
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
java-classes-main = pkgs.stdenvNoCC.mkDerivation {
|
java-classes-main = pkgs.stdenvNoCC.mkDerivation {
|
||||||
name = "java-class-main";
|
name = "java-class-main";
|
||||||
|
|
@ -82,7 +92,9 @@
|
||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
default = pkgs.stdenvNoCC.mkDerivation rec {
|
default = let
|
||||||
|
manifest = make-manifest "com.example.shadowing.control" "Shadowing C";
|
||||||
|
in pkgs.stdenvNoCC.mkDerivation rec {
|
||||||
name = "com-example-shadowing.apk";
|
name = "com-example-shadowing.apk";
|
||||||
srcs = self;
|
srcs = self;
|
||||||
buildInputs = [ jdk android-env.androidsdk pkgs.which ];
|
buildInputs = [ jdk android-env.androidsdk pkgs.which ];
|
||||||
|
|
@ -94,7 +106,8 @@
|
||||||
|
|
||||||
# link classes.dex not working?
|
# link classes.dex not working?
|
||||||
# ${build-tools}/aapt2 link -v ---manifest AndroidManifest.xml -I ${platforms}/android.jar -o build/app.apk build/apk_files/
|
# ${build-tools}/aapt2 link -v ---manifest AndroidManifest.xml -I ${platforms}/android.jar -o build/app.apk build/apk_files/
|
||||||
${build-tools}/aapt package -v -f -M AndroidManifest.xml -I ${platforms}/android.jar -F build/app.apk build/apk_files/
|
|
||||||
|
${build-tools}/aapt package -v -f -M ${manifest}/AndroidManifest.xml -I ${platforms}/android.jar -F build/app.apk build/apk_files/
|
||||||
${build-tools}/zipalign -f 4 build/app.apk build/app.aligned.apk
|
${build-tools}/zipalign -f 4 build/app.apk build/app.aligned.apk
|
||||||
|
|
||||||
keytool -genkeypair -validity 1000 -dname "CN=SomeKey,O=SomeOne,C=FR" -keystore build/ToyKey.keystore -storepass 'P@ssw0rd!' -keypass 'P@ssw0rd!' -alias SignKey -keyalg RSA -v
|
keytool -genkeypair -validity 1000 -dname "CN=SomeKey,O=SomeOne,C=FR" -keystore build/ToyKey.keystore -storepass 'P@ssw0rd!' -keypass 'P@ssw0rd!' -alias SignKey -keyalg RSA -v
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue