Removed GP-specific code and build flavor

This commit is contained in:
Anuken
2022-01-29 22:52:13 -05:00
parent 3f7a6e43b8
commit 1ad3f83e17
4 changed files with 1 additions and 91 deletions

View File

@ -41,9 +41,6 @@ android{
assets.srcDirs = ['assets', 'src/main/assets', '../core/assets/']
jniLibs.srcDirs = ['libs']
}
gp{
java.srcDirs = ['srcgp']
}
androidTest.setRoot('tests')
}
@ -95,17 +92,6 @@ android{
}
}
buildTypes{
all{
minifyEnabled = true
shrinkResources = true
//this is the ONLY WAY I could find to force r8 to keep its filthy hands off of my default interfaces.
//may have undesirable side effects
debuggable = true
proguardFiles("proguard-rules.pro")
}
}
if(project.hasProperty("RELEASE_STORE_FILE") || System.getenv("CI") == "true"){
buildTypes{
release{
@ -113,18 +99,6 @@ android{
}
}
}
// Specifies one flavor dimension.
flavorDimensions "version"
productFlavors{
standard{
}
gp{
applicationIdSuffix ".gp"
versionNameSuffix "-gp"
}
}
}
dependencies{
@ -136,9 +110,6 @@ dependencies{
natives "com.github.Anuken.Arc:natives-android:${getArcHash()}"
natives "com.github.Anuken.Arc:natives-freetype-android:${getArcHash()}"
gpImplementation "com.google.android.gms:play-services-games:21.0.0"
gpImplementation "com.google.android.gms:play-services-auth:19.0.0"
//TODO dynamically find best android platform jar instead of hard-coding to 30
def sdkFile = new File((String)findSdkDir(), "/platforms/android-30/android.jar")
if(sdkFile.exists()) compileOnly files(sdkFile.absolutePath)

View File

@ -33,9 +33,6 @@ public class AndroidLauncher extends AndroidApplication{
FileChooser chooser;
Runnable permCallback;
Object gpService;
Class<?> serviceClass;
@Override
protected void onCreate(Bundle savedInstanceState){
UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
@ -243,24 +240,6 @@ public class AndroidLauncher extends AndroidApplication{
}
}
@Override
public void onResume(){
super.onResume();
//TODO enable once GPGS is set up on the GP console
if(false && getPackageName().endsWith(".gp")){
try{
if(gpService == null){
serviceClass = Class.forName("mindustry.android.GPGameService");
gpService = serviceClass.getConstructor().newInstance();
}
serviceClass.getMethod("onResume", Context.class).invoke(gpService, this);
}catch(Exception e){
Log.err("Failed to update Google Play Services", e);
}
}
}
private void checkFiles(Intent intent){
try{
Uri uri = intent.getData();

View File

@ -1,40 +0,0 @@
package mindustry.android;
import android.content.*;
import arc.util.*;
import com.google.android.gms.auth.api.signin.*;
import com.google.android.gms.games.*;
import mindustry.service.*;
public class GPGameService extends GameService{
private GoogleSignInAccount account;
public void onResume(Context context){
Log.info("[GooglePlayService] Resuming.");
GoogleSignInAccount current = GoogleSignIn.getLastSignedInAccount(context);
GoogleSignInOptions options =
new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
.requestScopes(Games.SCOPE_GAMES_SNAPSHOTS)
.build();
if(GoogleSignIn.hasPermissions(current, options.getScopeArray())){
this.account = current;
Log.info("Already signed in to Google Play Games.");
}else{
GoogleSignIn.getClient(context, options).silentSignIn().addOnCompleteListener(complete -> {
if(!complete.isSuccessful()){
if(complete.getException() != null){
Log.err("Failed to sign in to Google Play Games.", complete.getException());
}else{
Log.warn("Failed to sign in to Google Play Games.");
}
}else{
this.account = complete.getResult();
Log.info("Signed in to Google Play Games.");
}
});
}
}
}

View File

@ -31,7 +31,7 @@ public class Rules{
public boolean pvp;
/** Whether to pause the wave timer until all enemies are destroyed. */
public boolean waitEnemies = false;
/** Determinates if gamemode is attack mode. */
/** Determines if gamemode is attack mode. */
public boolean attackMode = false;
/** Whether this is the editor gamemode. */
public boolean editor = false;