Add XashConfig(look TODO), replace checks in XashActivity

This commit is contained in:
a1batross 2016-09-06 20:42:07 +03:00
parent f8f8e5c743
commit e917d13ce3
2 changed files with 22 additions and 4 deletions

View file

@ -27,6 +27,7 @@ import java.util.List;
import java.security.MessageDigest;
import in.celest.xash3d.hl.BuildConfig;
import in.celest.xash3d.XashConfig;
/**
Xash Activity
@ -82,11 +83,10 @@ public class XashActivity extends Activity {
// Shared between this activity and LauncherActivity
public static boolean dumbAntiPDALifeCheck( Context context )
{
if( BuildConfig.DEBUG )
if( BuildConfig.DEBUG ||
!XashConfig.CHECK_SIGNATURES )
return false; // disable checking for debug builds
final boolean isTest = context.getPackageName().contains("test");
try
{
PackageInfo info = context.getPackageManager()
@ -101,7 +101,7 @@ public class XashActivity extends Activity {
final String curSIG = Base64.encodeToString( md.digest(), Base64.NO_WRAP );
if( isTest )
if( XashConfig.PKG_TEST )
{
if( SIG_TEST.equals(curSIG) )
return false;

View file

@ -0,0 +1,18 @@
package in.celest.xash3d;
/* TODO: This file should be generated... somehow */
public class XashConfig
{
// in.celest.xash3d.hl.test otherwise main package
public static final boolean PKG_TEST = false;
// check signature enable
public static final boolean CHECK_SIGNATURES = false;
// public release
public static final boolean RELEASE = false;
// public release for Google Play
public static final boolean GP_VERSION = false;
}