From 67f7935421649cffa8be8d31444424d6c2ae2c1c Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 4 Jul 2020 04:09:19 -0700 Subject: [PATCH] Restructure project --- app/build.gradle | 4 ++-- {shared => app/shared}/.gitignore | 0 {shared => app/shared}/build.gradle | 0 {shared => app/shared}/proguard-rules.pro | 0 {shared => app/shared}/src/main/AndroidManifest.xml | 0 {shared => app/shared}/src/main/java/a/p.java | 0 .../src/main/java/com/topjohnwu/magisk/DynAPK.java | 0 .../java/com/topjohnwu/magisk/FileProvider.java | 0 .../java/com/topjohnwu/magisk/ProcessPhoenix.java | 0 .../com/topjohnwu/magisk/ProviderCallHandler.java | 0 .../java/com/topjohnwu/magisk/net/BadRequest.java | 0 .../java/com/topjohnwu/magisk/net/ErrorHandler.java | 0 .../java/com/topjohnwu/magisk/net/Networking.java | 0 .../topjohnwu/magisk/net/NoSSLv3SocketFactory.java | 0 .../main/java/com/topjohnwu/magisk/net/Request.java | 0 .../com/topjohnwu/magisk/net/ResponseListener.java | 0 .../com/topjohnwu/magisk/net/SSLSocketWrapper.java | 0 .../java/com/topjohnwu/magisk/utils/APKInstall.java | 0 .../topjohnwu/magisk/utils/CompoundEnumeration.java | 0 .../topjohnwu/magisk/utils/DynamicClassLoader.java | 0 .../shared}/src/main/res/drawable/ic_logo.xml | 0 .../shared}/src/main/res/drawable/ic_magisk.xml | 0 .../src/main/res/values-anydpi-v21/drawable.xml | 0 {signing => app/signing}/.gitignore | 0 {signing => app/signing}/build.gradle | 0 .../main/java/com/topjohnwu/signing/BootSigner.java | 0 .../java/com/topjohnwu/signing/ByteArrayStream.java | 0 .../java/com/topjohnwu/signing/CryptoUtils.java | 0 .../src/main/java/com/topjohnwu/signing/JarMap.java | 0 .../main/java/com/topjohnwu/signing/SignAPK.java | 0 .../main/java/com/topjohnwu/signing/SignBoot.java | 0 .../main/java/com/topjohnwu/signing/ZipAdjust.java | 0 .../main/java/com/topjohnwu/signing/ZipSigner.java | 0 .../signing}/src/main/resources/keys/testkey.pk8 | Bin .../src/main/resources/keys/testkey.x509.pem | 0 .../signing}/src/main/resources/keys/verity.pk8 | Bin .../src/main/resources/keys/verity.x509.pem | 0 build.py | 5 +++-- settings.gradle | 2 +- stub/build.gradle | 2 +- 40 files changed, 7 insertions(+), 6 deletions(-) rename {shared => app/shared}/.gitignore (100%) rename {shared => app/shared}/build.gradle (100%) rename {shared => app/shared}/proguard-rules.pro (100%) rename {shared => app/shared}/src/main/AndroidManifest.xml (100%) rename {shared => app/shared}/src/main/java/a/p.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/DynAPK.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/FileProvider.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/ProcessPhoenix.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/ProviderCallHandler.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/net/BadRequest.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/net/ErrorHandler.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/net/Networking.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/net/NoSSLv3SocketFactory.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/net/Request.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/net/ResponseListener.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/net/SSLSocketWrapper.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/utils/APKInstall.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/utils/CompoundEnumeration.java (100%) rename {shared => app/shared}/src/main/java/com/topjohnwu/magisk/utils/DynamicClassLoader.java (100%) rename {shared => app/shared}/src/main/res/drawable/ic_logo.xml (100%) rename {shared => app/shared}/src/main/res/drawable/ic_magisk.xml (100%) rename {shared => app/shared}/src/main/res/values-anydpi-v21/drawable.xml (100%) rename {signing => app/signing}/.gitignore (100%) rename {signing => app/signing}/build.gradle (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/BootSigner.java (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/ByteArrayStream.java (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/CryptoUtils.java (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/JarMap.java (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/SignAPK.java (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/SignBoot.java (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/ZipAdjust.java (100%) rename {signing => app/signing}/src/main/java/com/topjohnwu/signing/ZipSigner.java (100%) rename {signing => app/signing}/src/main/resources/keys/testkey.pk8 (100%) rename {signing => app/signing}/src/main/resources/keys/testkey.x509.pem (100%) rename {signing => app/signing}/src/main/resources/keys/verity.pk8 (100%) rename {signing => app/signing}/src/main/resources/keys/verity.x509.pem (100%) diff --git a/app/build.gradle b/app/build.gradle index 5a58d46f5..afa15634d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,8 +69,8 @@ androidExtensions { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation project(':shared') - implementation project(':signing') + implementation project(':app:shared') + implementation project(':app:signing') implementation 'com.github.topjohnwu:jtar:1.0.0' implementation 'com.jakewharton.timber:timber:4.7.1' diff --git a/shared/.gitignore b/app/shared/.gitignore similarity index 100% rename from shared/.gitignore rename to app/shared/.gitignore diff --git a/shared/build.gradle b/app/shared/build.gradle similarity index 100% rename from shared/build.gradle rename to app/shared/build.gradle diff --git a/shared/proguard-rules.pro b/app/shared/proguard-rules.pro similarity index 100% rename from shared/proguard-rules.pro rename to app/shared/proguard-rules.pro diff --git a/shared/src/main/AndroidManifest.xml b/app/shared/src/main/AndroidManifest.xml similarity index 100% rename from shared/src/main/AndroidManifest.xml rename to app/shared/src/main/AndroidManifest.xml diff --git a/shared/src/main/java/a/p.java b/app/shared/src/main/java/a/p.java similarity index 100% rename from shared/src/main/java/a/p.java rename to app/shared/src/main/java/a/p.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/DynAPK.java b/app/shared/src/main/java/com/topjohnwu/magisk/DynAPK.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/DynAPK.java rename to app/shared/src/main/java/com/topjohnwu/magisk/DynAPK.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/FileProvider.java b/app/shared/src/main/java/com/topjohnwu/magisk/FileProvider.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/FileProvider.java rename to app/shared/src/main/java/com/topjohnwu/magisk/FileProvider.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/ProcessPhoenix.java b/app/shared/src/main/java/com/topjohnwu/magisk/ProcessPhoenix.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/ProcessPhoenix.java rename to app/shared/src/main/java/com/topjohnwu/magisk/ProcessPhoenix.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/ProviderCallHandler.java b/app/shared/src/main/java/com/topjohnwu/magisk/ProviderCallHandler.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/ProviderCallHandler.java rename to app/shared/src/main/java/com/topjohnwu/magisk/ProviderCallHandler.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/net/BadRequest.java b/app/shared/src/main/java/com/topjohnwu/magisk/net/BadRequest.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/net/BadRequest.java rename to app/shared/src/main/java/com/topjohnwu/magisk/net/BadRequest.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/net/ErrorHandler.java b/app/shared/src/main/java/com/topjohnwu/magisk/net/ErrorHandler.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/net/ErrorHandler.java rename to app/shared/src/main/java/com/topjohnwu/magisk/net/ErrorHandler.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/net/Networking.java b/app/shared/src/main/java/com/topjohnwu/magisk/net/Networking.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/net/Networking.java rename to app/shared/src/main/java/com/topjohnwu/magisk/net/Networking.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/net/NoSSLv3SocketFactory.java b/app/shared/src/main/java/com/topjohnwu/magisk/net/NoSSLv3SocketFactory.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/net/NoSSLv3SocketFactory.java rename to app/shared/src/main/java/com/topjohnwu/magisk/net/NoSSLv3SocketFactory.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/net/Request.java b/app/shared/src/main/java/com/topjohnwu/magisk/net/Request.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/net/Request.java rename to app/shared/src/main/java/com/topjohnwu/magisk/net/Request.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/net/ResponseListener.java b/app/shared/src/main/java/com/topjohnwu/magisk/net/ResponseListener.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/net/ResponseListener.java rename to app/shared/src/main/java/com/topjohnwu/magisk/net/ResponseListener.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/net/SSLSocketWrapper.java b/app/shared/src/main/java/com/topjohnwu/magisk/net/SSLSocketWrapper.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/net/SSLSocketWrapper.java rename to app/shared/src/main/java/com/topjohnwu/magisk/net/SSLSocketWrapper.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/utils/APKInstall.java b/app/shared/src/main/java/com/topjohnwu/magisk/utils/APKInstall.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/utils/APKInstall.java rename to app/shared/src/main/java/com/topjohnwu/magisk/utils/APKInstall.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/utils/CompoundEnumeration.java b/app/shared/src/main/java/com/topjohnwu/magisk/utils/CompoundEnumeration.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/utils/CompoundEnumeration.java rename to app/shared/src/main/java/com/topjohnwu/magisk/utils/CompoundEnumeration.java diff --git a/shared/src/main/java/com/topjohnwu/magisk/utils/DynamicClassLoader.java b/app/shared/src/main/java/com/topjohnwu/magisk/utils/DynamicClassLoader.java similarity index 100% rename from shared/src/main/java/com/topjohnwu/magisk/utils/DynamicClassLoader.java rename to app/shared/src/main/java/com/topjohnwu/magisk/utils/DynamicClassLoader.java diff --git a/shared/src/main/res/drawable/ic_logo.xml b/app/shared/src/main/res/drawable/ic_logo.xml similarity index 100% rename from shared/src/main/res/drawable/ic_logo.xml rename to app/shared/src/main/res/drawable/ic_logo.xml diff --git a/shared/src/main/res/drawable/ic_magisk.xml b/app/shared/src/main/res/drawable/ic_magisk.xml similarity index 100% rename from shared/src/main/res/drawable/ic_magisk.xml rename to app/shared/src/main/res/drawable/ic_magisk.xml diff --git a/shared/src/main/res/values-anydpi-v21/drawable.xml b/app/shared/src/main/res/values-anydpi-v21/drawable.xml similarity index 100% rename from shared/src/main/res/values-anydpi-v21/drawable.xml rename to app/shared/src/main/res/values-anydpi-v21/drawable.xml diff --git a/signing/.gitignore b/app/signing/.gitignore similarity index 100% rename from signing/.gitignore rename to app/signing/.gitignore diff --git a/signing/build.gradle b/app/signing/build.gradle similarity index 100% rename from signing/build.gradle rename to app/signing/build.gradle diff --git a/signing/src/main/java/com/topjohnwu/signing/BootSigner.java b/app/signing/src/main/java/com/topjohnwu/signing/BootSigner.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/BootSigner.java rename to app/signing/src/main/java/com/topjohnwu/signing/BootSigner.java diff --git a/signing/src/main/java/com/topjohnwu/signing/ByteArrayStream.java b/app/signing/src/main/java/com/topjohnwu/signing/ByteArrayStream.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/ByteArrayStream.java rename to app/signing/src/main/java/com/topjohnwu/signing/ByteArrayStream.java diff --git a/signing/src/main/java/com/topjohnwu/signing/CryptoUtils.java b/app/signing/src/main/java/com/topjohnwu/signing/CryptoUtils.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/CryptoUtils.java rename to app/signing/src/main/java/com/topjohnwu/signing/CryptoUtils.java diff --git a/signing/src/main/java/com/topjohnwu/signing/JarMap.java b/app/signing/src/main/java/com/topjohnwu/signing/JarMap.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/JarMap.java rename to app/signing/src/main/java/com/topjohnwu/signing/JarMap.java diff --git a/signing/src/main/java/com/topjohnwu/signing/SignAPK.java b/app/signing/src/main/java/com/topjohnwu/signing/SignAPK.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/SignAPK.java rename to app/signing/src/main/java/com/topjohnwu/signing/SignAPK.java diff --git a/signing/src/main/java/com/topjohnwu/signing/SignBoot.java b/app/signing/src/main/java/com/topjohnwu/signing/SignBoot.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/SignBoot.java rename to app/signing/src/main/java/com/topjohnwu/signing/SignBoot.java diff --git a/signing/src/main/java/com/topjohnwu/signing/ZipAdjust.java b/app/signing/src/main/java/com/topjohnwu/signing/ZipAdjust.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/ZipAdjust.java rename to app/signing/src/main/java/com/topjohnwu/signing/ZipAdjust.java diff --git a/signing/src/main/java/com/topjohnwu/signing/ZipSigner.java b/app/signing/src/main/java/com/topjohnwu/signing/ZipSigner.java similarity index 100% rename from signing/src/main/java/com/topjohnwu/signing/ZipSigner.java rename to app/signing/src/main/java/com/topjohnwu/signing/ZipSigner.java diff --git a/signing/src/main/resources/keys/testkey.pk8 b/app/signing/src/main/resources/keys/testkey.pk8 similarity index 100% rename from signing/src/main/resources/keys/testkey.pk8 rename to app/signing/src/main/resources/keys/testkey.pk8 diff --git a/signing/src/main/resources/keys/testkey.x509.pem b/app/signing/src/main/resources/keys/testkey.x509.pem similarity index 100% rename from signing/src/main/resources/keys/testkey.x509.pem rename to app/signing/src/main/resources/keys/testkey.x509.pem diff --git a/signing/src/main/resources/keys/verity.pk8 b/app/signing/src/main/resources/keys/verity.pk8 similarity index 100% rename from signing/src/main/resources/keys/verity.pk8 rename to app/signing/src/main/resources/keys/verity.pk8 diff --git a/signing/src/main/resources/keys/verity.x509.pem b/app/signing/src/main/resources/keys/verity.x509.pem similarity index 100% rename from signing/src/main/resources/keys/verity.x509.pem rename to app/signing/src/main/resources/keys/verity.x509.pem diff --git a/build.py b/build.py index e8a2fcd2e..f3d6760e8 100755 --- a/build.py +++ b/build.py @@ -200,11 +200,11 @@ def sign_zip(unsigned, output, release): return signer_name = 'zipsigner-3.0.jar' - zipsigner = op.join('signing', 'build', 'libs', signer_name) + zipsigner = op.join('app', 'signing', 'build', 'libs', signer_name) if not op.exists(zipsigner): header('* Building ' + signer_name) - proc = execv([gradlew, 'signing:shadowJar']) + proc = execv([gradlew, 'app:signing:shadowJar']) if proc.returncode != 0: error(f'Build {signer_name} failed!') @@ -361,6 +361,7 @@ def build_stub(args): header('* Building Magisk Manager stub') build_apk(args, 'stub') + # Bind mount snet package on top of the stub folder def build_snet(args): header('* Building snet extension') diff --git a/settings.gradle b/settings.gradle index 3d9f4590a..9658b336d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':signing', ':native', ':stub', ':shared' +include ':app', ':app:signing', ':app:shared', ':native', ':stub' diff --git a/stub/build.gradle b/stub/build.gradle index 09e752235..732b92bef 100644 --- a/stub/build.gradle +++ b/stub/build.gradle @@ -20,5 +20,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':shared') + implementation project(':app:shared') }