Skip to content

Commit

Permalink
Merge branch 'master' into sbruens/catalyst
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens authored Aug 17, 2023
2 parents 30d7b37 + 9875803 commit aa5bbcb
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/cordova/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ The main entrypoint to Android's Java code is `cordova-plugin-outline/android/ja
Additional requirements for Android:

- [Java Development Kit (JDK) 11](https://jdk.java.net/archive/)
- Set `JAVA_HOME` environment variable if you are building on Windows
- Latest [Android Sdk Commandline Tools](https://developer.android.com/studio/command-line) ([download](https://developer.android.com/studio#command-line-tools-only))
- Place it at `$HOME/Android/sdk/cmdline-tools/latest`
- Set `ANDROID_HOME` environment variable
- Android SDK 32 (with build-tools) via commandline `$HOME/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-32" "build-tools;32.0.0"`
- [Gradle 7.3+](https://gradle.org/install/)

Expand Down
21 changes: 13 additions & 8 deletions src/cordova/plugin/android/scripts/copy_third_party.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

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

module.exports = function(context) {
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');

module.exports = async function(context) {
console.log('Copying Android third party libraries...');
child_process.execSync('mkdir -p plugins/cordova-plugin-outline/android/libs');
child_process.execSync(
`cp third_party/outline-go-tun2socks/android/tun2socks.aar plugins/cordova-plugin-outline/android/libs/`
);
child_process.execSync(
`cp -R third_party/outline-go-tun2socks/android/jni plugins/cordova-plugin-outline/android/libs/obj`
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,
});
};
Binary file not shown.
Binary file not shown.
Binary file modified third_party/outline-go-tun2socks/android/jni/x86/libgojni.so
Binary file not shown.
Binary file modified third_party/outline-go-tun2socks/android/jni/x86_64/libgojni.so
Binary file not shown.
Binary file modified third_party/outline-go-tun2socks/android/tun2socks.aar
Binary file not shown.
Binary file modified third_party/outline-go-tun2socks/linux/tun2socks
Binary file not shown.
Binary file modified third_party/outline-go-tun2socks/win32/tun2socks.exe
Binary file not shown.

0 comments on commit aa5bbcb

Please sign in to comment.