From c938446ef08bb58c1ef8ed64a7800eb6de1ec31c Mon Sep 17 00:00:00 2001 From: emanuele-f Date: Thu, 21 Jul 2022 23:25:10 +0200 Subject: [PATCH] Add features unlock message --- .../remote_capture/activities/AboutActivity.java | 9 ++++++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/emanuelef/remote_capture/activities/AboutActivity.java b/app/src/main/java/com/emanuelef/remote_capture/activities/AboutActivity.java index 6638ae62..68b33053 100644 --- a/app/src/main/java/com/emanuelef/remote_capture/activities/AboutActivity.java +++ b/app/src/main/java/com/emanuelef/remote_capture/activities/AboutActivity.java @@ -104,9 +104,16 @@ public class AboutActivity extends BaseActivity { content.findViewById(R.id.copy_id).setOnClickListener(v -> Utils.copyToClipboard(this, systemId)); + boolean was_valid = billing.isPurchased(Billing.SUPPORTER_SKU); + AlertDialog myDialog = new AlertDialog.Builder(this) .setView(content) - .setPositiveButton(R.string.ok, (dialog, whichButton) -> billing.setLicense(unlockCode.getText().toString())) + .setPositiveButton(R.string.ok, (dialog, whichButton) -> { + billing.setLicense(unlockCode.getText().toString()); + + if(!was_valid && billing.isPurchased(Billing.SUPPORTER_SKU)) + Utils.showToastLong(this, R.string.paid_features_unlocked); + }) .setNeutralButton(R.string.validate, (dialog, which) -> {}) // see below .create(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0cde54e8..3427e2f4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -388,4 +388,5 @@ You have configured PCAPdroid to send traffic to a remote server. The server will be able to access your sensitive information.\n\nIf someone asked you to do this, it is probably a scam attempt For security reasons, sending traffic to the remote server \"%1$s\" is not allowed" Warning + Paid features unlocked. Restart the capture if running