This repository was archived by the owner on Apr 25, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathBuildVars.java
95 lines (79 loc) · 4.1 KB
/
BuildVars.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* This is the source code of Telegram for Android v. 7.x.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2020.
*/
package org.telegram.messenger;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import it.owlgram.android.StoreUtils;
import com.android.billingclient.api.ProductDetails;
import java.util.Objects;
public class BuildVars {
public static boolean DEBUG_VERSION = BuildConfig.DEBUG_PRIVATE_VERSION;
public static boolean LOGS_ENABLED = BuildConfig.DEBUG_PRIVATE_VERSION;
public static boolean DEBUG_PRIVATE_VERSION = BuildConfig.DEBUG_PRIVATE_VERSION;
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = false;
public static boolean IGNORE_VERSION_CHECK = false;
public static boolean MAGIC_OWL_EXCEPTIONS = false;
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q;
public static int BUILD_VERSION = BuildConfig.BUILD_VERSION;
public static String BUILD_VERSION_STRING = BuildConfig.BUILD_VERSION_STRING;
public static int TELEGRAM_BUILD_VERSION = 3227;
public static String TELEGRAM_VERSION_STRING = "9.5.4";
public static int APP_ID = 10029733;
public static String APP_HASH = "d0d81009d46e774f78c0e0e622f5fa21";
// SafetyNet key for Google Identity SDK, set it to empty to disable
public static String SAFETYNET_KEY = "";
public static String SMS_HASH = isStandaloneApp() ? "w0lkcmTZkKh" : (DEBUG_VERSION ? "O2P2z+/jBpJ" : "oLeq9AcOZkT");
public static String PLAYSTORE_APP_URL = "https://play.google.com/store/apps/details?id=it.owlgram.android";
public static String GOOGLE_AUTH_CLIENT_ID = "760348033671-81kmi3pi84p11ub8hp9a1funsv0rn2p9.apps.googleusercontent.com";
public static String HUAWEI_APP_ID = "101184875";
// You can use this flag to disable Google Play Billing (If you're making fork and want it to be in Google Play)
public static boolean IS_BILLING_UNAVAILABLE = StoreUtils.isFromPlayStore();
static {
if (ApplicationLoader.applicationContext != null) {
SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("systemConfig", Context.MODE_PRIVATE);
LOGS_ENABLED = DEBUG_VERSION || sharedPreferences.getBoolean("logsEnabled", DEBUG_VERSION);
}
}
public static boolean useInvoiceBilling() {
return DEBUG_VERSION || isStandaloneApp() || isBetaApp() || isHuaweiStoreApp() || hasDirectCurrency();
}
private static boolean hasDirectCurrency() {
if (!BillingController.getInstance().isReady() || BillingController.PREMIUM_PRODUCT_DETAILS == null) {
return false;
}
for (ProductDetails.SubscriptionOfferDetails offerDetails : BillingController.PREMIUM_PRODUCT_DETAILS.getSubscriptionOfferDetails()) {
for (ProductDetails.PricingPhase phase : offerDetails.getPricingPhases().getPricingPhaseList()) {
for (String cur : MessagesController.getInstance(UserConfig.selectedAccount).directPaymentsCurrency) {
if (Objects.equals(phase.getPriceCurrencyCode(), cur)) {
return true;
}
}
}
}
return false;
}
private static Boolean standaloneApp;
public static boolean isStandaloneApp() {
if (standaloneApp == null) {
standaloneApp = ApplicationLoader.applicationContext != null && "it.owlgram.android".equals(ApplicationLoader.applicationContext.getPackageName());
}
return standaloneApp;
}
private static Boolean betaApp;
public static boolean isBetaApp() {
if (betaApp == null) {
betaApp = ApplicationLoader.applicationContext != null && "it.owlgram.android.beta".equals(ApplicationLoader.applicationContext.getPackageName());
}
return betaApp;
}
public static boolean isHuaweiStoreApp() {
return ApplicationLoader.isHuaweiStoreBuild();
}
}