Skip to content

Commit

Permalink
chore(cordova/android): use src/tun2socks, not precompiled third_part…
Browse files Browse the repository at this point in the history
…y version (#1816)

* attempt #1

* unzip jni

* fix(electron/windows): build windows on linux (#1818)

* fix(electron/windows): build windows on linux

* use go build when the target and host platforms match [WIP]

* oops

* scope to electron

* revert windows job changes

* lol ai

* fix path

* resolve current platform

* change gradle filepath

* remove jni
  • Loading branch information
daniellacosse authored Jan 25, 2024
1 parent 91f7926 commit 85ce8f8
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/cordova/android/OutlineAndroidLib/outline/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
// To make this project editable directly in the source tree, we need to load
// tun2socks.aar from its original path in the third_party directory. We do
// this by relative path:
compileOnly fileTree(dir: '../../../../../third_party/outline-go-tun2socks/android',
compileOnly fileTree(dir: '../../../../../output/build/android',
include: ['tun2socks.aar'])
// Note: A flatDir repository might be preferable, but this is not compatible
// with a composite build (https://github.com/gradle/gradle/issues/911).
Expand Down
8 changes: 3 additions & 5 deletions src/cordova/plugin/android/scripts/copy_third_party.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@
// limitations under the License.

const fs = require('fs/promises');
// const child_process = require('child_process');
const path = require('node:path');

const ANDROID_LIBS_FOLDER_PATH = path.join('plugins', 'cordova-plugin-outline', 'android', 'libs');
const TUN2SOCKS_ANDROID_FOLDER_PATH = path.join('third_party', 'outline-go-tun2socks', 'android');
const TUN2SOCKS_ANDROID_FOLDER_PATH = path.join('output', 'build', 'android');

module.exports = async function (context) {
module.exports = async function () {
console.log('Copying Android third party libraries...');
await fs.mkdir(ANDROID_LIBS_FOLDER_PATH, {recursive: true});
await fs.copyFile(
path.join(TUN2SOCKS_ANDROID_FOLDER_PATH, 'tun2socks.aar'),
path.join(ANDROID_LIBS_FOLDER_PATH, 'tun2socks.aar')
);
await fs.cp(path.join(TUN2SOCKS_ANDROID_FOLDER_PATH, 'jni'), path.join(ANDROID_LIBS_FOLDER_PATH, 'obj'), {
recursive: true,
});
};
5 changes: 0 additions & 5 deletions src/cordova/plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
<source-file
src="android/libs/tun2socks.aar"
target-dir="app/src/main/libs" />
<!-- These are JNI libraries with debug symbols required for crash reporting tools. -->
<source-file
src="android/libs/obj"
target-dir="app/" />

<resource-file src="android/resources/small_icon.png" target="res/drawable/small_icon.png" />
<resource-file src="android/resources/bypass_subnets.xml" target="res/values/bypass_subnets.xml" />
<resource-file src="android/resources/strings/" target="res/" />
Expand Down
21 changes: 0 additions & 21 deletions third_party/outline-go-tun2socks/LICENSE

This file was deleted.

11 changes: 0 additions & 11 deletions third_party/outline-go-tun2socks/METADATA

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 85ce8f8

Please sign in to comment.