hide oauth api key

This commit is contained in:
Tungstend 2024-02-07 19:31:21 +08:00
parent 8cd60bdc69
commit 035639c5e9
3 changed files with 7 additions and 2 deletions

View File

@ -9,12 +9,14 @@ android {
def pwd = System.getenv("FCL_KEYSTORE_PASSWORD")
def curseApiKey = System.getenv("CURSE_API_KEY")
if (pwd == null || curseApiKey == null) {
def oauthApiKey = System.getenv("OAUTH_API_KEY")
if (pwd == null || curseApiKey == null || oauthApiKey == null) {
if (new File("${rootDir}/local.properties").exists()) {
Properties prop = new Properties()
prop.load(new FileInputStream("${rootDir}/local.properties"))
pwd = prop.get("pwd")
curseApiKey = prop.get("curse.api.key")
oauthApiKey = prop.get("oauth.api.key")
}
}
@ -57,6 +59,7 @@ android {
configureEach {
resValue "string", "app_version", "${defaultConfig.versionName}"
resValue "string", "curse_api_key", curseApiKey
resValue "string", "oauth_api_key", oauthApiKey
}
}
applicationVariants.configureEach { variant ->

View File

@ -159,7 +159,7 @@ public final class OAuthServer extends NanoHTTPD implements OAuth.Session {
@Override
public String getClientId() {
return "d903cc0e-c3b4-4a3c-b347-06c2e6269be0";
return FCLPath.CONTEXT.getString(R.string.oauth_api_key);
}
@Override

View File

@ -2,6 +2,8 @@
<string name="app_name" translatable="false">Fold Craft Launcher</string>
<string name="app_version" translatable="false">1.1.3</string>
<string name="oauth_api_key" translatable="false">null</string>
<string name="splash_permission_msg">No storage permission, please grant Fold Craft Launcher the permission.</string>
<string name="splash_title">Welcome to Fold Craft Launcher</string>