Skip to content

Commit

Permalink
remove jni
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Jan 24, 2024
1 parent ba0d6b6 commit ac4f702
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ android: $(BUILDDIR)/android/tun2socks.aar
$(BUILDDIR)/android/tun2socks.aar: $(GOMOBILE)
mkdir -p "$(BUILDDIR)/android"
$(ANDROID_BUILD_CMD) -o "$@" $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks
unzip "$@" 'jni/*' -d $(BUILDDIR)/android

# TODO(fortuna): -s strips symbols and is obsolete. Why are we using it?
$(BUILDDIR)/ios/Tun2socks.xcframework: $(GOMOBILE)
Expand Down
6 changes: 2 additions & 4 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('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

0 comments on commit ac4f702

Please sign in to comment.