soul-browser/sources/java/j$/time/ZoneOffset.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

318 lines
11 KiB
Java

package j$.time;
import com.google.android.gms.ads.RequestConfiguration;
import j$.util.Objects;
import j$.util.concurrent.ConcurrentHashMap;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
/* loaded from: classes2.dex */
public final class ZoneOffset extends ZoneId implements j$.time.temporal.n, j$.time.temporal.o, Comparable<ZoneOffset>, Serializable {
private static final long serialVersionUID = 2357656521762053153L;
/* renamed from: a, reason: collision with root package name */
public final int f21144a;
public final transient String b;
/* renamed from: c, reason: collision with root package name */
public static final ConcurrentHashMap f21143c = new ConcurrentHashMap(16, 0.75f, 4);
public static final ConcurrentHashMap d = new ConcurrentHashMap(16, 0.75f, 4);
public static final ZoneOffset UTC = R(0);
public static final ZoneOffset e = R(-64800);
public static final ZoneOffset f = R(64800);
@Override // java.lang.Comparable
public final int compareTo(ZoneOffset zoneOffset) {
return zoneOffset.f21144a - this.f21144a;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:20:0x008f A[ADDED_TO_REGION] */
/* JADX WARN: Removed duplicated region for block: B:24:0x00a0 */
/* JADX WARN: Removed duplicated region for block: B:26:0x00a8 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static j$.time.ZoneOffset P(java.lang.String r7) {
/*
java.lang.String r0 = "offsetId"
j$.util.Objects.requireNonNull(r7, r0)
j$.util.concurrent.ConcurrentHashMap r0 = j$.time.ZoneOffset.d
java.lang.Object r0 = r0.get(r7)
j$.time.ZoneOffset r0 = (j$.time.ZoneOffset) r0
if (r0 == 0) goto L10
return r0
L10:
int r0 = r7.length()
r1 = 2
r2 = 1
r3 = 0
if (r0 == r1) goto L63
r1 = 3
if (r0 == r1) goto L7f
r4 = 5
if (r0 == r4) goto L5a
r5 = 6
r6 = 4
if (r0 == r5) goto L50
r5 = 7
if (r0 == r5) goto L43
r1 = 9
if (r0 != r1) goto L37
int r0 = S(r7, r2, r3)
int r1 = S(r7, r6, r2)
int r2 = S(r7, r5, r2)
goto L85
L37:
j$.time.b r0 = new j$.time.b
java.lang.String r1 = "Invalid ID for ZoneOffset, invalid format: "
java.lang.String r7 = r1.concat(r7)
r0.<init>(r7)
throw r0
L43:
int r0 = S(r7, r2, r3)
int r1 = S(r7, r1, r3)
int r2 = S(r7, r4, r3)
goto L85
L50:
int r0 = S(r7, r2, r3)
int r1 = S(r7, r6, r2)
L58:
r2 = r3
goto L85
L5a:
int r0 = S(r7, r2, r3)
int r1 = S(r7, r1, r3)
goto L58
L63:
char r0 = r7.charAt(r3)
char r7 = r7.charAt(r2)
java.lang.StringBuilder r1 = new java.lang.StringBuilder
r1.<init>()
r1.append(r0)
java.lang.String r0 = "0"
r1.append(r0)
r1.append(r7)
java.lang.String r7 = r1.toString()
L7f:
int r0 = S(r7, r2, r3)
r1 = r3
r2 = r1
L85:
char r3 = r7.charAt(r3)
r4 = 43
r5 = 45
if (r3 == r4) goto L9e
if (r3 != r5) goto L92
goto L9e
L92:
j$.time.b r0 = new j$.time.b
java.lang.String r1 = "Invalid ID for ZoneOffset, plus/minus not found when expected: "
java.lang.String r7 = r1.concat(r7)
r0.<init>(r7)
throw r0
L9e:
if (r3 != r5) goto La8
int r7 = -r0
int r0 = -r1
int r1 = -r2
j$.time.ZoneOffset r7 = Q(r7, r0, r1)
return r7
La8:
j$.time.ZoneOffset r7 = Q(r0, r1, r2)
return r7
*/
throw new UnsupportedOperationException("Method not decompiled: j$.time.ZoneOffset.P(java.lang.String):j$.time.ZoneOffset");
}
@Override // j$.time.ZoneId
public final j$.time.zone.f K() {
Objects.requireNonNull(this, "offset");
return new j$.time.zone.f(this);
}
public static int S(CharSequence charSequence, int i, boolean z) {
if (z) {
String str = (String) charSequence;
if (str.charAt(i - 1) != ':') {
throw new RuntimeException("Invalid ID for ZoneOffset, colon not found when expected: " + ((Object) str));
}
}
String str2 = (String) charSequence;
char charAt = str2.charAt(i);
char charAt2 = str2.charAt(i + 1);
if (charAt >= '0' && charAt <= '9' && charAt2 >= '0' && charAt2 <= '9') {
return (charAt2 - '0') + ((charAt - '0') * 10);
}
throw new RuntimeException("Invalid ID for ZoneOffset, non numeric characters found: " + ((Object) str2));
}
public static ZoneOffset Q(int i, int i2, int i3) {
if (i < -18 || i > 18) {
throw new RuntimeException("Zone offset hours not in valid range: value " + i + " is not in the range -18 to 18");
}
if (i > 0) {
if (i2 < 0 || i3 < 0) {
throw new RuntimeException("Zone offset minutes and seconds must be positive because hours is positive");
}
} else if (i < 0) {
if (i2 > 0 || i3 > 0) {
throw new RuntimeException("Zone offset minutes and seconds must be negative because hours is negative");
}
} else if ((i2 > 0 && i3 < 0) || (i2 < 0 && i3 > 0)) {
throw new RuntimeException("Zone offset minutes and seconds must have the same sign");
}
if (i2 < -59 || i2 > 59) {
throw new RuntimeException("Zone offset minutes not in valid range: value " + i2 + " is not in the range -59 to 59");
}
if (i3 < -59 || i3 > 59) {
throw new RuntimeException("Zone offset seconds not in valid range: value " + i3 + " is not in the range -59 to 59");
}
if (Math.abs(i) == 18 && (i2 | i3) != 0) {
throw new RuntimeException("Zone offset not in valid range: -18:00 to +18:00");
}
return R((i2 * 60) + (i * 3600) + i3);
}
/* JADX WARN: Multi-variable type inference failed */
public static ZoneOffset R(int i) {
if (i < -64800 || i > 64800) {
throw new RuntimeException("Zone offset not in valid range: -18:00 to +18:00");
}
if (i % 900 == 0) {
Integer valueOf = Integer.valueOf(i);
ConcurrentHashMap concurrentHashMap = f21143c;
ZoneOffset zoneOffset = (ZoneOffset) concurrentHashMap.get(valueOf);
if (zoneOffset != null) {
return zoneOffset;
}
concurrentHashMap.putIfAbsent(valueOf, new ZoneOffset(i));
ZoneOffset zoneOffset2 = (ZoneOffset) concurrentHashMap.get(valueOf);
d.putIfAbsent(zoneOffset2.b, zoneOffset2);
return zoneOffset2;
}
return new ZoneOffset(i);
}
public ZoneOffset(int i) {
String sb;
this.f21144a = i;
if (i == 0) {
sb = "Z";
} else {
int abs = Math.abs(i);
StringBuilder sb2 = new StringBuilder();
int i2 = abs / 3600;
int i3 = (abs / 60) % 60;
sb2.append(i < 0 ? "-" : "+");
sb2.append(i2 < 10 ? "0" : RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED);
sb2.append(i2);
sb2.append(i3 < 10 ? ":0" : ":");
sb2.append(i3);
int i4 = abs % 60;
if (i4 != 0) {
sb2.append(i4 < 10 ? ":0" : ":");
sb2.append(i4);
}
sb = sb2.toString();
}
this.b = sb;
}
@Override // j$.time.ZoneId
public final String f() {
return this.b;
}
@Override // j$.time.temporal.n
public final boolean c(j$.time.temporal.r rVar) {
return rVar instanceof j$.time.temporal.a ? rVar == j$.time.temporal.a.OFFSET_SECONDS : rVar != null && rVar.d(this);
}
@Override // j$.time.temporal.n
public final j$.time.temporal.v i(j$.time.temporal.r rVar) {
return j$.time.temporal.s.d(this, rVar);
}
@Override // j$.time.temporal.n
public final int g(j$.time.temporal.r rVar) {
if (rVar == j$.time.temporal.a.OFFSET_SECONDS) {
return this.f21144a;
}
if (rVar instanceof j$.time.temporal.a) {
throw new RuntimeException(c.a("Unsupported field: ", rVar));
}
return j$.time.temporal.s.d(this, rVar).a(y(rVar), rVar);
}
@Override // j$.time.temporal.n
public final long y(j$.time.temporal.r rVar) {
if (rVar == j$.time.temporal.a.OFFSET_SECONDS) {
return this.f21144a;
}
if (rVar instanceof j$.time.temporal.a) {
throw new RuntimeException(c.a("Unsupported field: ", rVar));
}
return rVar.i(this);
}
@Override // j$.time.temporal.n
public final Object d(h hVar) {
return (hVar == j$.time.temporal.s.d || hVar == j$.time.temporal.s.e) ? this : j$.time.temporal.s.c(this, hVar);
}
@Override // j$.time.temporal.o
public final j$.time.temporal.m l(j$.time.temporal.m mVar) {
return mVar.a(this.f21144a, j$.time.temporal.a.OFFSET_SECONDS);
}
@Override // j$.time.ZoneId
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
return (obj instanceof ZoneOffset) && this.f21144a == ((ZoneOffset) obj).f21144a;
}
@Override // j$.time.ZoneId
public final int hashCode() {
return this.f21144a;
}
@Override // j$.time.ZoneId
public final String toString() {
return this.b;
}
private Object writeReplace() {
return new s((byte) 8, this);
}
private void readObject(ObjectInputStream objectInputStream) {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
@Override // j$.time.ZoneId
public final void O(DataOutput dataOutput) {
dataOutput.writeByte(8);
U(dataOutput);
}
public final void U(DataOutput dataOutput) {
int i = this.f21144a;
int i2 = i % 900 == 0 ? i / 900 : 127;
dataOutput.writeByte(i2);
if (i2 == 127) {
dataOutput.writeInt(i);
}
}
public static ZoneOffset T(DataInput dataInput) {
byte readByte = dataInput.readByte();
return readByte == Byte.MAX_VALUE ? R(dataInput.readInt()) : R(readByte * 900);
}
}