diff options
| author | Arne Schwabe <arne@rfc2549.org> | 2013-08-02 11:38:34 +0200 | 
|---|---|---|
| committer | Arne Schwabe <arne@rfc2549.org> | 2013-08-02 11:38:34 +0200 | 
| commit | 2ccc4039958abb90bf6f1cfc9c3d2de480abbecb (patch) | |
| tree | d8890a268f08ec2ecf82d989c314210056fb0550 | |
| parent | 7a6a6c894d5318b66efbe7289d12c9d33278c750 (diff) | |
Welcome Android 4.3
Also add prototypish restricted profile support
| -rw-r--r-- | AndroidManifest.xml | 18 | ||||
| -rw-r--r-- | build.gradle | 6 | ||||
| -rw-r--r-- | icsopenvpn.iml | 6 | ||||
| -rw-r--r-- | project.properties | 2 | ||||
| -rwxr-xr-x | res/values/strings.xml | 1 | ||||
| -rw-r--r-- | src/de/blinkt/openvpn/core/GetRestrictionReceiver.java | 44 | 
6 files changed, 66 insertions, 11 deletions
| diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 31a5de36..f3890ea7 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -4,17 +4,17 @@      xmlns:tools="http://schemas.android.com/tools"      package="de.blinkt.openvpn"> -    <uses-permission android:name="android.permission.INTERNET" /> -    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> +    <uses-permission android:name="android.permission.INTERNET" android:require="true" /> +    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:require="true"/>      <!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> --> -    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> -    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> +    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" android:require="false"/> +    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:require="false" />      <!-- <uses-permission android:name="com.android.vending.BILLING" /> -->      <uses-sdk          android:minSdkVersion="14" -        android:targetSdkVersion="17" /> +        android:targetSdkVersion="18" />      <!-- Copy the <permission> block to your app when using the REMOTE API. Otherwise OpenVPN for          Android needs to be installed first --> @@ -155,6 +155,14 @@              android:exported="true"              android:grantUriPermissions="true"              tools:ignore="ExportedContentProvider" /> + +        <!-- +        <receiver android:name="core.GetRestrictionReceiver"> +            <intent-filter> +                <action android:name="android.intent.action.GET_RESTRICTION_ENTRIES" /> +            </intent-filter> +        </receiver> +        -->      </application>  </manifest> diff --git a/build.gradle b/build.gradle index 8b3affea..c7870cd5 100644 --- a/build.gradle +++ b/build.gradle @@ -18,12 +18,12 @@ dependencies {  }  android { -    compileSdkVersion 17 -    buildToolsVersion "17" +    compileSdkVersion 18 +    buildToolsVersion "18"      defaultConfig {          minSdkVersion 14 -        targetSdkVersion 17 +        targetSdkVersion 18          versionCode = 71          versionName = "0.5.39"      } diff --git a/icsopenvpn.iml b/icsopenvpn.iml index 49de8ccb..8b4a8840 100644 --- a/icsopenvpn.iml +++ b/icsopenvpn.iml @@ -6,7 +6,9 @@          <option name="SELECTED_BUILD_VARIANT" value="Debug" />          <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />          <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleTest" /> +        <option name="SOURCE_GEN_TASK_NAME" value="TODO" />          <option name="ALLOW_USER_CONFIGURATION" value="false" /> +        <option name="UPDATE_PROPERTY_FILES" value="true" />        </configuration>      </facet>      <facet type="android-gradle" name="Android-Gradle"> @@ -64,7 +66,7 @@        <excludeFolder url="file://$MODULE_DIR$/build/symbols" />        <excludeFolder url="file://$MODULE_DIR$/build/tmp" />      </content> -    <orderEntry type="jdk" jdkName="Android 4.2.2" jdkType="Android SDK" /> +    <orderEntry type="jdk" jdkName="Android 4.3 Platform" jdkType="Android SDK" />      <orderEntry type="sourceFolder" forTests="false" />      <orderEntry type="module-library">        <library> @@ -75,7 +77,7 @@          <SOURCES />        </library>      </orderEntry> -    <orderEntry type="library" name="annotations-12.0" level="project" /> +    <orderEntry type="library" exported="" name="annotations-12.0" level="project" />    </component>  </module> diff --git a/project.properties b/project.properties index c4f09d2b..73fc6610 100644 --- a/project.properties +++ b/project.properties @@ -8,4 +8,4 @@  # project structure.  # Project target. -target=android-17 +target=android-18 diff --git a/res/values/strings.xml b/res/values/strings.xml index 5a12b461..111929ca 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -289,5 +289,6 @@      <string name="cannotparsecert">Cannot display certificate information</string>      <string name="appbehaviour">Application behaviour</string>      <string name="vpnbehaviour">VPN behaviour</string> +    <string name="allow_vpn_changes">Allow changes to VPN Profiles</string>  </resources>
\ No newline at end of file diff --git a/src/de/blinkt/openvpn/core/GetRestrictionReceiver.java b/src/de/blinkt/openvpn/core/GetRestrictionReceiver.java new file mode 100644 index 00000000..14134148 --- /dev/null +++ b/src/de/blinkt/openvpn/core/GetRestrictionReceiver.java @@ -0,0 +1,44 @@ +package de.blinkt.openvpn.core; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.RestrictionEntry; +import android.os.Bundle; + +import java.util.ArrayList; + +import de.blinkt.openvpn.R; + +/** + * Created by arne on 25.07.13. + */ +public class GetRestrictionReceiver extends BroadcastReceiver { +    @Override +    public void onReceive(final Context context, Intent intent) { +        final PendingResult result = goAsync(); + +        new Thread() { +            @Override +            public void run() { +                final Bundle extras = new Bundle(); + +                ArrayList<RestrictionEntry> restrictionEntries = initRestrictions(context); + +                extras.putParcelableArrayList(Intent.EXTRA_RESTRICTIONS_LIST, restrictionEntries); +                result.setResult(Activity.RESULT_OK,null,extras); +                result.finish(); +            } +        }.run(); +    } + +    private ArrayList<RestrictionEntry> initRestrictions(Context context) { +        ArrayList<RestrictionEntry> restrictions = new ArrayList<RestrictionEntry>(); +        RestrictionEntry allowChanges = new RestrictionEntry("allow_changes",false); +        allowChanges.setTitle(context.getString(R.string.allow_vpn_changes)); +        restrictions.add(allowChanges); + +        return restrictions; +    } +} | 
