Improved release type

This commit is contained in:
M66B
2023-11-03 16:39:44 +01:00
parent b867e38530
commit 5b50da3ca1
5 changed files with 56 additions and 19 deletions

View File

@@ -188,6 +188,7 @@ public class Helper {
private static Boolean hasPlayStore = null;
private static Boolean hasValidFingerprint = null;
private static Boolean isSmartwatch = null;
private static String installerName = "?";
static final float LOW_LIGHT = 0.6f;
@@ -200,6 +201,8 @@ public class Helper {
static final long PIN_FAILURE_DELAY_MAX = 20 * 60 * 1000L; // milliseconds
static final float BNV_LUMINANCE_THRESHOLD = 0.7f;
static final String PLAY_PACKAGE_NAME = "com.android.vending";
static final String PGP_OPENKEYCHAIN_PACKAGE = "org.sufficientlysecure.keychain";
static final String PGP_BEGIN_MESSAGE = "-----BEGIN PGP MESSAGE-----";
static final String PGP_END_MESSAGE = "-----END PGP MESSAGE-----";
@@ -1367,6 +1370,18 @@ public class Helper {
return new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + BuildConfig.APPLICATION_ID));
}
static String getInstallerName(Context context) {
if ("?".equals(installerName))
try {
PackageManager pm = context.getPackageManager();
installerName = pm.getInstallerPackageName(BuildConfig.APPLICATION_ID);
} catch (Throwable ex) {
Log.e(ex);
installerName = null;
}
return installerName;
}
static long getInstallTime(Context context) {
try {
PackageManager pm = context.getPackageManager();