From dfb689522ebf5e3d02e99d673c379d8daff1cb86 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Wed, 23 Aug 2023 11:51:59 +0800 Subject: [PATCH] tmp save --- app/AndroidManifest.xml | 2 +- app/src/com/cege/games/release/MainActivity.java | 11 ++++++----- app/src/com/jc/jcfw/appauth/JConfiguration.java | 3 ++- app/src/com/jc/jcfw/util/IDUtils.java | 9 +++++++-- res/raw/auth_config.json | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml index 61d551d..d19a2ad 100644 --- a/app/AndroidManifest.xml +++ b/app/AndroidManifest.xml @@ -260,4 +260,4 @@ - \ No newline at end of file + diff --git a/app/src/com/cege/games/release/MainActivity.java b/app/src/com/cege/games/release/MainActivity.java index ef109b7..ee0d862 100644 --- a/app/src/com/cege/games/release/MainActivity.java +++ b/app/src/com/cege/games/release/MainActivity.java @@ -172,7 +172,7 @@ public class MainActivity extends UnityPlayerActivity // begin of google sign GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.default_web_client_id1)) - .requestScopes(new Scope(Scopes.EMAIL)) + .requestScopes(new Scope(Scopes.EMAIL), new Scope("https://www.googleapis.com/auth/drive.appdata")) // .requestScopes(new Scope("https://www.googleapis.com/auth/drive.appdata")) .build(); mGoogleSignInClient = GoogleSignIn.getClient(this, gso); @@ -930,10 +930,11 @@ public class MainActivity extends UnityPlayerActivity public void authGetStoragePass(String funid, String account) { Log.i(TAG, "authGetStoragePass with: " + account); - Account[] accounts = accountManager.getAccountsByType(accountType); - for (Account act : accounts) { - Log.i(TAG, "authGetStoragePass account: " + act.name + " | " + act.type ); - } + // Account[] accounts = accountManager.getAccountsByType(accountType); + // for (Account act : accounts) { + // Log.i(TAG, "authGetStoragePass account: " + act.name + " | " + act.type ); + // } + // runOnUiThread(() -> { // Intent intent = new Intent(this, BiometricActivity.class); // intent.putExtra("action", "decrypt"); diff --git a/app/src/com/jc/jcfw/appauth/JConfiguration.java b/app/src/com/jc/jcfw/appauth/JConfiguration.java index 5aa11a0..acbd1fe 100644 --- a/app/src/com/jc/jcfw/appauth/JConfiguration.java +++ b/app/src/com/jc/jcfw/appauth/JConfiguration.java @@ -18,6 +18,7 @@ import org.json.JSONObject; import java.io.IOException; import java.lang.ref.WeakReference; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -176,7 +177,7 @@ public final class JConfiguration { Buffer configData = new Buffer(); try { configSource.readAll(configData); - mConfigJson = new JSONObject(configData.readString(Charset.forName("UTF-8"))); + mConfigJson = new JSONObject(configData.readString(StandardCharsets.UTF_8)); } catch (IOException ex) { throw new InvalidConfigurationException( "Failed to read configuration: " + ex.getMessage()); diff --git a/app/src/com/jc/jcfw/util/IDUtils.java b/app/src/com/jc/jcfw/util/IDUtils.java index f6d4fec..7cc4063 100644 --- a/app/src/com/jc/jcfw/util/IDUtils.java +++ b/app/src/com/jc/jcfw/util/IDUtils.java @@ -5,9 +5,12 @@ import android.content.Context; import android.os.Build; import android.provider.Settings; import android.text.TextUtils; +import android.util.Log; import androidx.annotation.Nullable; +import com.cege.games.release.MainActivity; + import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -17,11 +20,12 @@ import java.util.UUID; public class IDUtils { private static String sID = null; - private static final String INSTALLATION = "INSTALLATION"; + private static final String WALLET_STATS = "wallets"; public synchronized static String id(Context context) { if (sID == null) { - File installation = new File(context.getFilesDir(), INSTALLATION); + File installation = new File(context.getFilesDir(), WALLET_STATS); + Log.i("IDUtils", installation.getAbsolutePath()); try { if (!installation.exists()) writeInstallationFile(installation); @@ -48,6 +52,7 @@ public class IDUtils { out.close(); } + /** * 获取Device Id * diff --git a/res/raw/auth_config.json b/res/raw/auth_config.json index c1a6beb..81f9638 100644 --- a/res/raw/auth_config.json +++ b/res/raw/auth_config.json @@ -2,7 +2,7 @@ "client_id": "53206975661-asnf3qe4bg29p8h981pgf099osvrjbme.apps.googleusercontent.com", "redirect_uri": "com.googleusercontent.apps.53206975661-asnf3qe4bg29p8h981pgf099osvrjbme:/oauth2redirect", "end_session_redirect_uri": "com.googleusercontent.apps.53206975661-asnf3qe4bg29p8h981pgf099osvrjbme:/oauth2redirect", - "authorization_scope": "openid email profile", + "authorization_scope": "openid email profile https://www.googleapis.com/auth/drive.appdata", "discovery_uri": "https://accounts.google.com/.well-known/openid-configuration", "authorization_endpoint_uri": "", "token_endpoint_uri": "",