soul-browser/sources/java/com/google/android/gms/common/AccountPicker.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

218 lines
7.6 KiB
Java

package com.google.android.gms.common;
import android.accounts.Account;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.common.internal.Preconditions;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes.dex */
public final class AccountPicker {
/* loaded from: classes.dex */
public static class AccountChooserOptions {
@Nullable
private Account zza;
@Nullable
private ArrayList zzb;
@Nullable
private ArrayList zzc;
private boolean zzd;
@Nullable
private String zze;
@Nullable
private Bundle zzf;
/* loaded from: classes.dex */
public static class Builder {
@Nullable
private Account zza;
@Nullable
private ArrayList zzb;
@Nullable
private ArrayList zzc;
private boolean zzd = false;
@Nullable
private String zze;
@Nullable
private Bundle zzf;
@NonNull
public AccountChooserOptions build() {
Preconditions.checkArgument(true, "We only support hostedDomain filter for account chip styled account picker");
Preconditions.checkArgument(true, "Consent is only valid for account chip styled account picker");
AccountChooserOptions accountChooserOptions = new AccountChooserOptions();
accountChooserOptions.zzf(this.zzc);
accountChooserOptions.zzd(this.zzb);
accountChooserOptions.zzh(this.zzd);
accountChooserOptions.zzl(this.zzf);
accountChooserOptions.zzb(this.zza);
accountChooserOptions.zzj(this.zze);
return accountChooserOptions;
}
@NonNull
public Builder setAllowableAccounts(@Nullable List<Account> list) {
ArrayList arrayList;
if (list == null) {
arrayList = null;
} else {
arrayList = new ArrayList(list);
}
this.zzb = arrayList;
return this;
}
@NonNull
public Builder setAllowableAccountsTypes(@Nullable List<String> list) {
ArrayList arrayList;
if (list == null) {
arrayList = null;
} else {
arrayList = new ArrayList(list);
}
this.zzc = arrayList;
return this;
}
@NonNull
public Builder setAlwaysShowAccountPicker(boolean z) {
this.zzd = z;
return this;
}
@NonNull
public Builder setOptionsForAddingAccount(@Nullable Bundle bundle) {
this.zzf = bundle;
return this;
}
@NonNull
public Builder setSelectedAccount(@Nullable Account account) {
this.zza = account;
return this;
}
@NonNull
public Builder setTitleOverrideText(@Nullable String str) {
this.zze = str;
return this;
}
}
public final /* synthetic */ Account zza() {
return this.zza;
}
public final /* synthetic */ void zzb(Account account) {
this.zza = account;
}
public final /* synthetic */ ArrayList zzc() {
return this.zzb;
}
public final /* synthetic */ void zzd(ArrayList arrayList) {
this.zzb = arrayList;
}
public final /* synthetic */ ArrayList zze() {
return this.zzc;
}
public final /* synthetic */ void zzf(ArrayList arrayList) {
this.zzc = arrayList;
}
public final /* synthetic */ boolean zzg() {
return this.zzd;
}
public final /* synthetic */ void zzh(boolean z) {
this.zzd = z;
}
public final /* synthetic */ String zzi() {
return this.zze;
}
public final /* synthetic */ void zzj(String str) {
this.zze = str;
}
public final /* synthetic */ Bundle zzk() {
return this.zzf;
}
public final /* synthetic */ void zzl(Bundle bundle) {
this.zzf = bundle;
}
}
private AccountPicker() {
}
@NonNull
@Deprecated
public static Intent newChooseAccountIntent(@Nullable Account account, @Nullable ArrayList<Account> arrayList, @Nullable String[] strArr, boolean z, @Nullable String str, @Nullable String str2, @Nullable String[] strArr2, @Nullable Bundle bundle) {
Intent intent = new Intent();
Preconditions.checkArgument(true, "We only support hostedDomain filter for account chip styled account picker");
intent.setAction("com.google.android.gms.common.account.CHOOSE_ACCOUNT");
intent.setPackage("com.google.android.gms");
intent.putExtra("allowableAccounts", arrayList);
intent.putExtra("allowableAccountTypes", strArr);
intent.putExtra("addAccountOptions", bundle);
intent.putExtra("selectedAccount", account);
intent.putExtra("alwaysPromptForAccount", z);
intent.putExtra("descriptionTextOverride", str);
intent.putExtra("authTokenType", str2);
intent.putExtra("addAccountRequiredFeatures", strArr2);
intent.putExtra("setGmsCoreAccount", false);
intent.putExtra("overrideTheme", 0);
intent.putExtra("overrideCustomTheme", 0);
intent.putExtra("hostedDomainFilter", (String) null);
return intent;
}
@NonNull
public static Intent newChooseAccountIntent(@NonNull AccountChooserOptions accountChooserOptions) {
Intent intent = new Intent();
Preconditions.checkArgument(true, "We only support hostedDomain filter for account chip styled account picker");
Preconditions.checkArgument(true, "Consent is only valid for account chip styled account picker");
Preconditions.checkArgument(true, "Making the selected account non-clickable is only supported for the THEME_DAY_NIGHT_GOOGLE_MATERIAL2, THEME_LIGHT_GOOGLE_MATERIAL3, THEME_DARK_GOOGLE_MATERIAL3 or THEME_DAY_NIGHT_GOOGLE_MATERIAL3 themes");
intent.setAction("com.google.android.gms.common.account.CHOOSE_ACCOUNT");
intent.setPackage("com.google.android.gms");
intent.putExtra("allowableAccounts", accountChooserOptions.zzc());
if (accountChooserOptions.zze() != null) {
intent.putExtra("allowableAccountTypes", (String[]) accountChooserOptions.zze().toArray(new String[0]));
}
intent.putExtra("addAccountOptions", accountChooserOptions.zzk());
intent.putExtra("selectedAccount", accountChooserOptions.zza());
intent.putExtra("selectedAccountIsNotClickable", false);
intent.putExtra("alwaysPromptForAccount", accountChooserOptions.zzg());
intent.putExtra("descriptionTextOverride", accountChooserOptions.zzi());
intent.putExtra("setGmsCoreAccount", false);
intent.putExtra("realClientPackage", (String) null);
intent.putExtra("overrideTheme", 0);
intent.putExtra("overrideCustomTheme", 0);
intent.putExtra("hostedDomainFilter", (String) null);
Bundle bundle = new Bundle();
if (!bundle.isEmpty()) {
intent.putExtra("first_party_options_bundle", bundle);
}
return intent;
}
}