summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-28 18:27:45 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-28 18:27:45 +0200
commite29c21f8df78b0a855d1fd00fd70c1f429d49954 (patch)
tree56a0f84dd3641d2568909b390d3f6c08c3add01f /app/src/main/java/com/wireguard
parent6ceeac93bf2ceca557c07a81b06bff6f500a9a51 (diff)
Application: refuse to run on old android
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r--app/src/main/java/com/wireguard/android/Application.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/Application.java b/app/src/main/java/com/wireguard/android/Application.java
index 7218c606..efca15dd 100644
--- a/app/src/main/java/com/wireguard/android/Application.java
+++ b/app/src/main/java/com/wireguard/android/Application.java
@@ -6,10 +6,12 @@
package com.wireguard.android;
import android.content.Context;
+import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.os.AsyncTask;
+import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
@@ -97,6 +99,16 @@ public class Application extends android.app.Application {
@Override
protected void attachBaseContext(final Context context) {
super.attachBaseContext(context);
+
+ if (BuildConfig.MIN_SDK_VERSION > Build.VERSION.SDK_INT) {
+ final Intent intent = new Intent(Intent.ACTION_MAIN);
+ intent.addCategory(Intent.CATEGORY_HOME);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(intent);
+ System.exit(0);
+ }
+
final String installSource = getInstallSource(context);
if (installSource != null) {
ACRA.init(this);