diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 08a90209c..14f9f2490 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -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" diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java index 37f2589a8..8ed95d002 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java @@ -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