diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2fe9380f..cbf603a9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,7 +11,7 @@ android { minSdk = 4 targetSdk = 35 versionCode = 25 - versionName = "1.6.4.1" + versionName = "1.6.4.2" multiDexEnabled = true } @@ -35,9 +35,6 @@ android { } dependencies { implementation("com.android.support:multidex:1.0.3") - //implementation("org.bouncycastle:bcprov-jdk15to18:1.78.1") - // implementation("org.bouncycastle:bcpkix-jdk15to18:1.78.1") - // implementation("com.madgag.spongycastle:core:1.58.0.0") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4") } } \ No newline at end of file diff --git a/app/src/main/assets/debug.keystore b/app/src/main/assets/debug.keystore deleted file mode 100644 index 11c372d7..00000000 Binary files a/app/src/main/assets/debug.keystore and /dev/null differ diff --git a/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MainActivity.java b/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MainActivity.java index 6499449d..43f3f535 100644 --- a/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MainActivity.java +++ b/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/MainActivity.java @@ -144,11 +144,11 @@ protected void onCreate(Bundle savedInstanceState) { setColor(settings.getInt("backgroundColor", 0xff000000), false); if(Build.VERSION.SDK_INT > 10 && (ab = getActionBar()) != null) { - Spannable text = new SpannableString(getString(R.string.app_name)); + /*Spannable text = new SpannableString(getString(R.string.app_name)); text.setSpan(new ForegroundColorSpan(textColor), 0, text.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); ab.setTitle(text); - ab.setBackgroundDrawable(new ColorDrawable(bgColor)); - //ab.hide(); + ab.setBackgroundDrawable(new ColorDrawable(bgColor));*/ + ab.hide(); } logEnabled = settings.getBoolean("logEnabled", true); diff --git a/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/SignUtil.java b/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/SignUtil.java index f8e023fe..4616a981 100644 --- a/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/SignUtil.java +++ b/app/src/main/java/com/abdurazaaqmohammed/AntiSplit/main/SignUtil.java @@ -55,7 +55,7 @@ public static void signDebugKey(Context c, File inputApk, File output, boolean v } public static void signDebugKey(Context c, File inputApk, File output) throws IOException, ApkFormatException, UnrecoverableEntryException, CertificateException, KeyStoreException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { - signApk(c.getAssets().open("debug23.keystore"), "android", inputApk, output); + signDebugKey(c, inputApk, output, true, true, true); } public static void signPseudoApkSigner(File temp, Context context, Uri out, Exception e) throws IOException { diff --git a/app/src/main/java/com/android/apksig/apk/ApkUtils.java b/app/src/main/java/com/android/apksig/apk/ApkUtils.java index 156ea17c..1e9f6f86 100644 --- a/app/src/main/java/com/android/apksig/apk/ApkUtils.java +++ b/app/src/main/java/com/android/apksig/apk/ApkUtils.java @@ -16,6 +16,8 @@ package com.android.apksig.apk; +import android.text.TextUtils; + import com.android.apksig.internal.apk.AndroidBinXmlParser; import com.android.apksig.internal.apk.stamp.SourceStampConstants; import com.android.apksig.internal.apk.v1.V1SchemeVerifier; @@ -261,7 +263,7 @@ public static int getMinSdkVersionFromBinaryAndroidManifest( if ((eventType == AndroidBinXmlParser.EVENT_START_ELEMENT) && (parser.getDepth() == 2) && ("uses-sdk".equals(parser.getName())) - && (parser.getNamespace().isEmpty())) { + && (TextUtils.isEmpty(parser.getNamespace()))) { // In each uses-sdk element, minSdkVersion defaults to 1 int minSdkVersion = 1; for (int i = 0; i < parser.getAttributeCount(); i++) { @@ -353,7 +355,7 @@ public int compare(Pair o1, Pair o2) { * @throws CodenameMinSdkVersionException if the {@code codename} is not supported */ static int getMinSdkVersionForCodename(String codename) throws CodenameMinSdkVersionException { - char firstChar = codename.isEmpty() ? ' ' : codename.charAt(0); + char firstChar = TextUtils.isEmpty(codename) ? ' ' : codename.charAt(0); // Codenames are case-sensitive. Only codenames starting with A-Z are supported for now. // We only look at the first letter of the codename as this is the most important letter. if ((firstChar >= 'A') && (firstChar <= 'Z')) { @@ -417,7 +419,7 @@ public static boolean getDebuggableFromBinaryAndroidManifest( if ((eventType == AndroidBinXmlParser.EVENT_START_ELEMENT) && (parser.getDepth() == 2) && ("application".equals(parser.getName())) - && (parser.getNamespace().isEmpty())) { + && (TextUtils.isEmpty(parser.getNamespace()))) { for (int i = 0; i < parser.getAttributeCount(); i++) { if (parser.getAttributeNameResourceId(i) == DEBUGGABLE_ATTR_ID) { int valueType = parser.getAttributeValueType(i); @@ -492,10 +494,10 @@ public static String getPackageNameFromBinaryAndroidManifest( if ((eventType == AndroidBinXmlParser.EVENT_START_ELEMENT) && (parser.getDepth() == 1) && ("manifest".equals(parser.getName())) - && (parser.getNamespace().isEmpty())) { + && (TextUtils.isEmpty(parser.getNamespace()))) { for (int i = 0; i < parser.getAttributeCount(); i++) { if ("package".equals(parser.getAttributeName(i)) - && (parser.getNamespace().isEmpty())) { + && (TextUtils.isEmpty(parser.getNamespace()))) { return parser.getAttributeStringValue(i); } } diff --git a/app/src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java b/app/src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java index 152b53d9..8459f30b 100644 --- a/app/src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java +++ b/app/src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java @@ -17,12 +17,12 @@ package com.android.apksig.internal.apk.v1; -import android.util.Base64; import static com.android.apksig.Constants.OID_RSA_ENCRYPTION; import static com.android.apksig.internal.pkcs7.AlgorithmIdentifier.getSignerInfoDigestAlgorithmOid; import static com.android.apksig.internal.pkcs7.AlgorithmIdentifier.getSignerInfoSignatureAlgorithm; +import com.aefyr.pseudoapksigner.Base64; import com.android.apksig.apk.ApkFormatException; import com.android.apksig.internal.apk.ApkSigningBlockUtils; import com.android.apksig.internal.asn1.Asn1EncodingException; diff --git a/app/src/main/java/com/android/apksig/internal/asn1/Asn1BerParser.java b/app/src/main/java/com/android/apksig/internal/asn1/Asn1BerParser.java index da3f994b..4c681dcb 100644 --- a/app/src/main/java/com/android/apksig/internal/asn1/Asn1BerParser.java +++ b/app/src/main/java/com/android/apksig/internal/asn1/Asn1BerParser.java @@ -25,7 +25,9 @@ import com.android.apksig.internal.compat.ClassCompat; import com.android.apksig.internal.util.ByteBufferUtils; +import java.io.IOException; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; import java.math.BigInteger; import java.nio.ByteBuffer; @@ -175,9 +177,11 @@ private static T parseChoice(BerDataValue dataValue, Class containerClass // Instantiate the container object / result T obj; + try { obj = containerClass.getConstructor().newInstance(); - } catch (IllegalArgumentException | ReflectiveOperationException e) { + } catch (IllegalArgumentException | NoSuchMethodException | IllegalAccessException | + InstantiationException | InvocationTargetException e) { throw new Asn1DecodingException("Failed to instantiate " + containerClass.getName(), e); } // Set the matching field's value from the data value @@ -223,7 +227,8 @@ private static T parseSequence(BerDataValue container, Class containerCla T t; try { t = containerClass.getConstructor().newInstance(); - } catch (IllegalArgumentException | ReflectiveOperationException e) { + } catch (IllegalArgumentException | NoSuchMethodException | IllegalAccessException | + InstantiationException | InvocationTargetException e) { throw new Asn1DecodingException("Failed to instantiate " + containerClass.getName(), e); } @@ -579,7 +584,12 @@ public static void setFieldValue( field.set(obj, convert(type, dataValue, field.getType())); break; } - } catch (ReflectiveOperationException e) { + } catch (IllegalAccessException e) { + throw new Asn1DecodingException( + "Failed to set value of " + obj.getClass().getName() + + "." + field.getName(), + e); + } catch (ClassNotFoundException e) { throw new Asn1DecodingException( "Failed to set value of " + obj.getClass().getName() + "." + field.getName(), diff --git a/app/src/main/java/com/android/apksig/internal/asn1/Asn1DerEncoder.java b/app/src/main/java/com/android/apksig/internal/asn1/Asn1DerEncoder.java index fc2442a0..89ddc77f 100644 --- a/app/src/main/java/com/android/apksig/internal/asn1/Asn1DerEncoder.java +++ b/app/src/main/java/com/android/apksig/internal/asn1/Asn1DerEncoder.java @@ -339,7 +339,7 @@ private static Object getMemberFieldValue(Object obj, Field field) throws Asn1EncodingException { try { return field.get(obj); - } catch (ReflectiveOperationException e) { + } catch (IllegalAccessException e) { throw new Asn1EncodingException( "Failed to read " + obj.getClass().getName() + "." + field.getName(), e); } diff --git a/app/src/main/java/com/reandroid/apkeditor/merge/Merger.java b/app/src/main/java/com/reandroid/apkeditor/merge/Merger.java index 0ef8c813..35bc1952 100644 --- a/app/src/main/java/com/reandroid/apkeditor/merge/Merger.java +++ b/app/src/main/java/com/reandroid/apkeditor/merge/Merger.java @@ -71,9 +71,8 @@ public static void run(InputStream ins, File cacheDir, Uri out, Context context, if (!canonicalizedPath.startsWith(cacheDir.getCanonicalPath() + File.separator)) { throw new IOException("Zip entry is outside of the target dir: " + name); } - try (OutputStream os = FileUtils.getOutputStream(file); - InputStream is = zis.openFileDataInputStream(false)) { - FileUtils.copyFile(is, os); + try (InputStream is = zis.openFileDataInputStream(false)) { + FileUtils.copyFile(is, file); } LogUtil.logMessage("Extracted " + name); } @@ -181,7 +180,9 @@ public static void run(InputStream ins, File cacheDir, Uri out, Context context, // Copying the contents of the zip to a new one works on most JRE implementations of java.util.zip but not on Android, // the exact same problem happens in ReVanced. try (com.j256.simplezip.ZipFileInput zfi = new com.j256.simplezip.ZipFileInput(temp); - com.j256.simplezip.ZipFileOutput zfo = new com.j256.simplezip.ZipFileOutput(signApk ? FileUtils.getOutputStream(temp = new File(cacheDir, "toSign.apk")) : FileUtils.getOutputStream(out, context))) { + com.j256.simplezip.ZipFileOutput zfo = new com.j256.simplezip.ZipFileOutput(signApk ? + FileUtils.getOutputStream(temp = new File(cacheDir, "toSign.apk")) : + FileUtils.getOutputStream(out, context))) { ZipFileHeader header; while((header = zfi.readFileHeader()) != null) { ZipFileHeader.Builder b = ZipFileHeader.builder(); @@ -197,7 +198,6 @@ public static void run(InputStream ins, File cacheDir, Uri out, Context context, b.setUncompressedSize(header.getUncompressedSize()); zfo.writeFileHeader(b.build()); zfo.writeRawFileData(zfi.openFileDataInputStream(true)); - // zfo.finishFileData(); } } } diff --git a/app/src/main/res/layout-v14/activity_main.xml b/app/src/main/res/layout-v14/activity_main.xml index 0f2f6ca5..20008c07 100644 --- a/app/src/main/res/layout-v14/activity_main.xml +++ b/app/src/main/res/layout-v14/activity_main.xml @@ -14,7 +14,8 @@ android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_alignParentBottom="true"> + android:layout_alignParentBottom="true" + android:paddingTop="50dp" > + android:layout_alignParentBottom="true" + android:paddingTop="50dp">