soul-browser/sources/java/kotlin/concurrent/internal/AtomicIntrinsicsKt.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

120 lines
6.3 KiB
Java

package kotlin.concurrent.internal;
import com.google.android.gms.ads.RequestConfiguration;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicIntegerArray;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicLongArray;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.AtomicReferenceArray;
import kotlin.Metadata;
import kotlin.PublishedApi;
import kotlin.SinceKotlin;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
@Metadata(d1 = {"\u00008\n\u0000\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u001c\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u00012\u0006\u0010\u0004\u001a\u00020\u0001H\u0001\u001a\u001c\u0010\u0000\u001a\u00020\u0005*\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0005H\u0001\u001a\u001c\u0010\u0000\u001a\u00020\u0007*\u00020\b2\u0006\u0010\u0003\u001a\u00020\u00072\u0006\u0010\u0004\u001a\u00020\u0007H\u0001\u001a-\u0010\u0000\u001a\u0002H\t\"\u0004\b\u0000\u0010\t*\b\u0012\u0004\u0012\u0002H\t0\n2\u0006\u0010\u0003\u001a\u0002H\t2\u0006\u0010\u0004\u001a\u0002H\tH\u0001¢\u0006\u0002\u0010\u000b\u001a$\u0010\u0000\u001a\u00020\u0001*\u00020\f2\u0006\u0010\r\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u00012\u0006\u0010\u0004\u001a\u00020\u0001H\u0001\u001a$\u0010\u0000\u001a\u00020\u0005*\u00020\u000e2\u0006\u0010\r\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0005H\u0001\u001a5\u0010\u0000\u001a\u0002H\t\"\u0004\b\u0000\u0010\t*\b\u0012\u0004\u0012\u0002H\t0\u000f2\u0006\u0010\r\u001a\u00020\u00012\u0006\u0010\u0003\u001a\u0002H\t2\u0006\u0010\u0004\u001a\u0002H\tH\u0001¢\u0006\u0002\u0010\u0010¨\u0006\u0011"}, d2 = {"compareAndExchange", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "Ljava/util/concurrent/atomic/AtomicInteger;", "expected", "newValue", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "Ljava/util/concurrent/atomic/AtomicLong;", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "Ljava/util/concurrent/atomic/AtomicBoolean;", RequestConfiguration.MAX_AD_CONTENT_RATING_T, "Ljava/util/concurrent/atomic/AtomicReference;", "(Ljava/util/concurrent/atomic/AtomicReference;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "Ljava/util/concurrent/atomic/AtomicIntegerArray;", "index", "Ljava/util/concurrent/atomic/AtomicLongArray;", "Ljava/util/concurrent/atomic/AtomicReferenceArray;", "(Ljava/util/concurrent/atomic/AtomicReferenceArray;ILjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "kotlin-stdlib"}, k = 2, mv = {2, 2, 0}, xi = 48)
/* loaded from: classes3.dex */
public final class AtomicIntrinsicsKt {
@SinceKotlin(version = "2.1")
@PublishedApi
public static final int compareAndExchange(@NotNull AtomicInteger atomicInteger, int i, int i2) {
Intrinsics.checkNotNullParameter(atomicInteger, "<this>");
do {
int i3 = atomicInteger.get();
if (i != i3) {
return i3;
}
} while (!atomicInteger.compareAndSet(i, i2));
return i;
}
@SinceKotlin(version = "2.1")
@PublishedApi
public static final long compareAndExchange(@NotNull AtomicLong atomicLong, long j, long j2) {
Intrinsics.checkNotNullParameter(atomicLong, "<this>");
do {
long j3 = atomicLong.get();
if (j != j3) {
return j3;
}
} while (!atomicLong.compareAndSet(j, j2));
return j;
}
@SinceKotlin(version = "2.1")
@PublishedApi
public static final boolean compareAndExchange(@NotNull AtomicBoolean atomicBoolean, boolean z, boolean z2) {
Intrinsics.checkNotNullParameter(atomicBoolean, "<this>");
do {
boolean z3 = atomicBoolean.get();
if (z != z3) {
return z3;
}
} while (!atomicBoolean.compareAndSet(z, z2));
return z;
}
@SinceKotlin(version = "2.1")
@PublishedApi
public static final <T> T compareAndExchange(@NotNull AtomicReference<T> atomicReference, T t, T t2) {
Intrinsics.checkNotNullParameter(atomicReference, "<this>");
while (true) {
T t3 = atomicReference.get();
if (t != t3) {
return t3;
}
while (!atomicReference.compareAndSet(t, t2)) {
if (atomicReference.get() != t) {
break;
}
}
return t;
}
}
@SinceKotlin(version = "2.1")
@PublishedApi
public static final int compareAndExchange(@NotNull AtomicIntegerArray atomicIntegerArray, int i, int i2, int i3) {
Intrinsics.checkNotNullParameter(atomicIntegerArray, "<this>");
do {
int i4 = atomicIntegerArray.get(i);
if (i2 != i4) {
return i4;
}
} while (!atomicIntegerArray.compareAndSet(i, i2, i3));
return i2;
}
@SinceKotlin(version = "2.1")
@PublishedApi
public static final long compareAndExchange(@NotNull AtomicLongArray atomicLongArray, int i, long j, long j2) {
Intrinsics.checkNotNullParameter(atomicLongArray, "<this>");
do {
long j3 = atomicLongArray.get(i);
if (j != j3) {
return j3;
}
} while (!atomicLongArray.compareAndSet(i, j, j2));
return j;
}
@SinceKotlin(version = "2.1")
@PublishedApi
public static final <T> T compareAndExchange(@NotNull AtomicReferenceArray<T> atomicReferenceArray, int i, T t, T t2) {
Intrinsics.checkNotNullParameter(atomicReferenceArray, "<this>");
while (true) {
T t3 = atomicReferenceArray.get(i);
if (t != t3) {
return t3;
}
while (!atomicReferenceArray.compareAndSet(i, t, t2)) {
if (atomicReferenceArray.get(i) != t) {
break;
}
}
return t;
}
}
}