Add XashConfig(look TODO), replace checks in XashActivity
This commit is contained in:
parent
f8f8e5c743
commit
e917d13ce3
2 changed files with 22 additions and 4 deletions
|
@ -27,6 +27,7 @@ import java.util.List;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
|
|
||||||
import in.celest.xash3d.hl.BuildConfig;
|
import in.celest.xash3d.hl.BuildConfig;
|
||||||
|
import in.celest.xash3d.XashConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Xash Activity
|
Xash Activity
|
||||||
|
@ -82,11 +83,10 @@ public class XashActivity extends Activity {
|
||||||
// Shared between this activity and LauncherActivity
|
// Shared between this activity and LauncherActivity
|
||||||
public static boolean dumbAntiPDALifeCheck( Context context )
|
public static boolean dumbAntiPDALifeCheck( Context context )
|
||||||
{
|
{
|
||||||
if( BuildConfig.DEBUG )
|
if( BuildConfig.DEBUG ||
|
||||||
|
!XashConfig.CHECK_SIGNATURES )
|
||||||
return false; // disable checking for debug builds
|
return false; // disable checking for debug builds
|
||||||
|
|
||||||
final boolean isTest = context.getPackageName().contains("test");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PackageInfo info = context.getPackageManager()
|
PackageInfo info = context.getPackageManager()
|
||||||
|
@ -101,7 +101,7 @@ public class XashActivity extends Activity {
|
||||||
|
|
||||||
final String curSIG = Base64.encodeToString( md.digest(), Base64.NO_WRAP );
|
final String curSIG = Base64.encodeToString( md.digest(), Base64.NO_WRAP );
|
||||||
|
|
||||||
if( isTest )
|
if( XashConfig.PKG_TEST )
|
||||||
{
|
{
|
||||||
if( SIG_TEST.equals(curSIG) )
|
if( SIG_TEST.equals(curSIG) )
|
||||||
return false;
|
return false;
|
||||||
|
|
18
src/in/celest/xash3d/XashConfig.java
Normal file
18
src/in/celest/xash3d/XashConfig.java
Normal 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;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue