From 6d70bd758ada6f58f609475c9b226fdfcac83cac Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 6 Jan 2021 19:23:44 +0100 Subject: [PATCH] Some changes --- .gitignore | 1 + app/build.gradle | 17 +- .../fedilab/fedilabtube/DonationActivity.java | 171 ++++++++++++++---- .../drawable/DonationButtonAdapter.java | 43 +++-- .../drawable/DonationHistoryAdapter.java | 45 ++--- .../fragment/DonationsFragment.java | 46 ++++- ...a => MySubscriptionDonationsFragment.java} | 18 +- .../res/layout/drawer_my_donation.xml | 54 ++++++ .../res/layout/fragment_donations.xml | 2 +- app/src/main/res/values/strings.xml | 11 +- torrentStream/build.gradle | 13 ++ 11 files changed, 324 insertions(+), 97 deletions(-) rename app/src/google_donation/java/app/fedilab/fedilabtube/fragment/{MyDonationsFragment.java => MySubscriptionDonationsFragment.java} (84%) create mode 100644 app/src/google_donation/res/layout/drawer_my_donation.xml diff --git a/.gitignore b/.gitignore index 0f4f918..f4f1d03 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /app/google_full/ /app/google_acad/ /app/src/google_donation/res/values/data.xml +/keystore.properties diff --git a/app/build.gradle b/app/build.gradle index 6230546..bdff88a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,7 +1,21 @@ apply plugin: 'com.android.application' apply plugin: "androidx.navigation.safeargs" + +def keystorePropertiesFile = rootProject.file("keystore.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { + signingConfigs { + full_version { + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + keyPassword keystoreProperties['keyPassword'] + keyAlias keystoreProperties['keyAlias'] + + } + } compileSdkVersion 30 buildToolsVersion "30.0.2" @@ -22,6 +36,7 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.full_version } } compileOptions { @@ -200,7 +215,7 @@ dependencies { implementation 'com.fasterxml.jackson.core:jackson-core:2.12.0' implementation 'org.slf4j:slf4j-simple:1.7.30' - google_fullImplementation 'com.anjlab.android.iab.v3:library:1.0.44' + google_fullImplementation "com.android.billingclient:billing:3.0.2" fdroid_peertube_apps_educImplementation 'org.matomo.sdk:tracker:4.1.2' google_peertube_apps_educImplementation 'org.matomo.sdk:tracker:4.1.2' diff --git a/app/src/google_donation/java/app/fedilab/fedilabtube/DonationActivity.java b/app/src/google_donation/java/app/fedilab/fedilabtube/DonationActivity.java index eb990cb..d0c9dd2 100644 --- a/app/src/google_donation/java/app/fedilab/fedilabtube/DonationActivity.java +++ b/app/src/google_donation/java/app/fedilab/fedilabtube/DonationActivity.java @@ -14,11 +14,12 @@ package app.fedilab.fedilabtube; * You should have received a copy of the GNU General Public License along with TubeLab; if not, * see . */ -import android.content.Intent; import android.os.Bundle; import android.view.MenuItem; import android.view.View; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; @@ -26,23 +27,39 @@ import androidx.fragment.app.FragmentStatePagerAdapter; import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.ViewPager; -import com.anjlab.android.iab.v3.BillingProcessor; -import com.anjlab.android.iab.v3.TransactionDetails; +import com.android.billingclient.api.BillingClient; +import com.android.billingclient.api.BillingClientStateListener; +import com.android.billingclient.api.BillingResult; +import com.android.billingclient.api.ConsumeParams; +import com.android.billingclient.api.ConsumeResponseListener; +import com.android.billingclient.api.Purchase; +import com.android.billingclient.api.PurchasesUpdatedListener; +import com.android.billingclient.api.SkuDetailsParams; +import com.google.android.material.snackbar.Snackbar; import com.google.android.material.tabs.TabLayout; import org.jetbrains.annotations.NotNull; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.List; import app.fedilab.fedilabtube.databinding.ActivityDonationBinding; + +import app.fedilab.fedilabtube.fragment.MySubscriptionDonationsFragment; import app.fedilab.fedilabtube.fragment.DonationsFragment; -import app.fedilab.fedilabtube.fragment.MyDonationsFragment; -public class DonationActivity extends AppCompatActivity implements BillingProcessor.IBillingHandler { +public class DonationActivity extends AppCompatActivity implements PurchasesUpdatedListener { + - BillingProcessor bp; DonationsFragment donationsFragment; - MyDonationsFragment myDonationsFragment; + DonationsFragment subscriptionDonationsFragment; + MySubscriptionDonationsFragment mySubscriptionDonationsFragment; private ActivityDonationBinding binding; + private BillingClient billingClient; + @Override protected void onCreate(Bundle savedInstanceState) { @@ -50,16 +67,87 @@ public class DonationActivity extends AppCompatActivity implements BillingProces binding = ActivityDonationBinding.inflate(getLayoutInflater()); View view = binding.getRoot(); setContentView(view); - bp = new BillingProcessor(this, getString(R.string.google_key), this); - bp.initialize(); + billingClient = BillingClient.newBuilder(this) + .setListener(this) + .enablePendingPurchases() + .build(); + billingClient.startConnection(new BillingClientStateListener() { + @Override + public void onBillingSetupFinished(@NotNull BillingResult billingResult) { + if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) { + // The BillingClient is ready. You can query purchases here. + donationsFragment.initialized(billingClient); + subscriptionDonationsFragment.initialized(billingClient); + + Purchase.PurchasesResult purchasesResult = billingClient.queryPurchases(BillingClient.SkuType.SUBS); + List purchases = purchasesResult.getPurchasesList(); + List isSubscriptions = new ArrayList<>(); + if (purchases != null) { + for (Purchase purchase : purchases) { + try { + JSONObject purchaseJson = new JSONObject(purchase.getOriginalJson()); + String productId = purchaseJson.getString("productId"); + isSubscriptions.add(productId); + } catch (JSONException e) { + e.printStackTrace(); + } + } + SkuDetailsParams.Builder paramsSub = SkuDetailsParams.newBuilder(); + paramsSub.setSkusList(isSubscriptions).setType(BillingClient.SkuType.SUBS); + billingClient.querySkuDetailsAsync(paramsSub.build(), + (billingResult2, skuDetailsList) -> mySubscriptionDonationsFragment.initialized(skuDetailsList, billingClient)); + } else { + mySubscriptionDonationsFragment.initialized(new ArrayList<>(), billingClient); + } + + + purchasesResult = billingClient.queryPurchases(BillingClient.SkuType.INAPP); + purchases = purchasesResult.getPurchasesList(); + if (purchases != null) { + for (Purchase purchase : purchases) { + if (!purchase.isAutoRenewing()) { + ConsumeParams consumeParams = + ConsumeParams.newBuilder() + .setPurchaseToken(purchase.getPurchaseToken()) + .build(); + + ConsumeResponseListener listener = (billingResult1, purchaseToken) -> { + if (billingResult1.getResponseCode() == BillingClient.BillingResponseCode.OK) { + // Handle the success of the consume operation. + } + }; + billingClient.consumeAsync(consumeParams, listener); + } + } + } + } + } + + @Override + public void onBillingServiceDisconnected() { + // Try to restart the connection on the next request to + // Google Play by calling the startConnection() method. + } + }); if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); donationsFragment = new DonationsFragment(); - myDonationsFragment = new MyDonationsFragment(); + Bundle bundle1 = new Bundle(); + bundle1.putSerializable("isSubscriptions", false); + donationsFragment.setArguments(bundle1); - binding.tablayout.addTab(binding.tablayout.newTab().setText(getString(R.string.donate))); - binding.tablayout.addTab(binding.tablayout.newTab().setText(getString(R.string.my_donations))); - binding.viewpager.setOffscreenPageLimit(2); + + subscriptionDonationsFragment = new DonationsFragment(); + Bundle bundle2 = new Bundle(); + bundle2.putSerializable("isSubscriptions", true); + subscriptionDonationsFragment.setArguments(bundle2); + + mySubscriptionDonationsFragment = new MySubscriptionDonationsFragment(); + + binding.tablayout.addTab(binding.tablayout.newTab().setText(getString(R.string.one_time))); + binding.tablayout.addTab(binding.tablayout.newTab().setText(getString(R.string.subscriptions))); + binding.tablayout.addTab(binding.tablayout.newTab().setText(getString(R.string.my_subscriptions))); + binding.viewpager.setOffscreenPageLimit(3); PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager()); binding.viewpager.setAdapter(mPagerAdapter); @@ -110,33 +198,38 @@ public class DonationActivity extends AppCompatActivity implements BillingProces } @Override - public void onProductPurchased(@NotNull String productId, TransactionDetails details) { + public void onPurchasesUpdated(@NonNull BillingResult billingResult, @Nullable List purchases) { + String message; + if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK + && purchases != null) { + for (Purchase purchase : purchases) { + if (!purchase.isAutoRenewing()) { + ConsumeParams consumeParams = + ConsumeParams.newBuilder() + .setPurchaseToken(purchase.getPurchaseToken()) + .build(); - } - - @Override - public void onPurchaseHistoryRestored() { - - } - - @Override - public void onBillingError(int errorCode, Throwable error) { - - } - - @Override - public void onBillingInitialized() { - donationsFragment.initialized(bp); - myDonationsFragment.initialized(bp); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (!bp.handleActivityResult(requestCode, resultCode, data)) { - super.onActivityResult(requestCode, resultCode, data); + ConsumeResponseListener listener = (billingResult1, purchaseToken) -> { + if (billingResult1.getResponseCode() == BillingClient.BillingResponseCode.OK) { + // Handle the success of the consume operation. + } + }; + billingClient.consumeAsync(consumeParams, listener); + } + } + message = getString(R.string.donation_succeeded_null); + } else if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.USER_CANCELED) { + message = getString(R.string.donation_cancelled); + } else { + message = getString(R.string.toast_error); } + View parentLayout = findViewById(android.R.id.content); + Snackbar snackbar = Snackbar.make(parentLayout, message, Snackbar.LENGTH_INDEFINITE); + snackbar.setAction(R.string.close, view -> snackbar.dismiss()); + snackbar.show(); } + /** * Pager adapter for the 2 fragments */ @@ -151,15 +244,17 @@ public class DonationActivity extends AppCompatActivity implements BillingProces public Fragment getItem(int position) { if (position == 0) { return donationsFragment; + } else if (position == 1) { + return subscriptionDonationsFragment; } else { - return myDonationsFragment; + return mySubscriptionDonationsFragment; } } @Override public int getCount() { - return 2; + return 3; } } } diff --git a/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationButtonAdapter.java b/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationButtonAdapter.java index cafa466..37f482e 100644 --- a/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationButtonAdapter.java +++ b/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationButtonAdapter.java @@ -21,26 +21,29 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import com.anjlab.android.iab.v3.BillingProcessor; -import com.anjlab.android.iab.v3.SkuDetails; +import com.android.billingclient.api.BillingClient; +import com.android.billingclient.api.BillingFlowParams; +import com.android.billingclient.api.SkuDetails; import java.util.List; import java.util.Locale; import app.fedilab.fedilabtube.DonationActivity; +import app.fedilab.fedilabtube.R; import app.fedilab.fedilabtube.databinding.DrawerDonationBinding; -import app.fedilab.fedilabtube.helper.Helper; public class DonationButtonAdapter extends RecyclerView.Adapter { - private final List items; - private final BillingProcessor billingProcessor; + private final List skuDetails; + private final BillingClient billingClient; private Context context; + private final boolean isSubscription; - public DonationButtonAdapter(List items, BillingProcessor billingProcessor) { - this.items = items; - this.billingProcessor = billingProcessor; + public DonationButtonAdapter(List skuDetails, BillingClient billingClient, boolean subscription) { + this.isSubscription = subscription; + this.skuDetails = skuDetails; + this.billingClient = billingClient; } @NonNull @@ -54,19 +57,27 @@ public class DonationButtonAdapter extends RecyclerView.Adapter billingProcessor.purchase((DonationActivity) context, product_item)); + SkuDetails skuDetail = skuDetails.get(position); + String currency = skuDetail.getPriceCurrencyCode(); + String price = skuDetail.getPrice(); + if (isSubscription) { + holder.binding.buttonDonation.setText(String.format(Locale.getDefault(), "%s %s / %s", price, currency, context.getString(R.string.month))); + } else { + holder.binding.buttonDonation.setText(String.format(Locale.getDefault(), "%s %s", price, currency)); + } + + holder.binding.buttonDonation.setOnClickListener(v -> { + BillingFlowParams billingFlowParams = BillingFlowParams.newBuilder() + .setSkuDetails(skuDetail) + .build(); + billingClient.launchBillingFlow((DonationActivity) context, billingFlowParams); + }); } @Override public int getItemCount() { - return items.size(); + return skuDetails.size(); } static class ViewHolder extends RecyclerView.ViewHolder { diff --git a/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationHistoryAdapter.java b/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationHistoryAdapter.java index 39a87f0..d2cea87 100644 --- a/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationHistoryAdapter.java +++ b/app/src/google_donation/java/app/fedilab/fedilabtube/drawable/DonationHistoryAdapter.java @@ -21,60 +21,61 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import com.anjlab.android.iab.v3.BillingProcessor; -import com.anjlab.android.iab.v3.SkuDetails; +import com.android.billingclient.api.BillingClient; +import com.android.billingclient.api.SkuDetails; + import java.util.List; -import java.util.Locale; -import app.fedilab.fedilabtube.DonationActivity; -import app.fedilab.fedilabtube.databinding.DrawerDonationBinding; -import app.fedilab.fedilabtube.helper.Helper; +import app.fedilab.fedilabtube.databinding.DrawerMyDonationBinding; public class DonationHistoryAdapter extends RecyclerView.Adapter { - private final List items; - private final BillingProcessor billingProcessor; + private final List skuDetailsList; + private final BillingClient billingClient; private Context context; - public DonationHistoryAdapter(List items, BillingProcessor billingProcessor) { - this.items = items; - this.billingProcessor = billingProcessor; + public DonationHistoryAdapter(List SkuDetailsList, BillingClient billingClient) { + this.skuDetailsList = SkuDetailsList; + this.billingClient = billingClient; } + @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { context = parent.getContext(); - DrawerDonationBinding itemBinding = DrawerDonationBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false); + DrawerMyDonationBinding itemBinding = DrawerMyDonationBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false); return new ViewHolder(itemBinding); + } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) { final ViewHolder holder = (ViewHolder) viewHolder; - SkuDetails item = items.get(position); - String product_item = "tubelab_donation_" + item; - SkuDetails skuDetails = billingProcessor.getPurchaseListingDetails(product_item); - String currency = skuDetails.currency; - Double price = skuDetails.priceValue; - holder.binding.buttonDonation.setText(String.format(Locale.getDefault(), "%.2f %s", price, currency)); - holder.binding.buttonDonation.setOnClickListener(v -> billingProcessor.purchase((DonationActivity) context, product_item)); + SkuDetails skuDetails = skuDetailsList.get(position); + holder.binding.productTitle.setText(skuDetails.getTitle()); + holder.binding.productName.setText(skuDetails.getDescription()); + holder.binding.productInfo.setText(skuDetails.getOriginalPrice()); + holder.binding.cancelDonation.setOnClickListener(v -> { + + }); } @Override public int getItemCount() { - return items.size(); + return skuDetailsList.size(); } static class ViewHolder extends RecyclerView.ViewHolder { - DrawerDonationBinding binding; + DrawerMyDonationBinding binding; - ViewHolder(DrawerDonationBinding itemView) { + ViewHolder(DrawerMyDonationBinding itemView) { super(itemView.getRoot()); binding = itemView; } } + } diff --git a/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/DonationsFragment.java b/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/DonationsFragment.java index b63ebb7..6c23159 100644 --- a/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/DonationsFragment.java +++ b/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/DonationsFragment.java @@ -24,14 +24,17 @@ import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; -import com.anjlab.android.iab.v3.BillingProcessor; +import com.android.billingclient.api.BillingClient; +import com.android.billingclient.api.SkuDetailsParams; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import app.fedilab.fedilabtube.R; import app.fedilab.fedilabtube.databinding.FragmentDonationsBinding; import app.fedilab.fedilabtube.drawable.DonationButtonAdapter; +import app.fedilab.fedilabtube.helper.Helper; public class DonationsFragment extends Fragment { @@ -40,25 +43,52 @@ public class DonationsFragment extends Fragment { private FragmentDonationsBinding binding; private View rootView; private Context context; + private boolean isSubscriptions; @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { binding = FragmentDonationsBinding.inflate(LayoutInflater.from(context)); rootView = binding.getRoot(); context = getContext(); + Bundle bundle = this.getArguments(); + if (bundle != null) { + isSubscriptions = bundle.getBoolean("isSubscriptions", false); + } + int donationText; + if (isSubscriptions) { + donationText = R.string.recurrent_donation_text; + } else { + donationText = R.string.one_time_donation_text; + } + binding.donationText.setText(donationText); binding.loader.setVisibility(View.VISIBLE); binding.lvProducts.setVisibility(View.GONE); return rootView; } - public void initialized(BillingProcessor bp) { - binding.loader.setVisibility(View.GONE); - binding.lvProducts.setVisibility(View.VISIBLE); + public void initialized(BillingClient bc) { + + List donationsList = new ArrayList<>(); - Collections.addAll(donationsList, donations); - DonationButtonAdapter donationButtonAdapter = new DonationButtonAdapter(donationsList, bp); - binding.lvProducts.setAdapter(donationButtonAdapter); - binding.lvProducts.setLayoutManager(new LinearLayoutManager(context)); + for (String val : donations) { + donationsList.add("tubelab_donation_" + val + (isSubscriptions ? "_s" : "")); + } + SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder(); + if (isSubscriptions) { + params.setSkusList(donationsList).setType(BillingClient.SkuType.SUBS); + } else { + params.setSkusList(donationsList).setType(BillingClient.SkuType.INAPP); + } + bc.querySkuDetailsAsync(params.build(), + (billingResult, skuDetailsList) -> { + binding.loader.setVisibility(View.GONE); + binding.lvProducts.setVisibility(View.VISIBLE); + DonationButtonAdapter donationButtonAdapter = new DonationButtonAdapter(skuDetailsList, bc, isSubscriptions); + binding.lvProducts.setAdapter(donationButtonAdapter); + binding.lvProducts.setLayoutManager(new LinearLayoutManager(context)); + }); + + } @Override diff --git a/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/MyDonationsFragment.java b/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/MySubscriptionDonationsFragment.java similarity index 84% rename from app/src/google_donation/java/app/fedilab/fedilabtube/fragment/MyDonationsFragment.java rename to app/src/google_donation/java/app/fedilab/fedilabtube/fragment/MySubscriptionDonationsFragment.java index 45e411a..cc34b80 100644 --- a/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/MyDonationsFragment.java +++ b/app/src/google_donation/java/app/fedilab/fedilabtube/fragment/MySubscriptionDonationsFragment.java @@ -24,20 +24,21 @@ import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; -import com.anjlab.android.iab.v3.BillingProcessor; -import com.anjlab.android.iab.v3.SkuDetails; +import com.android.billingclient.api.BillingClient; +import com.android.billingclient.api.Purchase; +import com.android.billingclient.api.SkuDetails; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import app.fedilab.fedilabtube.databinding.FragmentMyDonationsBinding; import app.fedilab.fedilabtube.drawable.DonationHistoryAdapter; +import app.fedilab.fedilabtube.helper.Helper; import static app.fedilab.fedilabtube.fragment.DonationsFragment.donations; -public class MyDonationsFragment extends Fragment { +public class MySubscriptionDonationsFragment extends Fragment { private FragmentMyDonationsBinding binding; private View rootView; @@ -54,15 +55,14 @@ public class MyDonationsFragment extends Fragment { return rootView; } - public void initialized(BillingProcessor bp) { + public void initialized(List skuDetailsList, BillingClient bc) { binding.loader.setVisibility(View.GONE); binding.lvPurchases.setVisibility(View.VISIBLE); - ArrayList donationsList = new ArrayList<>(); - Collections.addAll(donationsList, donations); - List skuDetailsList = bp.getPurchaseListingDetails(donationsList); - DonationHistoryAdapter donationHistoryAdapter = new DonationHistoryAdapter(skuDetailsList, bp); + + DonationHistoryAdapter donationHistoryAdapter = new DonationHistoryAdapter(skuDetailsList, bc); binding.lvPurchases.setAdapter(donationHistoryAdapter); binding.lvPurchases.setLayoutManager(new LinearLayoutManager(context)); + } @Override diff --git a/app/src/google_donation/res/layout/drawer_my_donation.xml b/app/src/google_donation/res/layout/drawer_my_donation.xml new file mode 100644 index 0000000..f2e2fa0 --- /dev/null +++ b/app/src/google_donation/res/layout/drawer_my_donation.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + diff --git a/app/src/google_donation/res/layout/fragment_donations.xml b/app/src/google_donation/res/layout/fragment_donations.xml index f585355..a2264bb 100644 --- a/app/src/google_donation/res/layout/fragment_donations.xml +++ b/app/src/google_donation/res/layout/fragment_donations.xml @@ -30,7 +30,7 @@ android:layout_height="wrap_content" android:layout_margin="20dp" android:gravity="center" - android:text="@string/donation_text" /> + android:id="@+id/donation_text" /> %1$s remote account connected with the app.\n\nYou can proceed to some limited actions. Donate My donations - Here, you can make a donation for supporting the development of the app. This action will not bring extra features! + Here, you can make a one time donation for supporting the development of the app. This action will not bring extra features! + Here, you can make a recurrent donation for supporting the development of the app. This action will not bring extra features! Make a donation - Here you will find the list of donations made to the app! Thank you! + Here you will find the list of your recurrent donations made to support the development of the app! Thank you! Support the app + Donation has been cancelled! + Thank you for your donation! + Thank you for your donation of %1$s! + One time + My subscription + Month \ No newline at end of file diff --git a/torrentStream/build.gradle b/torrentStream/build.gradle index f67528b..c9395ef 100644 --- a/torrentStream/build.gradle +++ b/torrentStream/build.gradle @@ -20,7 +20,19 @@ apply plugin: 'de.undercouch.download' group='com.github.TorrentStream' +def keystorePropertiesFile = rootProject.file("keystore.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { + signingConfigs { + full_version { + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + } + } compileSdkVersion 30 defaultConfig { @@ -32,6 +44,7 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.full_version } }