Product flavor for KitKat and Lollipop and later

This commit is contained in:
M66B 2016-07-24 10:03:43 +02:00
parent 2628a0ea3d
commit 643e1ba8ae
4 changed files with 251 additions and 81 deletions

View File

@ -8,12 +8,12 @@
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="allDebug" />
<option name="SELECTED_BUILD_VARIANT" value="lollipopDebug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleAllDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileAllDebugSources" />
<option name="ASSEMBLE_TASK_NAME" value="assembleLollipopDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileLollipopDebugSources" />
<afterSyncTasks>
<task>generateAllDebugSources</task>
<task>generateLollipopDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
@ -24,62 +24,62 @@
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/all/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/all/debug" />
<output url="file://$MODULE_DIR$/build/intermediates/classes/lollipop/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/lollipop/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/all/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/all/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/all/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/all/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/all/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/all/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/allDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/all/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/all/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/all/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/all/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/all/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/all/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAllDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/all/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/all/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/all/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/all/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/all/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/all/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/all/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/all/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestAll/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testAll/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/lollipop/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/lollipop/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/lollipop/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/lollipop/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/lollipop/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/lollipop/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipopDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipopDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/lollipop/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/lollipop/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/lollipop/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/lollipop/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/lollipop/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/lollipop/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lollipop/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestLollipop/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testLollipop/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
@ -104,14 +104,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/renderscript" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/renderscript" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
@ -120,6 +112,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/renderscript" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/renderscript" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/binaries" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />

View File

@ -7,19 +7,6 @@ model {
defaultConfig {
applicationId = "eu.faircode.netguard"
minSdkVersion.apiLevel = 14
targetSdkVersion.apiLevel = 24
versionCode = 2016072401
versionName = "2.43"
archivesBaseName = "NetGuard-v$versionName-$versionCode-sdk-$targetSdkVersion.apiLevel"
buildConfigFields {
create() {
type "int"
name "VALUE"
value "1"
}
}
}
compileOptions.with {
@ -67,7 +54,19 @@ model {
}
productFlavors {
create("all") {
create("kitkat") {
versionName = "2.43"
minSdkVersion.apiLevel = 14
targetSdkVersion.apiLevel = 19
versionCode = 2016072410
archivesBaseName = "NetGuard-v$versionName"
}
create("lollipop") {
versionName = "2.43"
minSdkVersion.apiLevel = 20
targetSdkVersion.apiLevel = 24
versionCode = 2016072420
archivesBaseName = "NetGuard-v$versionName"
}
}
}

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.faircode.netguard">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<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 -->
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:name="android.software.app_widgets"
android:required="false" />
<application
android:name="ApplicationEx"
android:allowBackup="false"
android:description="@string/app_description"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppThemeTeal">
<activity
android:name=".ActivityMain"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTop"
android:resizeableActivity="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ActivitySettings"
android:configChanges="orientation|screenSize"
android:label="@string/menu_settings"
android:parentActivityName=".ActivityMain">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ActivityMain" />
</activity>
<activity
android:name=".ActivityLog"
android:configChanges="orientation|screenSize"
android:label="@string/menu_log"
android:parentActivityName=".ActivityMain">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ActivityMain" />
</activity>
<activity
android:name=".ActivityPro"
android:configChanges="orientation|screenSize"
android:label="@string/title_pro"
android:parentActivityName=".ActivityMain">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ActivityMain" />
</activity>
<activity
android:name=".ActivityDns"
android:configChanges="orientation|screenSize"
android:label="@string/setting_show_resolved"
android:parentActivityName=".ActivitySettings">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ActivitySettings" />
</activity>
<activity
android:name=".ActivityForwarding"
android:configChanges="orientation|screenSize"
android:label="@string/setting_forwarding"
android:parentActivityName=".ActivitySettings">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ActivitySettings" />
</activity>
<activity
android:name=".ActivityForwardApproval"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
android:theme="@style/AppDialog">
<intent-filter>
<action android:name="eu.faircode.netguard.START_PORT_FORWARD" />
<action android:name="eu.faircode.netguard.STOP_PORT_FORWARD" />
</intent-filter>
</activity>
<service
android:name=".ServiceSinkhole"
android:label="@string/app_name"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
<service
android:name=".ServiceTileMain"
android:icon="@drawable/ic_security_white_24dp"
android:label="@string/app_name"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<service
android:name=".ServiceTileGraph"
android:icon="@drawable/ic_equalizer_white_24dp"
android:label="@string/setting_stats_category"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<receiver
android:name=".Receiver"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>
<receiver
android:name=".Widget"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="eu.faircode.netguard.APPWIDGET_ON" />
<action android:name="eu.faircode.netguard.APPWIDGET_OFF" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget" />
</receiver>
</application>
</manifest>

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 -->