soul-browser/sources/java/com/google/auth/oauth2/GoogleCredentials.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

119 lines
4.1 KiB
Java

package com.google.auth.oauth2;
import com.google.api.client.util.Preconditions;
import com.google.auth.oauth2.OAuth2Credentials;
import com.google.common.base.MoreObjects;
import j$.util.DesugarCollections;
import j$.util.Objects;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/* loaded from: classes3.dex */
public class GoogleCredentials extends OAuth2Credentials implements QuotaProjectIdProvider {
public static final /* synthetic */ int p = 0;
public final String n;
public final boolean o;
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
/* JADX WARN: Unknown enum class pattern. Please report as an issue! */
/* loaded from: classes3.dex */
public static final class GoogleCredentialsInfo {
/* renamed from: c, reason: collision with root package name */
public static final /* synthetic */ GoogleCredentialsInfo[] f12117c = {new Enum("USER_CREDENTIALS", 0), new Enum("SERVICE_ACCOUNT_CREDENTIALS", 1), new Enum("GDCH_CREDENTIALS", 2), new Enum("EXTERNAL_ACCOUNT_CREDENTIALS", 3), new Enum("EXTERNAL_ACCOUNT_AUTHORIZED_USER_CREDENTIALS", 4), new Enum("IMPERSONATED_CREDENTIALS", 5), new Enum("APP_ENGINE_CREDENTIALS", 6), new Enum("CLOUD_SHELL_CREDENTIALS", 7), new Enum("COMPUTE_ENGINE_CREDENTIALS", 8)};
/* JADX INFO: Fake field, exist only in values array */
GoogleCredentialsInfo EF5;
public static GoogleCredentialsInfo valueOf(String str) {
return (GoogleCredentialsInfo) Enum.valueOf(GoogleCredentialsInfo.class, str);
}
public static GoogleCredentialsInfo[] values() {
return (GoogleCredentialsInfo[]) f12117c.clone();
}
}
public GoogleCredentials(Builder builder) {
super(builder.f12131a, builder.b, builder.f12132c);
String str = builder.d;
if (str != null && !str.trim().isEmpty()) {
this.n = str;
this.o = true;
} else {
this.n = "googleapis.com";
this.o = false;
}
}
public static Map k(Map map) {
Preconditions.checkNotNull(map);
return DesugarCollections.unmodifiableMap(new HashMap(map));
}
@Override // com.google.auth.oauth2.OAuth2Credentials
public final Map e() {
return OAuth2Credentials.m;
}
@Override // com.google.auth.oauth2.OAuth2Credentials
public boolean equals(Object obj) {
if (obj instanceof GoogleCredentials) {
GoogleCredentials googleCredentials = (GoogleCredentials) obj;
if (Objects.equals(this.n, googleCredentials.n) && Boolean.valueOf(this.o).equals(Boolean.valueOf(googleCredentials.o))) {
return true;
}
return false;
}
return false;
}
@Override // com.google.auth.oauth2.OAuth2Credentials
public int hashCode() {
return Objects.hash(null, this.n, Boolean.valueOf(this.o));
}
public String m() {
return this.n;
}
public MoreObjects.ToStringHelper n() {
MoreObjects.ToStringHelper b = MoreObjects.b(this);
b.d = true;
b.b(null, "quotaProjectId");
b.b(this.n, "universeDomain");
b.d("isExplicitUniverseDomain", this.o);
return b;
}
@Override // com.google.auth.oauth2.OAuth2Credentials
public String toString() {
return n().toString();
}
/* loaded from: classes3.dex */
public static class Builder extends OAuth2Credentials.Builder {
public final String d;
public Builder() {
this.b = OAuth2Credentials.l;
this.f12132c = OAuth2Credentials.k;
}
public Builder(GoogleCredentials googleCredentials) {
this.b = OAuth2Credentials.l;
this.f12132c = OAuth2Credentials.k;
this.f12131a = googleCredentials.d();
this.b = googleCredentials.f;
this.f12132c = googleCredentials.f12128c;
if (googleCredentials.o) {
this.d = googleCredentials.n;
}
}
}
public GoogleCredentials l(List list) {
return this;
}
}