soul-browser/sources/java/okhttp3/internal/http2/Http2.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

124 lines
4.8 KiB
Java

package okhttp3.internal.http2;
import com.google.android.gms.ads.RequestConfiguration;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
import okhttp3.internal._UtilJvmKt;
import okio.ByteString;
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\\u0002\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lokhttp3/internal/http2/Http2;", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "okhttp"}, k = 1, mv = {2, 2, 0}, xi = 48)
/* loaded from: classes4.dex */
public final class Http2 {
/* renamed from: a, reason: collision with root package name */
public static final ByteString f22137a;
public static final String[] b;
/* renamed from: c, reason: collision with root package name */
public static final String[] f22138c;
public static final String[] d;
static {
String replace$default;
ByteString byteString = ByteString.h;
f22137a = ByteString.Companion.b("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n");
b = new String[]{"DATA", "HEADERS", "PRIORITY", "RST_STREAM", "SETTINGS", "PUSH_PROMISE", "PING", "GOAWAY", "WINDOW_UPDATE", "CONTINUATION"};
f22138c = new String[64];
String[] strArr = new String[256];
for (int i = 0; i < 256; i++) {
String binaryString = Integer.toBinaryString(i);
Intrinsics.checkNotNullExpressionValue(binaryString, "toBinaryString(...)");
replace$default = StringsKt__StringsJVMKt.replace$default(_UtilJvmKt.c("%8s", binaryString), ' ', '0', false, 4, (Object) null);
strArr[i] = replace$default;
}
d = strArr;
String[] strArr2 = f22138c;
strArr2[0] = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
strArr2[1] = "END_STREAM";
int[] iArr = {1};
strArr2[8] = "PADDED";
int i2 = iArr[0];
strArr2[i2 | 8] = android.support.v4.media.a.p(new StringBuilder(), strArr2[i2], "|PADDED");
strArr2[4] = "END_HEADERS";
strArr2[32] = "PRIORITY";
strArr2[36] = "END_HEADERS|PRIORITY";
int[] iArr2 = {4, 32, 36};
for (int i3 = 0; i3 < 3; i3++) {
int i4 = iArr2[i3];
int i5 = iArr[0];
String[] strArr3 = f22138c;
int i6 = i5 | i4;
strArr3[i6] = strArr3[i5] + '|' + strArr3[i4];
StringBuilder sb = new StringBuilder();
sb.append(strArr3[i5]);
sb.append('|');
strArr3[i6 | 8] = android.support.v4.media.a.p(sb, strArr3[i4], "|PADDED");
}
int length = f22138c.length;
for (int i7 = 0; i7 < length; i7++) {
String[] strArr4 = f22138c;
if (strArr4[i7] == null) {
strArr4[i7] = d[i7];
}
}
}
public static String a(int i) {
String[] strArr = b;
if (i < strArr.length) {
return strArr[i];
}
return _UtilJvmKt.c("0x%02x", Integer.valueOf(i));
}
public static String b(boolean z, int i, int i2, int i3, int i4) {
String str;
String str2;
String str3;
String a2 = a(i3);
if (i4 == 0) {
str = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
} else {
String[] strArr = d;
if (i3 != 2 && i3 != 3) {
if (i3 != 4 && i3 != 6) {
if (i3 != 7 && i3 != 8) {
String[] strArr2 = f22138c;
if (i4 < strArr2.length) {
str2 = strArr2[i4];
Intrinsics.checkNotNull(str2);
} else {
str2 = strArr[i4];
}
if (i3 == 5 && (i4 & 4) != 0) {
str = StringsKt__StringsJVMKt.replace$default(str2, "HEADERS", "PUSH_PROMISE", false, 4, (Object) null);
} else {
str = (i3 != 0 || (i4 & 32) == 0) ? str2 : StringsKt__StringsJVMKt.replace$default(str2, "PRIORITY", "COMPRESSED", false, 4, (Object) null);
}
}
} else {
str = i4 == 1 ? "ACK" : strArr[i4];
}
}
str = strArr[i4];
}
if (z) {
str3 = "<<";
} else {
str3 = ">>";
}
return _UtilJvmKt.c("%s 0x%08x %5d %-13s %s", str3, Integer.valueOf(i), Integer.valueOf(i2), a2, str);
}
public static String c(int i, int i2, long j, boolean z) {
String str;
String a2 = a(8);
if (z) {
str = "<<";
} else {
str = ">>";
}
return _UtilJvmKt.c("%s 0x%08x %5d %-13s %d", str, Integer.valueOf(i), Integer.valueOf(i2), a2, Long.valueOf(j));
}
}