soul-browser/sources/java/com/google/common/io/ReaderInputStream.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

155 lines
4.6 KiB
Java

package com.google.common.io;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@J2ktIncompatible
@GwtIncompatible
/* loaded from: classes3.dex */
final class ReaderInputStream extends InputStream {
/* renamed from: c, reason: collision with root package name */
public CharBuffer f12480c;
public ByteBuffer f;
public boolean g;
public boolean h;
@Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable
public final void close() {
throw null;
}
@Override // java.io.InputStream
public final int read() {
if (read(null) != 1) {
return -1;
}
throw null;
}
/* JADX WARN: Code restructure failed: missing block: B:14:0x0032, code lost:
if (r1 <= 0) goto L16;
*/
/* JADX WARN: Code restructure failed: missing block: B:15:0x0034, code lost:
return r1;
*/
/* JADX WARN: Code restructure failed: missing block: B:16:0x0035, code lost:
return -1;
*/
@Override // java.io.InputStream
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final int read(byte[] r6, int r7, int r8) {
/*
r5 = this;
int r0 = r7 + r8
int r1 = r6.length
com.google.common.base.Preconditions.j(r7, r0, r1)
r0 = 0
if (r8 != 0) goto La
return r0
La:
r1 = r0
Lb:
boolean r2 = r5.g
if (r2 == 0) goto L37
int r2 = r7 + r1
int r3 = r8 - r1
java.nio.ByteBuffer r4 = r5.f
int r4 = r4.remaining()
int r3 = java.lang.Math.min(r3, r4)
java.nio.ByteBuffer r4 = r5.f
r4.get(r6, r2, r3)
int r1 = r1 + r3
if (r1 == r8) goto L32
boolean r2 = r5.h
if (r2 == 0) goto L2a
goto L32
L2a:
r5.g = r0
java.nio.ByteBuffer r2 = r5.f
r2.clear()
goto L37
L32:
if (r1 <= 0) goto L35
return r1
L35:
r6 = -1
return r6
L37:
boolean r2 = r5.h
r3 = 0
if (r2 == 0) goto Lca
java.nio.charset.CoderResult r2 = java.nio.charset.CoderResult.UNDERFLOW
boolean r4 = r2.isOverflow()
if (r4 == 0) goto L64
java.nio.ByteBuffer r2 = r5.f
r2.flip()
java.nio.ByteBuffer r2 = r5.f
int r2 = r2.remaining()
if (r2 != 0) goto L60
java.nio.ByteBuffer r2 = r5.f
int r2 = r2.capacity()
int r2 = r2 * 2
java.nio.ByteBuffer r2 = java.nio.ByteBuffer.allocate(r2)
r5.f = r2
goto Lb
L60:
r2 = 1
r5.g = r2
goto Lb
L64:
boolean r4 = r2.isUnderflow()
if (r4 == 0) goto Lc0
java.nio.CharBuffer r6 = r5.f12480c
int r7 = r6.capacity()
int r6 = r6.limit()
int r7 = r7 - r6
if (r7 != 0) goto Lad
java.nio.CharBuffer r6 = r5.f12480c
int r6 = r6.position()
if (r6 <= 0) goto L89
java.nio.CharBuffer r6 = r5.f12480c
java.nio.CharBuffer r6 = r6.compact()
r6.flip()
goto Lad
L89:
java.nio.CharBuffer r6 = r5.f12480c
char[] r7 = r6.array()
int r8 = r6.capacity()
int r8 = r8 * 2
char[] r7 = java.util.Arrays.copyOf(r7, r8)
java.nio.CharBuffer r7 = java.nio.CharBuffer.wrap(r7)
int r8 = r6.position()
r7.position(r8)
int r6 = r6.limit()
r7.limit(r6)
r5.f12480c = r7
Lad:
java.nio.CharBuffer r6 = r5.f12480c
r6.limit()
java.nio.CharBuffer r6 = r5.f12480c
r6.array()
java.nio.CharBuffer r6 = r5.f12480c
r6.capacity()
r6.limit()
throw r3
Lc0:
boolean r3 = r2.isError()
if (r3 == 0) goto L37
r2.throwException()
return r0
Lca:
throw r3
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.common.io.ReaderInputStream.read(byte[], int, int):int");
}
}