* 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>
270 lines
13 KiB
Java
270 lines
13 KiB
Java
package kotlin.io;
|
|
|
|
import com.google.android.gms.ads.RequestConfiguration;
|
|
import java.io.BufferedInputStream;
|
|
import java.io.BufferedOutputStream;
|
|
import java.io.BufferedReader;
|
|
import java.io.BufferedWriter;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.InputStream;
|
|
import java.io.InputStreamReader;
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStreamWriter;
|
|
import java.nio.charset.Charset;
|
|
import java.util.NoSuchElementException;
|
|
import kotlin.Deprecated;
|
|
import kotlin.DeprecatedSinceKotlin;
|
|
import kotlin.Metadata;
|
|
import kotlin.ReplaceWith;
|
|
import kotlin.SinceKotlin;
|
|
import kotlin.collections.ByteIterator;
|
|
import kotlin.internal.InlineOnly;
|
|
import kotlin.jvm.JvmName;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.text.Charsets;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
@Metadata(d1 = {"\u0000Z\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0004\u001a\r\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u0086\u0002\u001a\u0017\u0010\u0003\u001a\u00020\u0004*\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u0007H\u0087\b\u001a\r\u0010\b\u001a\u00020\u0004*\u00020\tH\u0087\b\u001a\u001d\u0010\b\u001a\u00020\u0004*\u00020\t2\u0006\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\u000bH\u0087\b\u001a\u0017\u0010\r\u001a\u00020\u0002*\u00020\u000e2\b\b\u0002\u0010\u000f\u001a\u00020\u000bH\u0087\b\u001a\u0017\u0010\u0010\u001a\u00020\u0011*\u00020\u000e2\b\b\u0002\u0010\u0006\u001a\u00020\u0007H\u0087\b\u001a\u0017\u0010\u0012\u001a\u00020\u0013*\u00020\u000e2\b\b\u0002\u0010\u0006\u001a\u00020\u0007H\u0087\b\u001a\u0017\u0010\r\u001a\u00020\u0014*\u00020\u00152\b\b\u0002\u0010\u000f\u001a\u00020\u000bH\u0087\b\u001a\u0017\u0010\u0016\u001a\u00020\u0017*\u00020\u00152\b\b\u0002\u0010\u0006\u001a\u00020\u0007H\u0087\b\u001a\u0017\u0010\u0018\u001a\u00020\u0019*\u00020\u00152\b\b\u0002\u0010\u0006\u001a\u00020\u0007H\u0087\b\u001a\u001c\u0010\u001a\u001a\u00020\u001b*\u00020\u000e2\u0006\u0010\u001c\u001a\u00020\u00152\b\b\u0002\u0010\u000f\u001a\u00020\u000b\u001a\u0016\u0010\u001d\u001a\u00020\t*\u00020\u000e2\b\b\u0002\u0010\u001e\u001a\u00020\u000bH\u0007\u001a\f\u0010\u001d\u001a\u00020\t*\u00020\u000eH\u0007¨\u0006\u001f"}, d2 = {"iterator", "Lkotlin/collections/ByteIterator;", "Ljava/io/BufferedInputStream;", "byteInputStream", "Ljava/io/ByteArrayInputStream;", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "charset", "Ljava/nio/charset/Charset;", "inputStream", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "offset", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "length", "buffered", "Ljava/io/InputStream;", "bufferSize", "reader", "Ljava/io/InputStreamReader;", "bufferedReader", "Ljava/io/BufferedReader;", "Ljava/io/BufferedOutputStream;", "Ljava/io/OutputStream;", "writer", "Ljava/io/OutputStreamWriter;", "bufferedWriter", "Ljava/io/BufferedWriter;", "copyTo", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "out", "readBytes", "estimatedSize", "kotlin-stdlib"}, k = 2, mv = {2, 2, 0}, xi = 48)
|
|
@JvmName(name = "ByteStreamsKt")
|
|
/* loaded from: classes.dex */
|
|
public final class ByteStreamsKt {
|
|
@InlineOnly
|
|
private static final BufferedInputStream buffered(InputStream inputStream, int i) {
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
return inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream : new BufferedInputStream(inputStream, i);
|
|
}
|
|
|
|
public static /* synthetic */ BufferedInputStream buffered$default(InputStream inputStream, int i, int i2, Object obj) {
|
|
if ((i2 & 1) != 0) {
|
|
i = 8192;
|
|
}
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
return inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream : new BufferedInputStream(inputStream, i);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final BufferedReader bufferedReader(InputStream inputStream, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new BufferedReader(new InputStreamReader(inputStream, charset), 8192);
|
|
}
|
|
|
|
public static /* synthetic */ BufferedReader bufferedReader$default(InputStream inputStream, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new BufferedReader(new InputStreamReader(inputStream, charset), 8192);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final BufferedWriter bufferedWriter(OutputStream outputStream, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new BufferedWriter(new OutputStreamWriter(outputStream, charset), 8192);
|
|
}
|
|
|
|
public static /* synthetic */ BufferedWriter bufferedWriter$default(OutputStream outputStream, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new BufferedWriter(new OutputStreamWriter(outputStream, charset), 8192);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final ByteArrayInputStream byteInputStream(String str, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
byte[] bytes = str.getBytes(charset);
|
|
Intrinsics.checkNotNullExpressionValue(bytes, "getBytes(...)");
|
|
return new ByteArrayInputStream(bytes);
|
|
}
|
|
|
|
public static /* synthetic */ ByteArrayInputStream byteInputStream$default(String str, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
Intrinsics.checkNotNullParameter(str, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
byte[] bytes = str.getBytes(charset);
|
|
Intrinsics.checkNotNullExpressionValue(bytes, "getBytes(...)");
|
|
return new ByteArrayInputStream(bytes);
|
|
}
|
|
|
|
public static final long copyTo(@NotNull InputStream inputStream, @NotNull OutputStream out, int i) {
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(out, "out");
|
|
byte[] bArr = new byte[i];
|
|
int read = inputStream.read(bArr);
|
|
long j = 0;
|
|
while (read >= 0) {
|
|
out.write(bArr, 0, read);
|
|
j += read;
|
|
read = inputStream.read(bArr);
|
|
}
|
|
return j;
|
|
}
|
|
|
|
public static /* synthetic */ long copyTo$default(InputStream inputStream, OutputStream outputStream, int i, int i2, Object obj) {
|
|
if ((i2 & 2) != 0) {
|
|
i = 8192;
|
|
}
|
|
return copyTo(inputStream, outputStream, i);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final ByteArrayInputStream inputStream(byte[] bArr) {
|
|
Intrinsics.checkNotNullParameter(bArr, "<this>");
|
|
return new ByteArrayInputStream(bArr);
|
|
}
|
|
|
|
@NotNull
|
|
public static final ByteIterator iterator(@NotNull final BufferedInputStream bufferedInputStream) {
|
|
Intrinsics.checkNotNullParameter(bufferedInputStream, "<this>");
|
|
return new ByteIterator() { // from class: kotlin.io.ByteStreamsKt$iterator$1
|
|
private boolean finished;
|
|
private int nextByte = -1;
|
|
private boolean nextPrepared;
|
|
|
|
private final void prepareNext() {
|
|
if (!this.nextPrepared && !this.finished) {
|
|
int read = bufferedInputStream.read();
|
|
this.nextByte = read;
|
|
boolean z = true;
|
|
this.nextPrepared = true;
|
|
if (read != -1) {
|
|
z = false;
|
|
}
|
|
this.finished = z;
|
|
}
|
|
}
|
|
|
|
public final boolean getFinished() {
|
|
return this.finished;
|
|
}
|
|
|
|
public final int getNextByte() {
|
|
return this.nextByte;
|
|
}
|
|
|
|
public final boolean getNextPrepared() {
|
|
return this.nextPrepared;
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
prepareNext();
|
|
return !this.finished;
|
|
}
|
|
|
|
@Override // kotlin.collections.ByteIterator
|
|
public byte nextByte() {
|
|
prepareNext();
|
|
if (!this.finished) {
|
|
byte b = (byte) this.nextByte;
|
|
this.nextPrepared = false;
|
|
return b;
|
|
}
|
|
throw new NoSuchElementException("Input stream is over.");
|
|
}
|
|
|
|
public final void setFinished(boolean z) {
|
|
this.finished = z;
|
|
}
|
|
|
|
public final void setNextByte(int i) {
|
|
this.nextByte = i;
|
|
}
|
|
|
|
public final void setNextPrepared(boolean z) {
|
|
this.nextPrepared = z;
|
|
}
|
|
};
|
|
}
|
|
|
|
@Deprecated(message = "Use readBytes() overload without estimatedSize parameter", replaceWith = @ReplaceWith(expression = "readBytes()", imports = {}))
|
|
@DeprecatedSinceKotlin(errorSince = "1.5", warningSince = "1.3")
|
|
@NotNull
|
|
public static final byte[] readBytes(@NotNull InputStream inputStream, int i) {
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(Math.max(i, inputStream.available()));
|
|
copyTo$default(inputStream, byteArrayOutputStream, 0, 2, null);
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
Intrinsics.checkNotNullExpressionValue(byteArray, "toByteArray(...)");
|
|
return byteArray;
|
|
}
|
|
|
|
public static /* synthetic */ byte[] readBytes$default(InputStream inputStream, int i, int i2, Object obj) {
|
|
if ((i2 & 1) != 0) {
|
|
i = 8192;
|
|
}
|
|
return readBytes(inputStream, i);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final InputStreamReader reader(InputStream inputStream, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new InputStreamReader(inputStream, charset);
|
|
}
|
|
|
|
public static /* synthetic */ InputStreamReader reader$default(InputStream inputStream, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new InputStreamReader(inputStream, charset);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final OutputStreamWriter writer(OutputStream outputStream, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new OutputStreamWriter(outputStream, charset);
|
|
}
|
|
|
|
public static /* synthetic */ OutputStreamWriter writer$default(OutputStream outputStream, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
return new OutputStreamWriter(outputStream, charset);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final BufferedOutputStream buffered(OutputStream outputStream, int i) {
|
|
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
|
return outputStream instanceof BufferedOutputStream ? (BufferedOutputStream) outputStream : new BufferedOutputStream(outputStream, i);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final ByteArrayInputStream inputStream(byte[] bArr, int i, int i2) {
|
|
Intrinsics.checkNotNullParameter(bArr, "<this>");
|
|
return new ByteArrayInputStream(bArr, i, i2);
|
|
}
|
|
|
|
public static /* synthetic */ BufferedOutputStream buffered$default(OutputStream outputStream, int i, int i2, Object obj) {
|
|
if ((i2 & 1) != 0) {
|
|
i = 8192;
|
|
}
|
|
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
|
return outputStream instanceof BufferedOutputStream ? (BufferedOutputStream) outputStream : new BufferedOutputStream(outputStream, i);
|
|
}
|
|
|
|
@SinceKotlin(version = "1.3")
|
|
@NotNull
|
|
public static final byte[] readBytes(@NotNull InputStream inputStream) {
|
|
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(Math.max(8192, inputStream.available()));
|
|
copyTo$default(inputStream, byteArrayOutputStream, 0, 2, null);
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
Intrinsics.checkNotNullExpressionValue(byteArray, "toByteArray(...)");
|
|
return byteArray;
|
|
}
|
|
}
|