Alt activate

This commit is contained in:
M66B 2021-07-08 22:43:08 +02:00
parent 5628f15c34
commit fe740358c6
1 changed files with 16 additions and 1 deletions

View File

@ -4518,7 +4518,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Log.i("Opening uri=" + uri + " title=" + title);
uri = Uri.parse(uri.toString().replaceAll("\\s+", ""));
if ("email.faircode.eu".equals(uri.getHost()) && "/activate/".equals(uri.getPath())) {
try {
String url = uri.getQueryParameter("url");
if (!TextUtils.isEmpty(url)) {
Uri alt = Uri.parse(url);
if (isActivate(alt))
uri = alt;
}
} catch (Throwable ignored) {
}
if (isActivate(uri)) {
try {
if (ActivityBilling.activatePro(context, uri))
ToastEx.makeText(context, R.string.title_pro_valid, Toast.LENGTH_LONG).show();
@ -4560,6 +4570,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return true;
}
private boolean isActivate(Uri uri) {
return ("email.faircode.eu".equals(uri.getHost()) &&
"/activate/".equals(uri.getPath()));
}
private void onOpenImage(long id, @NonNull String source) {
Log.i("Viewing image source=" + source);