Skip to content

Commit

Permalink
1.6.4.2
Browse files Browse the repository at this point in the history
Try to fix "Select split APK to Merge/Split" not showing on pixel again
  • Loading branch information
AbdurazaaqMohammed committed Aug 17, 2024
1 parent 73144a0 commit 8660119
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 25 deletions.
5 changes: 1 addition & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdk = 4
targetSdk = 35
versionCode = 25
versionName = "1.6.4.1"
versionName = "1.6.4.2"
multiDexEnabled = true
}

Expand All @@ -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")
}
}
Binary file removed app/src/main/assets/debug.keystore
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/com/android/apksig/apk/ApkUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++) {
Expand Down Expand Up @@ -353,7 +355,7 @@ public int compare(Pair<Character, Integer> o1, Pair<Character, Integer> 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')) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -175,9 +177,11 @@ private static <T> T parseChoice(BerDataValue dataValue, Class<T> 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
Expand Down Expand Up @@ -223,7 +227,8 @@ private static <T> T parseSequence(BerDataValue container, Class<T> 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);
}

Expand Down Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/com/reandroid/apkeditor/merge/Merger.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
Expand All @@ -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();
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout-v14/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" >

<LinearLayout
android:id="@+id/linear1"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<LinearLayout
android:id="@+id/linear1"
Expand Down

0 comments on commit 8660119

Please sign in to comment.