build(nc-native-android): fix script build paths

This commit is contained in:
pierre
2023-05-30 13:40:52 +02:00
parent 096a599673
commit 5f35d54fcb
4 changed files with 10 additions and 11 deletions
@@ -22,11 +22,6 @@ class NymProxy {
}
}
/* fun start() {
Log.d(tag, "calling $nymNativeLib:startClient")
return startClient()
} */
fun stop(callback: Any) {
Log.d(tag, "calling $nymNativeLib:stopClient")
try {
@@ -134,7 +134,8 @@ class ProxyWorker(
private fun createNotification(): Notification {
val title = applicationContext.getString(R.string.notification_title)
val cancel = applicationContext.getString(R.string.stop_proxy)
val cancel = applicationContext.getString(R.string.notification_action_stop)
val content = applicationContext.getString(R.string.notification_content)
// this pending intent is used to cancel the worker
val stopPendingIntent = WorkManager.getInstance(applicationContext)
.createCancelPendingIntent(id)
@@ -155,8 +156,7 @@ class ProxyWorker(
return NotificationCompat.Builder(applicationContext, channelId)
.setContentTitle(title)
.setTicker(title)
.setContentText("Nym socks5 proxy running")
.setContentText(content)
.setSmallIcon(R.drawable.shield_24)
.setOngoing(true)
.setContentIntent(tapPendingIntent)
@@ -4,7 +4,8 @@
<string name="notification_channel_name">Nym proxy</string>
<string name="notification_channel_id">21</string>
<string name="notification_title">Nym proxy</string>
<string name="stop_proxy">Stop</string>
<string name="notification_content">Connected</string>
<string name="notification_action_stop">Stop</string>
<string name="proxy_host">http://localhost:1080</string>
<string name="sp_url">https://harbourmaster.nymtech.net/v1/services?size=100</string>
<string name="default_sp">DpB3cHAchJiNBQi5FrZx2csXb1mrHkpYh9Wzf8Rjsuko.ANNWrvHqMYuertHGHUrZdBntQhpzfbWekB39qez9U2Vx@2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh</string>
+5 -2
View File
@@ -36,15 +36,18 @@ export TARGET_RANLIB="$TOOLCHAIN/bin/llvm-ranlib"
export CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="$TOOLCHAIN/bin/x86_64-linux-android$API-clang"
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$TOOLCHAIN/bin/aarch64-linux-android$API-clang"
output_dir=../../../target
jni_dir=../../../nym-connect/native/android/app/src/main/jniLibs
build () {
echo -e " $B_YLW$RS building for arch $BLD$1$RS"
export TARGET_CC="$TOOLCHAIN/bin/$1-linux-android$API-clang"
if [ "$RELEASE" = true ]; then
cargo build --lib --target "$1-linux-android" --release
cp "target/$1-linux-android/release/libnym_socks5_listener.so" "../../../nym-connect/native/android/app/src/main/jniLibs/$2/"
mv "$output_dir/$1-linux-android/release/libnym_socks5_listener.so" "$jni_dir/$2/"
else
cargo build --lib --target "$1-linux-android"
cp "target/$1-linux-android/debug/libnym_socks5_listener.so" "../../../nym-connect/native/android/app/src/main/jniLibs/$2/"
mv "$output_dir/$1-linux-android/debug/libnym_socks5_listener.so" "$jni_dir/$2/"
fi
echo -e " $B_GRN$RS lib successfully builded for $BLD$1$RS, moved under app's dir$BLD jniLibs/$2/$RS"
}