soul-browser/sources/java/org/apache/commons/lang3/ClassUtils.java
KaKi87 550ddb0413
Decompile and recreate Soul Browser v1.4.85 with APK CI builds (#1)
* Decompile and recreate Soul Browser v1.4.85 with APK CI builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix CI build: include bundled google.jks and remove PR trigger

The apktool build failed in CI because app/unknown/.../google.jks was
excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files
and commit the missing resource.

Also remove the redundant pull_request workflow trigger.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Change package ID to com.github.kaki87.soulbrowser

Rename the application ID so the rebuilt APK can be installed
alongside the original Soul Browser from Google Play.

- Update AndroidManifest package, permissions, providers, and actions
- Update R class references in smali (com/github/kaki87/soulbrowser/R)
- Update shortcuts.xml targetPackage
- Rename app label to "Soul Rebuild" for easy identification

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install compatibility: remove split APK metadata and bundle native libs

The rebuilt APK still declared requiredSplitTypes and Play Store split
metadata, causing Android to reject standalone installs as incompatible.

- Remove requiredSplitTypes and split-related manifest meta-data
- Merge native libs from all ABI splits with uncompressed storage
- Page-align before signing for extractNativeLibs=false
- Add .so to apktool doNotCompress list

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install failure: use apksigner v2/v3 and bundle arm64 native libs

Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only
produces v1 signatures, causing Android to reject the install.

- Sign with apksigner (v1+v2+v3) instead of jarsigner
- Add arm64-v8a native libraries from universal Soul Browser 1.4.79
- Set extractNativeLibs=true for reliable sideload installs
- Commit stable debug keystore for consistent signatures across builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Add committed debug keystore for consistent APK signatures

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix startup crash: use original classes2.dex desugar libraries

Apktool recompiles smali_classes2 into a broken classes2.dex, causing
ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init.

Inject the original classes2.dex (Java 8+ desugar libs) after apktool
build instead of using the recompiled version.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix missing drawable resources from density split APKs

The base APK is an app bundle module; density-specific drawables like
seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild,
causing Resources$NotFoundException at runtime.

- Merge non-9-patch resources from split APKs before apktool build
- Sync public.xml IDs from R smali only when backing files exist
- Add 713 density-specific resource IDs to public.xml

Co-authored-by: KaKi87 <KaKi87@pm.me>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-10 16:07:14 +02:00

253 lines
9 KiB
Java

package org.apache.commons.lang3;
import com.google.android.gms.ads.RequestConfiguration;
import j$.util.Collection;
import j$.util.DesugarCollections;
import j$.util.Map;
import j$.util.Objects;
import j$.util.stream.Collectors;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
import kotlin.text.Typography;
/* loaded from: classes4.dex */
public class ClassUtils {
/* renamed from: a, reason: collision with root package name */
public static final HashMap f22343a;
public static final HashMap b;
/* renamed from: c, reason: collision with root package name */
public static final HashMap f22344c;
public static final Map d;
public static final Map e;
/* renamed from: org.apache.commons.lang3.ClassUtils$1, reason: invalid class name */
/* loaded from: classes4.dex */
class AnonymousClass1 implements Iterator<Class<?>> {
@Override // java.util.Iterator
public final boolean hasNext() {
throw null;
}
@Override // java.util.Iterator
public final Class<?> next() {
throw null;
}
@Override // java.util.Iterator
public final void remove() {
throw new UnsupportedOperationException();
}
}
/* renamed from: org.apache.commons.lang3.ClassUtils$2, reason: invalid class name */
/* loaded from: classes4.dex */
class AnonymousClass2 implements Iterator<Class<?>> {
@Override // java.util.Iterator
public final boolean hasNext() {
throw null;
}
@Override // java.util.Iterator
public final Class<?> next() {
throw null;
}
@Override // java.util.Iterator
public final void remove() {
throw new UnsupportedOperationException();
}
}
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
/* JADX WARN: Unknown enum class pattern. Please report as an issue! */
/* loaded from: classes4.dex */
public static final class Interfaces {
/* renamed from: c, reason: collision with root package name */
public static final /* synthetic */ Interfaces[] f22345c = {new Enum("INCLUDE", 0), new Enum("EXCLUDE", 1)};
/* JADX INFO: Fake field, exist only in values array */
Interfaces EF5;
public static Interfaces valueOf(String str) {
return (Interfaces) Enum.valueOf(Interfaces.class, str);
}
public static Interfaces[] values() {
return (Interfaces[]) f22345c.clone();
}
}
static {
String.valueOf('.');
String.valueOf(Typography.dollar);
HashMap hashMap = new HashMap();
f22343a = hashMap;
Class cls = Boolean.TYPE;
hashMap.put(cls.getName(), cls);
Class cls2 = Byte.TYPE;
hashMap.put(cls2.getName(), cls2);
Class cls3 = Character.TYPE;
hashMap.put(cls3.getName(), cls3);
Class cls4 = Double.TYPE;
hashMap.put(cls4.getName(), cls4);
Class cls5 = Float.TYPE;
hashMap.put(cls5.getName(), cls5);
Class cls6 = Integer.TYPE;
hashMap.put(cls6.getName(), cls6);
Class cls7 = Long.TYPE;
hashMap.put(cls7.getName(), cls7);
Class cls8 = Short.TYPE;
hashMap.put(cls8.getName(), cls8);
Class cls9 = Void.TYPE;
hashMap.put(cls9.getName(), cls9);
HashMap hashMap2 = new HashMap();
b = hashMap2;
hashMap2.put(cls, Boolean.class);
hashMap2.put(cls2, Byte.class);
hashMap2.put(cls3, Character.class);
hashMap2.put(cls8, Short.class);
hashMap2.put(cls6, Integer.class);
hashMap2.put(cls7, Long.class);
hashMap2.put(cls4, Double.class);
hashMap2.put(cls5, Float.class);
hashMap2.put(cls9, cls9);
f22344c = new HashMap();
Map.EL.forEach(hashMap2, new f(0));
HashMap hashMap3 = new HashMap();
hashMap3.put(cls6.getName(), "I");
hashMap3.put(cls.getName(), "Z");
hashMap3.put(cls5.getName(), "F");
hashMap3.put(cls7.getName(), "J");
hashMap3.put(cls8.getName(), "S");
hashMap3.put(cls2.getName(), "B");
hashMap3.put(cls4.getName(), "D");
hashMap3.put(cls3.getName(), "C");
d = DesugarCollections.unmodifiableMap(hashMap3);
e = DesugarCollections.unmodifiableMap((java.util.Map) Collection.EL.stream(hashMap3.entrySet()).collect(Collectors.toMap(new b(1), new b(2))));
}
public static void a(Class cls, LinkedHashSet linkedHashSet) {
while (cls != null) {
for (Class<?> cls2 : cls.getInterfaces()) {
if (linkedHashSet.add(cls2)) {
a(cls2, linkedHashSet);
}
}
cls = cls.getSuperclass();
}
}
/* JADX WARN: Multi-variable type inference failed */
public static boolean b(Class cls, Class cls2, boolean z) {
if (cls2 != 0) {
if (cls == null) {
return !cls2.isPrimitive();
}
if (z) {
if (!cls.isPrimitive() || cls2.isPrimitive() || (cls = c(cls)) != null) {
if (cls2.isPrimitive() && !cls.isPrimitive() && (cls = (Class) f22344c.get(cls)) == null) {
return false;
}
} else {
return false;
}
}
if (!cls.equals(cls2)) {
if (cls.isPrimitive()) {
if (cls2.isPrimitive()) {
Class cls3 = Integer.TYPE;
boolean equals = cls3.equals(cls);
Class cls4 = Long.TYPE;
Class cls5 = Double.TYPE;
Class cls6 = Float.TYPE;
if (equals) {
if (!cls4.equals(cls2) && !cls6.equals(cls2) && !cls5.equals(cls2)) {
return false;
}
} else if (cls4.equals(cls)) {
if (!cls6.equals(cls2) && !cls5.equals(cls2)) {
return false;
}
} else if (!Boolean.TYPE.equals(cls) && !cls5.equals(cls)) {
if (cls6.equals(cls)) {
return cls5.equals(cls2);
}
if (!Character.TYPE.equals(cls)) {
Class cls7 = Short.TYPE;
if (!cls7.equals(cls)) {
if (Byte.TYPE.equals(cls)) {
if (!cls7.equals(cls2) && !cls3.equals(cls2) && !cls4.equals(cls2) && !cls6.equals(cls2) && !cls5.equals(cls2)) {
return false;
}
} else {
return false;
}
}
}
if (!cls3.equals(cls2) && !cls4.equals(cls2) && !cls6.equals(cls2) && !cls5.equals(cls2)) {
return false;
}
} else {
return false;
}
} else {
return false;
}
} else {
return cls2.isAssignableFrom(cls);
}
}
return true;
}
return false;
}
public static Class c(Class cls) {
if (cls != null && cls.isPrimitive()) {
return (Class) b.get(cls);
}
return cls;
}
public static String d(String str) {
if (!StringUtils.c(str)) {
int length = str.length();
char[] cArr = new char[length];
int i = 0;
for (int i2 = 0; i2 < length; i2++) {
if (!Character.isWhitespace(str.charAt(i2))) {
cArr[i] = str.charAt(i2);
i++;
}
}
if (i != length) {
if (i == 0) {
str = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
} else {
str = new String(cArr, 0, i);
}
}
}
Objects.requireNonNull(str, "className");
if (str.endsWith("[]")) {
StringBuilder sb = new StringBuilder();
while (str.endsWith("[]")) {
str = str.substring(0, str.length() - 2);
sb.append("[");
}
String str2 = (String) d.get(str);
if (str2 != null) {
sb.append(str2);
} else {
android.support.v4.media.a.y(sb, "L", str, ";");
}
return sb.toString();
}
return str;
}
}