Increased minimum SDK to 19 (KitKat 4.4)

Refs #454
This commit is contained in:
M66B 2016-06-26 19:24:05 +02:00
parent 4a41b74009
commit 2575bdd641
6 changed files with 16 additions and 56 deletions

View File

@ -190,7 +190,6 @@ Permissions
* ACCESS_WIFI_STATE ('*Wi-Fi connection information*'): to detect Wi-Fi network changes
* RECEIVE_BOOT_COMPLETED ('*Run at startup*'): to start the firewall when booting the device
* WAKE_LOCK ('*Prevent device from sleeping*'): to reliably reload rules in the background on connectivity changes
* READ/WRITE_EXTERNAL_STORAGE ('*Photos/Media/Files*'): to export/import settings on Android versions before 4.4 (KitKat) (there is no need to grant this permission on later Android versions)
* VIBRATE: to give feedback on widget tap
* com.android.vending.BILLING: to use in-app billing

View File

@ -7,7 +7,7 @@ model {
defaultConfig {
applicationId = "eu.faircode.netguard"
minSdkVersion.apiLevel = 14
minSdkVersion.apiLevel = 19
targetSdkVersion.apiLevel = 23
versionCode = 2016062601
versionName = "2.26"
@ -28,7 +28,7 @@ model {
}
ndk {
platformVersion = "14"
platformVersion = "19"
moduleName = "netguard"
toolchain = "clang"
ldLibs.add("log")

View File

@ -9,7 +9,6 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous -->

View File

@ -516,20 +516,10 @@ public class ActivityLog extends AppCompatActivity implements SharedPreferences.
}
private Intent getIntentPCAPDocument() {
Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
if (Util.isPackageInstalled("org.openintents.filemanager", this)) {
intent = new Intent("org.openintents.action.PICK_DIRECTORY");
} else {
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=org.openintents.filemanager"));
}
} else {
intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("application/octet-stream");
intent.putExtra(Intent.EXTRA_TITLE, "netguard_" + new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".pcap");
}
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("application/octet-stream");
intent.putExtra(Intent.EXTRA_TITLE, "netguard_" + new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".pcap");
return intent;
}

View File

@ -996,20 +996,10 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
}
private Intent getIntentLogcat() {
Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
if (Util.isPackageInstalled("org.openintents.filemanager", this)) {
intent = new Intent("org.openintents.action.PICK_DIRECTORY");
} else {
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=org.openintents.filemanager"));
}
} else {
intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TITLE, "logcat.txt");
}
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TITLE, "logcat.txt");
return intent;
}
}

View File

@ -817,40 +817,22 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
}
private Intent getIntentCreateExport() {
Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
if (Util.isPackageInstalled("org.openintents.filemanager", this)) {
intent = new Intent("org.openintents.action.PICK_DIRECTORY");
} else {
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=org.openintents.filemanager"));
}
} else {
intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*"); // text/xml
intent.putExtra(Intent.EXTRA_TITLE, "netguard_" + new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".xml");
}
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*"); // text/xml
intent.putExtra(Intent.EXTRA_TITLE, "netguard_" + new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".xml");
return intent;
}
private Intent getIntentOpenExport() {
Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
intent = new Intent(Intent.ACTION_GET_CONTENT);
else
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*"); // text/xml
return intent;
}
private Intent getIntentOpenHosts() {
Intent intent;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
intent = new Intent(Intent.ACTION_GET_CONTENT);
else
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*"); // text/plain
return intent;