Add features unlock message

This commit is contained in:
emanuele-f 2022-07-21 23:25:10 +02:00
parent 9bf3c6e64d
commit c938446ef0
2 changed files with 9 additions and 1 deletions

View File

@ -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();

View File

@ -388,4 +388,5 @@
<string name="remote_collector_notice">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</string>
<string name="remote_server_warning">For security reasons, sending traffic to the remote server \"%1$s\" is not allowed"</string>
<string name="warning">Warning</string>
<string name="paid_features_unlocked">Paid features unlocked. Restart the capture if running</string>
</resources>