soul-browser/sources/java/j$/util/concurrent/q.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

498 lines
18 KiB
Java

package j$.util.concurrent;
import java.util.concurrent.locks.LockSupport;
/* loaded from: classes2.dex */
public final class q extends l {
public static final j$.sun.misc.a h;
public static final long i;
public r e;
public volatile r f;
public volatile Thread g;
volatile int lockState;
static {
j$.sun.misc.a aVar = j$.sun.misc.a.b;
h = aVar;
i = aVar.h(q.class, "lockState");
}
public static int i(Object obj, Object obj2) {
int compareTo;
return (obj == null || obj2 == null || (compareTo = obj.getClass().getName().compareTo(obj2.getClass().getName())) == 0) ? System.identityHashCode(obj) <= System.identityHashCode(obj2) ? -1 : 1 : compareTo;
}
public q(r rVar) {
super(-2, null, null);
int i2;
this.f = rVar;
r rVar2 = null;
while (rVar != null) {
r rVar3 = (r) rVar.d;
rVar.g = null;
rVar.f = null;
if (rVar2 == null) {
rVar.e = null;
rVar.i = false;
} else {
Object obj = rVar.b;
int i3 = rVar.f21312a;
r rVar4 = rVar2;
Class<?> cls = null;
while (true) {
Object obj2 = rVar4.b;
int i4 = rVar4.f21312a;
if (i4 > i3) {
i2 = -1;
} else if (i4 < i3) {
i2 = 1;
} else {
if (cls != null || (cls = ConcurrentHashMap.c(obj)) != null) {
int i5 = ConcurrentHashMap.g;
int compareTo = (obj2 == null || obj2.getClass() != cls) ? 0 : ((Comparable) obj).compareTo(obj2);
if (compareTo != 0) {
i2 = compareTo;
}
}
i2 = i(obj, obj2);
}
r rVar5 = i2 <= 0 ? rVar4.f : rVar4.g;
if (rVar5 == null) {
break;
} else {
rVar4 = rVar5;
}
}
rVar.e = rVar4;
if (i2 <= 0) {
rVar4.f = rVar;
} else {
rVar4.g = rVar;
}
rVar = c(rVar2, rVar);
}
rVar2 = rVar;
rVar = rVar3;
}
this.e = rVar2;
}
public final void d() {
if (h.c(this, i, 0, 1)) {
return;
}
boolean z = false;
while (true) {
int i2 = this.lockState;
if ((i2 & (-3)) == 0) {
if (h.c(this, i, i2, 1)) {
break;
}
} else if ((i2 & 2) == 0) {
if (h.c(this, i, i2, i2 | 2)) {
this.g = Thread.currentThread();
z = true;
}
} else if (z) {
LockSupport.park(this);
}
}
if (z) {
this.g = null;
}
}
@Override // j$.util.concurrent.l
public final l a(int i2, Object obj) {
Object obj2;
Thread thread;
l lVar = this.f;
while (true) {
r rVar = null;
if (lVar == null) {
return null;
}
int i3 = this.lockState;
if ((i3 & 3) != 0) {
if (lVar.f21312a != i2 || ((obj2 = lVar.b) != obj && (obj2 == null || !obj.equals(obj2)))) {
lVar = lVar.d;
}
} else {
j$.sun.misc.a aVar = h;
long j = i;
if (aVar.c(this, j, i3, i3 + 4)) {
try {
r rVar2 = this.e;
if (rVar2 != null) {
rVar = rVar2.b(i2, obj, null);
}
if (aVar.e(this, j) == 6 && (thread = this.g) != null) {
LockSupport.unpark(thread);
}
return rVar;
} finally {
}
}
}
}
return lVar;
}
/* JADX WARN: Removed duplicated region for block: B:10:0x00a9 A[LOOP:0: B:2:0x0007->B:10:0x00a9, LOOP_END] */
/* JADX WARN: Removed duplicated region for block: B:11:0x0079 A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:32:0x0075 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0072 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final j$.util.concurrent.r e(int r12, java.lang.Object r13, java.lang.Object r14) {
/*
r11 = this;
j$.util.concurrent.r r0 = r11.e
r7 = 0
r8 = 0
r6 = r0
r0 = r7
r1 = r8
L7:
if (r6 != 0) goto L18
j$.util.concurrent.r r1 = new j$.util.concurrent.r
r5 = 0
r6 = 0
r2 = r12
r3 = r13
r4 = r14
r1.<init>(r2, r3, r4, r5, r6)
r11.e = r1
r11.f = r1
return r7
L18:
int r4 = r6.f21312a
r9 = 1
if (r4 <= r12) goto L20
r4 = -1
L1e:
r10 = r4
goto L70
L20:
if (r4 >= r12) goto L24
r10 = r9
goto L70
L24:
java.lang.Object r4 = r6.b
if (r4 == r13) goto Lac
if (r4 == 0) goto L32
boolean r5 = r13.equals(r4)
if (r5 == 0) goto L32
goto Lac
L32:
if (r0 != 0) goto L3a
java.lang.Class r0 = j$.util.concurrent.ConcurrentHashMap.c(r13)
if (r0 == 0) goto L50
L3a:
int r5 = j$.util.concurrent.ConcurrentHashMap.g
if (r4 == 0) goto L4d
java.lang.Class r5 = r4.getClass()
if (r5 == r0) goto L45
goto L4d
L45:
r5 = r13
java.lang.Comparable r5 = (java.lang.Comparable) r5
int r5 = r5.compareTo(r4)
goto L4e
L4d:
r5 = r8
L4e:
if (r5 != 0) goto L6f
L50:
if (r1 != 0) goto L6a
j$.util.concurrent.r r1 = r6.f
if (r1 == 0) goto L5e
j$.util.concurrent.r r1 = r1.b(r12, r13, r0)
if (r1 != 0) goto L5d
goto L5e
L5d:
return r1
L5e:
j$.util.concurrent.r r1 = r6.g
if (r1 == 0) goto L69
j$.util.concurrent.r r1 = r1.b(r12, r13, r0)
if (r1 == 0) goto L69
return r1
L69:
r1 = r9
L6a:
int r4 = i(r13, r4)
goto L1e
L6f:
r10 = r5
L70:
if (r10 > 0) goto L75
j$.util.concurrent.r r4 = r6.f
goto L77
L75:
j$.util.concurrent.r r4 = r6.g
L77:
if (r4 != 0) goto La9
j$.util.concurrent.r r5 = r11.f
j$.util.concurrent.r r1 = new j$.util.concurrent.r
r2 = r12
r3 = r13
r4 = r14
r1.<init>(r2, r3, r4, r5, r6)
r11.f = r1
if (r5 == 0) goto L89
r5.h = r1
L89:
if (r10 > 0) goto L8e
r6.f = r1
goto L90
L8e:
r6.g = r1
L90:
boolean r0 = r6.i
if (r0 != 0) goto L97
r1.i = r9
return r7
L97:
r11.d()
j$.util.concurrent.r r0 = r11.e // Catch: java.lang.Throwable -> La5
j$.util.concurrent.r r0 = c(r0, r1) // Catch: java.lang.Throwable -> La5
r11.e = r0 // Catch: java.lang.Throwable -> La5
r11.lockState = r8
return r7
La5:
r0 = move-exception
r11.lockState = r8
throw r0
La9:
r6 = r4
goto L7
Lac:
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.q.e(int, java.lang.Object, java.lang.Object):j$.util.concurrent.r");
}
/* JADX WARN: Removed duplicated region for block: B:41:0x0091 A[Catch: all -> 0x0052, TryCatch #0 {all -> 0x0052, blocks: (B:21:0x0030, B:25:0x0039, B:29:0x003f, B:31:0x004d, B:32:0x0068, B:34:0x006e, B:35:0x0070, B:41:0x0091, B:44:0x00a2, B:45:0x0099, B:47:0x009d, B:48:0x00a0, B:49:0x00a8, B:52:0x00b1, B:54:0x00b5, B:56:0x00b9, B:58:0x00bd, B:59:0x00c6, B:61:0x00c0, B:63:0x00c4, B:66:0x00ad, B:68:0x007a, B:70:0x007e, B:71:0x0081, B:72:0x0055, B:74:0x005b, B:76:0x005f, B:77:0x0062, B:78:0x0064), top: B:20:0x0030 }] */
/* JADX WARN: Removed duplicated region for block: B:51:0x00ac */
/* JADX WARN: Removed duplicated region for block: B:54:0x00b5 A[Catch: all -> 0x0052, TryCatch #0 {all -> 0x0052, blocks: (B:21:0x0030, B:25:0x0039, B:29:0x003f, B:31:0x004d, B:32:0x0068, B:34:0x006e, B:35:0x0070, B:41:0x0091, B:44:0x00a2, B:45:0x0099, B:47:0x009d, B:48:0x00a0, B:49:0x00a8, B:52:0x00b1, B:54:0x00b5, B:56:0x00b9, B:58:0x00bd, B:59:0x00c6, B:61:0x00c0, B:63:0x00c4, B:66:0x00ad, B:68:0x007a, B:70:0x007e, B:71:0x0081, B:72:0x0055, B:74:0x005b, B:76:0x005f, B:77:0x0062, B:78:0x0064), top: B:20:0x0030 }] */
/* JADX WARN: Removed duplicated region for block: B:58:0x00bd A[Catch: all -> 0x0052, TryCatch #0 {all -> 0x0052, blocks: (B:21:0x0030, B:25:0x0039, B:29:0x003f, B:31:0x004d, B:32:0x0068, B:34:0x006e, B:35:0x0070, B:41:0x0091, B:44:0x00a2, B:45:0x0099, B:47:0x009d, B:48:0x00a0, B:49:0x00a8, B:52:0x00b1, B:54:0x00b5, B:56:0x00b9, B:58:0x00bd, B:59:0x00c6, B:61:0x00c0, B:63:0x00c4, B:66:0x00ad, B:68:0x007a, B:70:0x007e, B:71:0x0081, B:72:0x0055, B:74:0x005b, B:76:0x005f, B:77:0x0062, B:78:0x0064), top: B:20:0x0030 }] */
/* JADX WARN: Removed duplicated region for block: B:61:0x00c0 A[Catch: all -> 0x0052, TryCatch #0 {all -> 0x0052, blocks: (B:21:0x0030, B:25:0x0039, B:29:0x003f, B:31:0x004d, B:32:0x0068, B:34:0x006e, B:35:0x0070, B:41:0x0091, B:44:0x00a2, B:45:0x0099, B:47:0x009d, B:48:0x00a0, B:49:0x00a8, B:52:0x00b1, B:54:0x00b5, B:56:0x00b9, B:58:0x00bd, B:59:0x00c6, B:61:0x00c0, B:63:0x00c4, B:66:0x00ad, B:68:0x007a, B:70:0x007e, B:71:0x0081, B:72:0x0055, B:74:0x005b, B:76:0x005f, B:77:0x0062, B:78:0x0064), top: B:20:0x0030 }] */
/* JADX WARN: Removed duplicated region for block: B:66:0x00ad A[Catch: all -> 0x0052, TryCatch #0 {all -> 0x0052, blocks: (B:21:0x0030, B:25:0x0039, B:29:0x003f, B:31:0x004d, B:32:0x0068, B:34:0x006e, B:35:0x0070, B:41:0x0091, B:44:0x00a2, B:45:0x0099, B:47:0x009d, B:48:0x00a0, B:49:0x00a8, B:52:0x00b1, B:54:0x00b5, B:56:0x00b9, B:58:0x00bd, B:59:0x00c6, B:61:0x00c0, B:63:0x00c4, B:66:0x00ad, B:68:0x007a, B:70:0x007e, B:71:0x0081, B:72:0x0055, B:74:0x005b, B:76:0x005f, B:77:0x0062, B:78:0x0064), top: B:20:0x0030 }] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final boolean f(j$.util.concurrent.r r11) {
/*
Method dump skipped, instructions count: 207
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.q.f(j$.util.concurrent.r):boolean");
}
public static r g(r rVar, r rVar2) {
r rVar3;
if (rVar2 != null && (rVar3 = rVar2.g) != null) {
r rVar4 = rVar3.f;
rVar2.g = rVar4;
if (rVar4 != null) {
rVar4.e = rVar2;
}
r rVar5 = rVar2.e;
rVar3.e = rVar5;
if (rVar5 == null) {
rVar3.i = false;
rVar = rVar3;
} else if (rVar5.f == rVar2) {
rVar5.f = rVar3;
} else {
rVar5.g = rVar3;
}
rVar3.f = rVar2;
rVar2.e = rVar3;
}
return rVar;
}
public static r h(r rVar, r rVar2) {
r rVar3;
if (rVar2 != null && (rVar3 = rVar2.f) != null) {
r rVar4 = rVar3.g;
rVar2.f = rVar4;
if (rVar4 != null) {
rVar4.e = rVar2;
}
r rVar5 = rVar2.e;
rVar3.e = rVar5;
if (rVar5 == null) {
rVar3.i = false;
rVar = rVar3;
} else if (rVar5.g == rVar2) {
rVar5.g = rVar3;
} else {
rVar5.f = rVar3;
}
rVar3.g = rVar2;
rVar2.e = rVar3;
}
return rVar;
}
public static r c(r rVar, r rVar2) {
r rVar3;
rVar2.i = true;
while (true) {
r rVar4 = rVar2.e;
if (rVar4 == null) {
rVar2.i = false;
return rVar2;
}
if (!rVar4.i || (rVar3 = rVar4.e) == null) {
break;
}
r rVar5 = rVar3.f;
if (rVar4 == rVar5) {
r rVar6 = rVar3.g;
if (rVar6 != null && rVar6.i) {
rVar6.i = false;
rVar4.i = false;
rVar3.i = true;
rVar2 = rVar3;
} else {
if (rVar2 == rVar4.g) {
rVar = g(rVar, rVar4);
r rVar7 = rVar4.e;
rVar3 = rVar7 == null ? null : rVar7.e;
rVar4 = rVar7;
rVar2 = rVar4;
}
if (rVar4 != null) {
rVar4.i = false;
if (rVar3 != null) {
rVar3.i = true;
rVar = h(rVar, rVar3);
}
}
}
} else if (rVar5 != null && rVar5.i) {
rVar5.i = false;
rVar4.i = false;
rVar3.i = true;
rVar2 = rVar3;
} else {
if (rVar2 == rVar4.f) {
rVar = h(rVar, rVar4);
r rVar8 = rVar4.e;
rVar3 = rVar8 == null ? null : rVar8.e;
rVar4 = rVar8;
rVar2 = rVar4;
}
if (rVar4 != null) {
rVar4.i = false;
if (rVar3 != null) {
rVar3.i = true;
rVar = g(rVar, rVar3);
}
}
}
}
return rVar;
}
public static r b(r rVar, r rVar2) {
while (rVar2 != null && rVar2 != rVar) {
r rVar3 = rVar2.e;
if (rVar3 == null) {
rVar2.i = false;
return rVar2;
}
if (rVar2.i) {
rVar2.i = false;
return rVar;
}
r rVar4 = rVar3.f;
if (rVar4 == rVar2) {
r rVar5 = rVar3.g;
if (rVar5 != null && rVar5.i) {
rVar5.i = false;
rVar3.i = true;
rVar = g(rVar, rVar3);
rVar3 = rVar2.e;
rVar5 = rVar3 == null ? null : rVar3.g;
}
if (rVar5 != null) {
r rVar6 = rVar5.f;
r rVar7 = rVar5.g;
if ((rVar7 == null || !rVar7.i) && (rVar6 == null || !rVar6.i)) {
rVar5.i = true;
} else {
if (rVar7 == null || !rVar7.i) {
if (rVar6 != null) {
rVar6.i = false;
}
rVar5.i = true;
rVar = h(rVar, rVar5);
rVar3 = rVar2.e;
rVar5 = rVar3 != null ? rVar3.g : null;
}
if (rVar5 != null) {
rVar5.i = rVar3 == null ? false : rVar3.i;
r rVar8 = rVar5.g;
if (rVar8 != null) {
rVar8.i = false;
}
}
if (rVar3 != null) {
rVar3.i = false;
rVar = g(rVar, rVar3);
}
rVar2 = rVar;
}
}
rVar2 = rVar3;
} else {
if (rVar4 != null && rVar4.i) {
rVar4.i = false;
rVar3.i = true;
rVar = h(rVar, rVar3);
rVar3 = rVar2.e;
rVar4 = rVar3 == null ? null : rVar3.f;
}
if (rVar4 != null) {
r rVar9 = rVar4.f;
r rVar10 = rVar4.g;
if ((rVar9 == null || !rVar9.i) && (rVar10 == null || !rVar10.i)) {
rVar4.i = true;
} else {
if (rVar9 == null || !rVar9.i) {
if (rVar10 != null) {
rVar10.i = false;
}
rVar4.i = true;
rVar = g(rVar, rVar4);
rVar3 = rVar2.e;
rVar4 = rVar3 != null ? rVar3.f : null;
}
if (rVar4 != null) {
rVar4.i = rVar3 == null ? false : rVar3.i;
r rVar11 = rVar4.f;
if (rVar11 != null) {
rVar11.i = false;
}
}
if (rVar3 != null) {
rVar3.i = false;
rVar = h(rVar, rVar3);
}
rVar2 = rVar;
}
}
rVar2 = rVar3;
}
}
return rVar;
}
}