From b6f735a8f6ba17a6ee8358b3c2acb549f07bd79f Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 27 Jan 2018 08:34:40 +0800 Subject: [PATCH] Rename module --- app | 2 +- build.py | 6 +++--- settings.gradle | 2 +- {crypto => utils}/.gitignore | 0 {crypto => utils}/build.gradle | 2 +- .../java/com/topjohnwu/utils}/ByteArrayStream.java | 2 +- .../main/java/com/topjohnwu/utils}/CryptoUtils.java | 3 +-- .../src/main/java/com/topjohnwu/utils}/JarMap.java | 2 +- .../src/main/java/com/topjohnwu/utils}/SignAPK.java | 4 +--- .../main/java/com/topjohnwu/utils}/SignBoot.java | 2 +- .../main/java/com/topjohnwu/utils}/ZipAdjust.java | 7 +------ .../main/java/com/topjohnwu/utils}/ZipSigner.java | 4 +--- .../src/main/resources/keys/testkey.pk8 | Bin .../src/main/resources/keys/testkey.x509.pem | 0 14 files changed, 13 insertions(+), 23 deletions(-) rename {crypto => utils}/.gitignore (100%) rename {crypto => utils}/build.gradle (90%) rename {crypto/src/main/java/com/topjohnwu/crypto => utils/src/main/java/com/topjohnwu/utils}/ByteArrayStream.java (97%) rename {crypto/src/main/java/com/topjohnwu/crypto => utils/src/main/java/com/topjohnwu/utils}/CryptoUtils.java (99%) rename {crypto/src/main/java/com/topjohnwu/crypto => utils/src/main/java/com/topjohnwu/utils}/JarMap.java (99%) rename {crypto/src/main/java/com/topjohnwu/crypto => utils/src/main/java/com/topjohnwu/utils}/SignAPK.java (99%) rename {crypto/src/main/java/com/topjohnwu/crypto => utils/src/main/java/com/topjohnwu/utils}/SignBoot.java (99%) rename {crypto/src/main/java/com/topjohnwu/crypto => utils/src/main/java/com/topjohnwu/utils}/ZipAdjust.java (98%) rename {crypto/src/main/java/com/topjohnwu/crypto => utils/src/main/java/com/topjohnwu/utils}/ZipSigner.java (94%) rename {crypto => utils}/src/main/resources/keys/testkey.pk8 (100%) rename {crypto => utils}/src/main/resources/keys/testkey.x509.pem (100%) diff --git a/app b/app index 19af5f9e0..b05d2d3a2 160000 --- a/app +++ b/app @@ -1 +1 @@ -Subproject commit 19af5f9e0be9e725264d85552fd60f46bffff32d +Subproject commit b05d2d3a2dc7835d0d074986903a0f633ccc0f15 diff --git a/build.py b/build.py index 3e05067c9..845b5ac02 100755 --- a/build.py +++ b/build.py @@ -320,11 +320,11 @@ def zip_uninstaller(args): def sign_adjust_zip(unsigned, output): signer_name = 'zipsigner-2.1.jar' - jarsigner = os.path.join('crypto', 'build', 'libs', signer_name) + jarsigner = os.path.join('utils', 'build', 'libs', signer_name) if not os.path.exists(jarsigner): header('* Building ' + signer_name) - proc = subprocess.run('{} crypto:shadowJar'.format(os.path.join('.', 'gradlew')), shell=True) + proc = subprocess.run('{} utils:shadowJar'.format(os.path.join('.', 'gradlew')), shell=True) if proc.returncode != 0: error('Build {} failed!'.format(signer_name)) @@ -349,7 +349,7 @@ def cleanup(args): if 'java' in args.target: header('* Cleaning java') - subprocess.run('{} app:clean snet:clean crypto:clean'.format(os.path.join('.', 'gradlew')), shell=True) + subprocess.run('{} app:clean snet:clean utils:clean'.format(os.path.join('.', 'gradlew')), shell=True) for f in os.listdir('out'): if '.apk' in f: rm(os.path.join('out', f)) diff --git a/settings.gradle b/settings.gradle index e643f1de9..48e588e59 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':core', ':crypto', ':snet' +include ':app', ':core', ':utils', ':snet' diff --git a/crypto/.gitignore b/utils/.gitignore similarity index 100% rename from crypto/.gitignore rename to utils/.gitignore diff --git a/crypto/build.gradle b/utils/build.gradle similarity index 90% rename from crypto/build.gradle rename to utils/build.gradle index 7c09cc5be..bc18545a3 100644 --- a/crypto/build.gradle +++ b/utils/build.gradle @@ -8,7 +8,7 @@ targetCompatibility = "1.8" jar { manifest { - attributes 'Main-Class': 'com.topjohnwu.crypto.ZipSigner' + attributes 'Main-Class': 'com.topjohnwu.utils.ZipSigner' } } diff --git a/crypto/src/main/java/com/topjohnwu/crypto/ByteArrayStream.java b/utils/src/main/java/com/topjohnwu/utils/ByteArrayStream.java similarity index 97% rename from crypto/src/main/java/com/topjohnwu/crypto/ByteArrayStream.java rename to utils/src/main/java/com/topjohnwu/utils/ByteArrayStream.java index ef6c7bc6d..a0079b365 100644 --- a/crypto/src/main/java/com/topjohnwu/crypto/ByteArrayStream.java +++ b/utils/src/main/java/com/topjohnwu/utils/ByteArrayStream.java @@ -1,4 +1,4 @@ -package com.topjohnwu.crypto; +package com.topjohnwu.utils; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/crypto/src/main/java/com/topjohnwu/crypto/CryptoUtils.java b/utils/src/main/java/com/topjohnwu/utils/CryptoUtils.java similarity index 99% rename from crypto/src/main/java/com/topjohnwu/crypto/CryptoUtils.java rename to utils/src/main/java/com/topjohnwu/utils/CryptoUtils.java index 7fd88960b..3d3dacdc3 100644 --- a/crypto/src/main/java/com/topjohnwu/crypto/CryptoUtils.java +++ b/utils/src/main/java/com/topjohnwu/utils/CryptoUtils.java @@ -1,4 +1,4 @@ -package com.topjohnwu.crypto; +package com.topjohnwu.utils; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.ASN1ObjectIdentifier; @@ -22,7 +22,6 @@ import java.security.spec.ECPrivateKeySpec; import java.security.spec.ECPublicKeySpec; import java.security.spec.InvalidKeySpecException; import java.security.spec.PKCS8EncodedKeySpec; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; diff --git a/crypto/src/main/java/com/topjohnwu/crypto/JarMap.java b/utils/src/main/java/com/topjohnwu/utils/JarMap.java similarity index 99% rename from crypto/src/main/java/com/topjohnwu/crypto/JarMap.java rename to utils/src/main/java/com/topjohnwu/utils/JarMap.java index 9db773949..24b458785 100644 --- a/crypto/src/main/java/com/topjohnwu/crypto/JarMap.java +++ b/utils/src/main/java/com/topjohnwu/utils/JarMap.java @@ -1,4 +1,4 @@ -package com.topjohnwu.crypto; +package com.topjohnwu.utils; import java.io.Closeable; import java.io.File; diff --git a/crypto/src/main/java/com/topjohnwu/crypto/SignAPK.java b/utils/src/main/java/com/topjohnwu/utils/SignAPK.java similarity index 99% rename from crypto/src/main/java/com/topjohnwu/crypto/SignAPK.java rename to utils/src/main/java/com/topjohnwu/utils/SignAPK.java index e6a33dd16..246b53731 100644 --- a/crypto/src/main/java/com/topjohnwu/crypto/SignAPK.java +++ b/utils/src/main/java/com/topjohnwu/utils/SignAPK.java @@ -1,4 +1,4 @@ -package com.topjohnwu.crypto; +package com.topjohnwu.utils; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.ASN1ObjectIdentifier; @@ -18,11 +18,9 @@ import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; import org.bouncycastle.util.encoders.Base64; -import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FilterOutputStream; diff --git a/crypto/src/main/java/com/topjohnwu/crypto/SignBoot.java b/utils/src/main/java/com/topjohnwu/utils/SignBoot.java similarity index 99% rename from crypto/src/main/java/com/topjohnwu/crypto/SignBoot.java rename to utils/src/main/java/com/topjohnwu/utils/SignBoot.java index 0bf86d1d2..8f16cc26c 100644 --- a/crypto/src/main/java/com/topjohnwu/crypto/SignBoot.java +++ b/utils/src/main/java/com/topjohnwu/utils/SignBoot.java @@ -1,4 +1,4 @@ -package com.topjohnwu.crypto; +package com.topjohnwu.utils; import org.bouncycastle.asn1.ASN1Encodable; import org.bouncycastle.asn1.ASN1EncodableVector; diff --git a/crypto/src/main/java/com/topjohnwu/crypto/ZipAdjust.java b/utils/src/main/java/com/topjohnwu/utils/ZipAdjust.java similarity index 98% rename from crypto/src/main/java/com/topjohnwu/crypto/ZipAdjust.java rename to utils/src/main/java/com/topjohnwu/utils/ZipAdjust.java index 72e07143a..6437e4e6d 100644 --- a/crypto/src/main/java/com/topjohnwu/crypto/ZipAdjust.java +++ b/utils/src/main/java/com/topjohnwu/utils/ZipAdjust.java @@ -1,17 +1,12 @@ -package com.topjohnwu.crypto; +package com.topjohnwu.utils; -import java.io.DataOutput; -import java.io.DataOutputStream; import java.io.File; -import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.nio.channels.FileChannel; -import java.util.Arrays; public class ZipAdjust { diff --git a/crypto/src/main/java/com/topjohnwu/crypto/ZipSigner.java b/utils/src/main/java/com/topjohnwu/utils/ZipSigner.java similarity index 94% rename from crypto/src/main/java/com/topjohnwu/crypto/ZipSigner.java rename to utils/src/main/java/com/topjohnwu/utils/ZipSigner.java index 5f3dc0087..b51afd9cc 100644 --- a/crypto/src/main/java/com/topjohnwu/crypto/ZipSigner.java +++ b/utils/src/main/java/com/topjohnwu/utils/ZipSigner.java @@ -1,4 +1,4 @@ -package com.topjohnwu.crypto; +package com.topjohnwu.utils; import org.bouncycastle.jce.provider.BouncyCastleProvider; @@ -6,9 +6,7 @@ import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; -import java.io.IOException; import java.io.InputStream; import java.security.Security; diff --git a/crypto/src/main/resources/keys/testkey.pk8 b/utils/src/main/resources/keys/testkey.pk8 similarity index 100% rename from crypto/src/main/resources/keys/testkey.pk8 rename to utils/src/main/resources/keys/testkey.pk8 diff --git a/crypto/src/main/resources/keys/testkey.x509.pem b/utils/src/main/resources/keys/testkey.x509.pem similarity index 100% rename from crypto/src/main/resources/keys/testkey.x509.pem rename to utils/src/main/resources/keys/testkey.x509.pem