Skip to content

Commit

Permalink
Add abiFilter for ndk & update lib for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrysbita committed Mar 8, 2019
1 parent 7e7f195 commit 0bb244b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
36 changes: 13 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,24 @@ Issues and PRs are welcome!
## Installation

### For Android
No need to do anything with latest flutter SDK.

#### Deprecated
Add the service in the `application` part your `AndroidManifest.xml`.
```xml
<application
...
<activity
...
</activity>
<service android:name="org.strongswan.android.logic.CharonVpnService"
android:permission="android.permission.BIND_VPN_SERVICE"/>
</application>
```
Modify your `app/build.gradle` to use Java 8 and avoid [#22397](https://github.com/flutter/flutter/issues/22397).
Modify your `app/build.gradle` to use abiFilter because flutter doesn't support multi-architecture in single apk [#18494](https://github.com/flutter/flutter/issues/18494).
```gradle
android {
...
lintOptions {
buildTypes {
...
// To avoid error.
checkReleaseBuilds false
}
// Plugin requires Java 8.
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
release {
...
ndk {
if (project.hasProperty('target-platform') &&
project.property('target-platform') == 'android-arm64') {
abiFilters 'arm64-v8a'
} else {
abiFilters 'armeabi-v7a'
}
}
}
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ apply plugin: 'de.undercouch.download'

// Download prebuilt native libs.
task downloadNaticeLib(type: Download) {
src 'https://github.com/X-dea/Flutter_VPN/releases/download/v0.0.2/strongswan_libs_v5.7.2.zip'
src 'https://github.com/X-dea/Flutter_VPN/releases/download/v0.0.5/strongswan_libs_v5.7.2.zip'
dest "$buildDir/native.zip"
}

Expand Down
8 changes: 8 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ android {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
ndk {
if (project.hasProperty('target-platform') &&
project.property('target-platform') == 'android-arm64') {
abiFilters 'arm64-v8a'
} else {
abiFilters 'armeabi-v7a'
}
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: flutter_vpn
description: Plugin for developers to access VPN service in their flutter app.
version: 0.0.4
author: Jason C.H <[email protected]>
version: 0.0.5
author:
- Jason C.H <[email protected]>
- Jerry
homepage: https://github.com/X-dea/Flutter_VPN

environment:
Expand Down

0 comments on commit 0bb244b

Please sign in to comment.