signing and api hash

This commit is contained in:
NekoInverter 2019-06-11 13:56:33 +08:00
parent 66a2a32684
commit c0a606aadd
2 changed files with 28 additions and 12 deletions

View File

@ -35,6 +35,17 @@ dependencies {
implementation 'com.stripe:stripe-android:2.0.2'
}
def getAppId(){
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
return properties.get("APP_ID")
}
def getAppHash(){
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
return "\"" + properties.get("APP_HASH") + "\""
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
@ -64,21 +75,23 @@ android {
}
signingConfigs {
debug {
storeFile file("config/release.keystore")
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
release {
storeFile file("config/release.keystore")
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
storePassword properties.getProperty("RELEASE_STORE_PASSWORD")
keyAlias properties.getProperty("RELEASE_KEY_ALIAS")
keyPassword properties.getProperty("RELEASE_KEY_PASSWORD")
}
debug {
storeFile file("config/release.keystore")
storePassword properties.getProperty("RELEASE_STORE_PASSWORD")
keyAlias properties.getProperty("RELEASE_KEY_ALIAS")
keyPassword properties.getProperty("RELEASE_KEY_PASSWORD")
}
}
buildTypes {
debug {
debuggable true
@ -281,6 +294,9 @@ android {
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
buildConfigField 'int', 'APP_ID', getAppId()
buildConfigField 'String', 'APP_HASH', getAppHash()
externalNativeBuild {
ndkBuild {
arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "-j8"

View File

@ -20,8 +20,8 @@ public class BuildVars {
public static boolean CHECK_UPDATES = false;
public static int BUILD_VERSION = 1608;
public static String BUILD_VERSION_STRING = "5.7.0";
public static int APP_ID = 0; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id
public static String APP_HASH = ""; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id
public static int APP_ID = BuildConfig.APP_ID; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id
public static String APP_HASH = BuildConfig.APP_HASH; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id
public static String HOCKEY_APP_HASH = "your-hockeyapp-api-key-here";
public static String HOCKEY_APP_HASH_DEBUG = "your-hockeyapp-api-key-here";
public static String SMS_HASH = ""; //https://developers.google.com/identity/sms-retriever/overview