mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 04:09:07 +07:00
Removed donations library and Android support libraries
This commit is contained in:
parent
608de34205
commit
be60a367e8
@ -3,7 +3,6 @@
|
||||
package="io.anuke.mindustry">
|
||||
|
||||
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
|
||||
<uses-permission android:name="com.android.vending.BILLING" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
@ -27,9 +27,6 @@ repositories {
|
||||
dependencies {
|
||||
implementation project(":core")
|
||||
implementation project(":net")
|
||||
implementation 'com.android.support:support-v4:28.0.0'
|
||||
implementation 'org.sufficientlysecure:donations:2.5'
|
||||
implementation 'com.google.android.gms:play-services-auth:16.0.1'
|
||||
|
||||
implementation arcModule("backends:backend-android")
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
|
||||
@ -103,12 +100,6 @@ android {
|
||||
|
||||
flavorDimensions "google"
|
||||
|
||||
productFlavors {
|
||||
google {
|
||||
buildConfigField "boolean", "DONATIONS_GOOGLE", "true"
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 20 KiB |
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="#000">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="top"
|
||||
android:adjustViewBounds="false"
|
||||
android:contentDescription="background"
|
||||
android:cropToPadding="false"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/background" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/donations_activity_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Mindustry</string>
|
||||
<string-array name="donation_google_catalog_values">
|
||||
<item>1 달러</item>
|
||||
<item>2 달러</item>
|
||||
<item>5 달러</item>
|
||||
<item>10 달러</item>
|
||||
<item>15 달러</item>
|
||||
<item>25 달러</item>
|
||||
<item>50 달러</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Mindustry</string>
|
||||
<string-array name="donation_google_catalog_values">
|
||||
<item>1 Доллар</item>
|
||||
<item>2 Доллара</item>
|
||||
<item>5 Долларов</item>
|
||||
<item>10 Долларов</item>
|
||||
<item>15 Долларов</item>
|
||||
<item>25 Долларов</item>
|
||||
<item>50 Долларов</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Mindustry</string>
|
||||
<string-array name="donation_google_catalog_values">
|
||||
<item>1 Доллар</item>
|
||||
<item>2 Доллара</item>
|
||||
<item>5 Долларів</item>
|
||||
<item>10 Долларів</item>
|
||||
<item>15 Долларів</item>
|
||||
<item>25 Долларів</item>
|
||||
<item>50 Долларів</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Mindustry</string>
|
||||
<string-array name="donation_google_catalog_values">
|
||||
<item>1 Dollar</item>
|
||||
<item>2 Dollars</item>
|
||||
<item>5 Dollars</item>
|
||||
<item>10 Dollars</item>
|
||||
<item>15 Dollars</item>
|
||||
<item>25 Dollars</item>
|
||||
<item>50 Dollars</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
@ -10,11 +10,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings.Secure;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
|
||||
import com.google.android.gms.common.GooglePlayServicesRepairableException;
|
||||
import com.google.android.gms.security.ProviderInstaller;
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.backends.android.surfaceview.AndroidApplication;
|
||||
import io.anuke.arc.backends.android.surfaceview.AndroidApplicationConfiguration;
|
||||
@ -57,11 +52,6 @@ public class AndroidLauncher extends AndroidApplication{
|
||||
moveTaskToBack(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openDonations(){
|
||||
showDonations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUUID(){
|
||||
try{
|
||||
@ -119,17 +109,10 @@ public class AndroidLauncher extends AndroidApplication{
|
||||
}
|
||||
};
|
||||
|
||||
try{
|
||||
ProviderInstaller.installIfNeeded(this);
|
||||
}catch(GooglePlayServicesRepairableException e){
|
||||
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
|
||||
apiAvailability.getErrorDialog(this, e.getConnectionStatusCode(), 0).show();
|
||||
}catch(GooglePlayServicesNotAvailableException e){
|
||||
Log.e("SecurityException", "Google Play Services not available.");
|
||||
}
|
||||
if(doubleScaleTablets && isTablet(this.getContext())){
|
||||
Unit.dp.addition = 0.5f;
|
||||
}
|
||||
|
||||
config.hideStatusBar = true;
|
||||
Net.setClientProvider(new KryoClient());
|
||||
Net.setServerProvider(new KryoServer());
|
||||
@ -213,9 +196,4 @@ public class AndroidLauncher extends AndroidApplication{
|
||||
TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
return manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE;
|
||||
}
|
||||
|
||||
private void showDonations(){
|
||||
Intent intent = new Intent(this, DonationsActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
@ -1,73 +0,0 @@
|
||||
package io.anuke.mindustry;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import org.sufficientlysecure.donations.DonationsFragment;
|
||||
|
||||
public class DonationsActivity extends FragmentActivity{
|
||||
/**
|
||||
* Google
|
||||
*/
|
||||
private static final String GOOGLE_PUBKEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzG93KhpfBPKTo2jF0yxbWkkmMKwsPNM4SsMj1aDq7vv6n3R+mqJVfprOJxFfJh7JchXTflLIgiaKXFAiU70gJbMTniEWnEaFSxAeF09a7U0RjOwN+7rFwjCG91c2CpYxPanBTQP4zasc1ODPVzq4q6/4ByjhenN71V4WmR08NFIAodcfFPrOkDPil7i8y7cgcd1Ky53U0TS+LLYJttAK3XdTK4s7VE3I5IKoeNa4uwCmIM59R67q2k3cXjLk/nP6MP+y++EzHN/PTiR1sVg4dMP8K31RPw/1QNLPQwJz6Wc872oWwb7xo5gkoXbDc5WPPydsi8F3SyKNaYwzN6CDFQIDAQAB";
|
||||
private static final String[] GOOGLE_CATALOG = new String[]{
|
||||
"mindustry.donation.1", "mindustry.donation.2", "mindustry.donation.5",
|
||||
"mindustry.donation.10", "mindustry.donation.15",
|
||||
"mindustry.donation.25", "mindustry.donation.50"};
|
||||
DonationsFragment donationsFragment;
|
||||
|
||||
/**
|
||||
* Called when the activity is first created.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setTheme(R.style.GdxTheme);
|
||||
|
||||
setContentView(R.layout.donations_activity);
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
if(BuildConfig.DONATIONS_GOOGLE){
|
||||
donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG,
|
||||
getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null,
|
||||
null, false, null, null, false, null);
|
||||
}
|
||||
|
||||
|
||||
ft.replace(R.id.donations_activity_container, donationsFragment, "donationsFragment");
|
||||
ft.commit();
|
||||
}
|
||||
|
||||
public void onStart(){
|
||||
super.onStart();
|
||||
Button b = findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button);
|
||||
b.setOnClickListener(view -> {
|
||||
donationsFragment.donateGoogleOnClick(donationsFragment.getView());
|
||||
b.setEnabled(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Needed for Google Play In-app Billing. It uses startIntentSenderForResult(). The result is not propagated to
|
||||
* the Fragment like in startActivityForResult(). Thus we need to propagate manually to our Fragment.
|
||||
*/
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data){
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
Button b = findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button);
|
||||
b.setEnabled(true);
|
||||
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
|
||||
if(fragment != null){
|
||||
fragment.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
}
|
@ -36,6 +36,8 @@ public class Vars{
|
||||
public static final Charset charset = Charset.forName("UTF-8");
|
||||
/**main application name, capitalized*/
|
||||
public static final String appName = "Mindustry";
|
||||
/**URL for itch.io donations.*/
|
||||
public static final String donationURL = "https://anuke.itch.io/mindustry/purchase";
|
||||
/**URL for discord invite.*/
|
||||
public static final String discordURL = "https://discord.gg/mindustry";
|
||||
/**URL for Github API for releases*/
|
||||
|
@ -38,7 +38,9 @@ public abstract class Platform {
|
||||
/**Update discord RPC.*/
|
||||
public void updateRPC(){}
|
||||
/**Open donation dialog. Currently android only.*/
|
||||
public void openDonations(){}
|
||||
public void openDonations(){
|
||||
|
||||
}
|
||||
/**Whether donating is supported.*/
|
||||
public boolean canDonate(){
|
||||
return false;
|
||||
|
@ -63,7 +63,7 @@ public class MenuFragment extends Fragment{
|
||||
join = new MobileButton("icon-add", isize, "$joingame", ui.join::show),
|
||||
editor = new MobileButton("icon-editor", isize, "$editor", () -> ui.loadAnd(ui.editor::show)),
|
||||
tools = new MobileButton("icon-tools", isize, "$settings", ui.settings::show),
|
||||
donate = new MobileButton("icon-donate", isize, "$donate", Platform.instance::openDonations);
|
||||
donate = new MobileButton("icon-donate", isize, "$donate", () -> Core.net.openURI(donationURL));
|
||||
|
||||
if(Core.graphics.getWidth() > Core.graphics.getHeight()){
|
||||
container.add(play);
|
||||
|
Loading…
Reference in New Issue
Block a user