soul-browser/sources/java/kotlin/collections/MapWithDefaultImpl.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

202 lines
9.5 KiB
Java

package kotlin.collections;
import com.google.android.gms.ads.RequestConfiguration;
import j$.util.Map;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(d1 = {"\u0000R\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u000b\n\u0002\u0010\"\n\u0002\b\u0003\n\u0002\u0010\u001e\n\u0002\b\u0003\n\u0002\u0010&\n\u0002\b\u0003\b\u0002\u0018\u0000*\u0004\b\u0000\u0010\u0001*\u0006\b\u0001\u0010\u0002 \u00012\u000e\u0012\u0004\u0012\u0002H\u0001\u0012\u0004\u0012\u0002H\u00020\u0003B>\u0012\u0012\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0005\u0012!\u0010\u0006\u001a\u001d\u0012\u0013\u0012\u00118\u0000¢\u0006\f\b\b\u0012\b\b\t\u0012\u0004\b\b(\n\u0012\u0004\u0012\u00028\u00010\u0007¢\u0006\u0004\b\u000b\u0010\fJ\u0013\u0010\u000f\u001a\u00020\u00102\b\u0010\u0011\u001a\u0004\u0018\u00010\u0012H\u0096\u0002J\b\u0010\u0013\u001a\u00020\u0014H\u0016J\b\u0010\u0015\u001a\u00020\u0016H\u0016J\b\u0010\u001a\u001a\u00020\u0010H\u0016J\u0015\u0010\u001b\u001a\u00020\u00102\u0006\u0010\n\u001a\u00028\u0000H\u0016¢\u0006\u0002\u0010\u001cJ\u0015\u0010\u001d\u001a\u00020\u00102\u0006\u0010\u001e\u001a\u00028\u0001H\u0016¢\u0006\u0002\u0010\u001cJ\u0018\u0010\u001f\u001a\u0004\u0018\u00018\u00012\u0006\u0010\n\u001a\u00028\u0000H\u0096\u0002¢\u0006\u0002\u0010 J\u0015\u0010,\u001a\u00028\u00012\u0006\u0010\n\u001a\u00028\u0000H\u0016¢\u0006\u0002\u0010 R \u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010\u0005X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\u000eR)\u0010\u0006\u001a\u001d\u0012\u0013\u0012\u00118\u0000¢\u0006\f\b\b\u0012\b\b\t\u0012\u0004\b\b(\n\u0012\u0004\u0012\u00028\u00010\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0017\u001a\u00020\u00148VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0018\u0010\u0019R\u001a\u0010!\u001a\b\u0012\u0004\u0012\u00028\u00000\"8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b#\u0010$R\u001a\u0010%\u001a\b\u0012\u0004\u0012\u00028\u00010&8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b'\u0010(R&\u0010)\u001a\u0014\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00028\u0000\u0012\u0004\u0012\u00028\u00010*0\"8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b+\u0010$¨\u0006-"}, d2 = {"Lkotlin/collections/MapWithDefaultImpl;", "K", "V", "Lkotlin/collections/MapWithDefault;", "map", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "default", "Lkotlin/Function1;", "Lkotlin/ParameterName;", "name", "key", "<init>", "(Ljava/util/Map;Lkotlin/jvm/functions/Function1;)V", "getMap", "()Ljava/util/Map;", "equals", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "other", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "hashCode", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "toString", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "size", "getSize", "()I", "isEmpty", "containsKey", "(Ljava/lang/Object;)Z", "containsValue", "value", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", "keys", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "getKeys", "()Ljava/util/Set;", "values", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "getValues", "()Ljava/util/Collection;", "entries", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "getEntries", "getOrImplicitDefault", "kotlin-stdlib"}, k = 1, mv = {2, 2, 0}, xi = 48)
@SourceDebugExtension({"SMAP\nMapWithDefault.kt\nKotlin\n*S Kotlin\n*F\n+ 1 MapWithDefault.kt\nkotlin/collections/MapWithDefaultImpl\n+ 2 Maps.kt\nkotlin/collections/MapsKt__MapsKt\n*L\n1#1,111:1\n348#2,6:112\n*S KotlinDebug\n*F\n+ 1 MapWithDefault.kt\nkotlin/collections/MapWithDefaultImpl\n*L\n87#1:112,6\n*E\n"})
/* loaded from: classes3.dex */
final class MapWithDefaultImpl<K, V> implements MapWithDefault<K, V>, Map {
@NotNull
private final Function1<K, V> default;
@NotNull
private final java.util.Map<K, V> map;
/* JADX WARN: Multi-variable type inference failed */
public MapWithDefaultImpl(@NotNull java.util.Map<K, ? extends V> map, @NotNull Function1<? super K, ? extends V> function1) {
Intrinsics.checkNotNullParameter(map, "map");
Intrinsics.checkNotNullParameter(function1, "default");
this.map = map;
this.default = function1;
}
@Override // java.util.Map
public void clear() {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ Object compute(Object obj, BiFunction biFunction) {
return Map.CC.$default$compute(this, obj, biFunction);
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ Object computeIfAbsent(Object obj, Function function) {
return Map.CC.$default$computeIfAbsent(this, obj, function);
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ Object computeIfPresent(Object obj, BiFunction biFunction) {
return Map.CC.$default$computeIfPresent(this, obj, biFunction);
}
@Override // java.util.Map
public boolean containsKey(Object key) {
return getMap().containsKey(key);
}
@Override // java.util.Map
public boolean containsValue(Object value) {
return getMap().containsValue(value);
}
@Override // java.util.Map
public final /* bridge */ Set<Map.Entry<K, V>> entrySet() {
return getEntries();
}
@Override // java.util.Map
public boolean equals(@Nullable Object other) {
return getMap().equals(other);
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ void forEach(BiConsumer biConsumer) {
Map.CC.$default$forEach(this, biConsumer);
}
@Override // java.util.Map
@Nullable
public V get(Object key) {
return getMap().get(key);
}
@NotNull
public Set<Map.Entry<K, V>> getEntries() {
return getMap().entrySet();
}
@NotNull
public Set<K> getKeys() {
return getMap().keySet();
}
@Override // kotlin.collections.MapWithDefault
@NotNull
public java.util.Map<K, V> getMap() {
return this.map;
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ Object getOrDefault(Object obj, Object obj2) {
return Map.CC.$default$getOrDefault(this, obj, obj2);
}
@Override // kotlin.collections.MapWithDefault
public V getOrImplicitDefault(K key) {
java.util.Map<K, V> map = getMap();
V v = map.get(key);
if (v == null && !map.containsKey(key)) {
return this.default.invoke(key);
}
return v;
}
public int getSize() {
return getMap().size();
}
@NotNull
public Collection<V> getValues() {
return getMap().values();
}
@Override // java.util.Map
public int hashCode() {
return getMap().hashCode();
}
@Override // java.util.Map
public boolean isEmpty() {
return getMap().isEmpty();
}
@Override // java.util.Map
public final /* bridge */ Set<K> keySet() {
return getKeys();
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ Object merge(Object obj, Object obj2, BiFunction biFunction) {
return Map.CC.$default$merge(this, obj, obj2, biFunction);
}
@Override // java.util.Map
public V put(K k, V v) {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
@Override // java.util.Map
public void putAll(java.util.Map<? extends K, ? extends V> map) {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ Object putIfAbsent(Object obj, Object obj2) {
return Map.CC.$default$putIfAbsent(this, obj, obj2);
}
@Override // java.util.Map
public V remove(Object obj) {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ Object replace(Object obj, Object obj2) {
return Map.CC.$default$replace(this, obj, obj2);
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ void replaceAll(BiFunction biFunction) {
Map.CC.$default$replaceAll(this, biFunction);
}
@Override // java.util.Map
public final /* bridge */ int size() {
return getSize();
}
@NotNull
public String toString() {
return getMap().toString();
}
@Override // java.util.Map
public final /* bridge */ Collection<V> values() {
return getValues();
}
@Override // java.util.Map, j$.util.Map
public boolean remove(Object obj, Object obj2) {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
@Override // java.util.Map, j$.util.Map
public /* synthetic */ boolean replace(Object obj, Object obj2, Object obj3) {
return Map.CC.$default$replace(this, obj, obj2, obj3);
}
}