Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cordova/android): use src/tun2socks, not precompiled third_party version #1816

Merged
merged 7 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading