diff --git a/docs/ios_zt_sdk.md b/docs/ios_zt_sdk.md index cb0cbe2..3bedab6 100644 --- a/docs/ios_zt_sdk.md +++ b/docs/ios_zt_sdk.md @@ -22,7 +22,7 @@ In this example we aim to set up a minimal XCode project which contains all of t - Add `build/ios_app_framework/Release-iphoneos/` to *Build Settings -> Framework Search Paths* - Add `ZeroTierSDK.frameworkiOS` to *General->Embedded Binaries* - Add `src/SDK_XcodeWrapper.cpp` and `src/SDK_XcodeWrapper.hpp` to your project: -- Add contents of `src/SDK_Apple-Bridging-Header.h` to your project’s bridging header. +- Set `src/SDK_Apple-Bridging-Header.h` as your bridging-header in `Build Settings -> Objective-C Bridging-header` **Step 3: Start the ZeroTier service** diff --git a/docs/osx_zt_sdk.md b/docs/osx_zt_sdk.md index 8cc11cf..2308082 100644 --- a/docs/osx_zt_sdk.md +++ b/docs/osx_zt_sdk.md @@ -46,7 +46,7 @@ Run application - Add `build/osx_app_framework/Release-iphoneos/` to *Build Settings -> Framework Search Paths* - Add `ZeroTierSDK.frameworkiOS` to *General->Embedded Binaries* - Add `src/SDK_XcodeWrapper.cpp` and `src/SDK_XcodeWrapper.hpp` to your project: -- Add contents of `src/SDK_Apple-Bridging-Header.h` to your project’s bridging header. +- Set `src/SDK_Apple-Bridging-Header.h` as your bridging-header in `Build Settings -> Objective-C Bridging-header` **Step 3: Start the ZeroTier service** diff --git a/integrations/android/android_jni_lib/java/jni/Application.mk b/integrations/android/android_jni_lib/java/jni/Application.mk index 32099d4..8a212b8 100644 --- a/integrations/android/android_jni_lib/java/jni/Application.mk +++ b/integrations/android/android_jni_lib/java/jni/Application.mk @@ -5,10 +5,10 @@ APP_CFLAGS := -g -DSDK_BUNDLED APP_PLATFORM := android-14 # Architectures -APP_ABI := all +# APP_ABI := all #APP_ABI += arm64-v8a -#APP_ABI += armeabi +APP_ABI += armeabi #APP_ABI += armeabi-v7a #APP_ABI += mips #APP_ABI += mips64 diff --git a/integrations/android/example_app/app/src/main/java/com/example/joseph/example_app/MainActivity.java b/integrations/android/example_app/app/src/main/java/com/example/joseph/example_app/MainActivity.java index 1a499cb..1390c25 100644 --- a/integrations/android/example_app/app/src/main/java/com/example/joseph/example_app/MainActivity.java +++ b/integrations/android/example_app/app/src/main/java/com/example/joseph/example_app/MainActivity.java @@ -44,14 +44,7 @@ public class MainActivity extends AppCompatActivity { }, 10000); */ - try - { - Thread.sleep(1000); - } - catch(java.lang.InterruptedException e) - { - } // Create ZeroTier socket @@ -65,10 +58,19 @@ public class MainActivity extends AppCompatActivity { //int port = 8080; //SocketAddress sockaddr = new InetSocketAddress(addr, port); + try + { + Thread.sleep(15000); + } + catch(java.lang.InterruptedException e) + { + + } + // Connect to remote host - //Log.d("","ztjniConnect()\n"); - //int err = zt.ztjniConnect(sock, "10.144.211.245", 8080); - //Log.d("", "ztjniConnect() = " + err + "\n"); + Log.d("","ztjniConnect()\n"); + int err = zt.ztjniConnect(sock, "10.9.9.203", 8080); + Log.d("", "ztjniConnect() = " + err + "\n"); // Set up example proxy connection to SDK proxy server /* diff --git a/integrations/android/example_app/app/src/main/jniLibs/README.md b/integrations/android/example_app/app/src/main/jniLibs/README.md index c911508..c0c5624 100644 --- a/integrations/android/example_app/app/src/main/jniLibs/README.md +++ b/integrations/android/example_app/app/src/main/jniLibs/README.md @@ -9,7 +9,7 @@ This short tutorial will show you how to enable ZeroTier functionality for your In this example we aim to set up a minimal [Android Studio](https://developer.android.com/studio/index.html) project which contains all of the components necessary to enable ZeroTier for your app. If you'd rather skip all of these steps and grab the code, look in the [sdk/android](https://github.com/zerotier/ZeroTierOne/tree/dev/sdk/integrations/android/example_app) folder in the source tree. Otherwise, let's get started! -*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) the [Android NDK](https://developer.android.com/ndk/index.html), and you'll need to tell our project where you put it by putting the path in [this file](Android/proj/local.properties), you'll need to install the Android Build-Tools (this can typically be done through the editor the first time you start it up), and finally you should probably upgrade your Gradle plugin if it asks you to. If you don't have these things installed and configured we will detect that and just skip those builds automatically.* +*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) the [Android NDK](https://developer.android.com/ndk/index.html). Currently only Android NDK r10e is supported and can be found [here for OSX](http://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip) and [here for Linux](http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip). You'll need to tell our project where you put it by putting the path in [this file](Android/proj/local.properties), you'll need to install the Android Build-Tools (this can typically be done through the editor the first time you start it up), and finally you should probably upgrade your Gradle plugin if it asks you to. If you don't have these things installed and configured we will detect that and just skip those builds automatically.* **Step 1: Select build targets** - Specify the target architectures you want to build in [Application.mk](android/java/jni/Application.mk). By default it will build `arm64-v8a`, `armeabi`, `armeabi-v7a`, `mips`, `mips64`, `x86`, and `x86_64`. diff --git a/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj b/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj index 07ce975..b7633d6 100644 --- a/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj +++ b/integrations/apple/ZeroTierSDK_Apple/ZeroTierSDK_Apple.xcodeproj/project.pbxproj @@ -1436,6 +1436,7 @@ "-D__IOS__", "-DLWIP_DEBUG", "-DSDK_BUNDLED", + "-DUSE_SOCKS_PROXY", ); PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1469,6 +1470,7 @@ "-DSDK", "-D__IOS__", "-DSDK_BUNDLED", + "-DUSE_SOCKS_PROXY", ); PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1504,6 +1506,7 @@ "-DSDK_DEBUG", "-D__XCODE__", "-DLWIP_DEBUG", + "-DUSE_SOCKS_PROXY", ); PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-OSX"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1534,6 +1537,7 @@ "-DSDK_SERVICE", "-DSDK_BUNDLED", "-D__XCODE__", + "-DUSE_SOCKS_PROXY", ); PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-OSX"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift b/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift index ae41c57..d138153 100644 --- a/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift +++ b/integrations/apple/example_app/OSX/Example_OSX_App/ViewController.swift @@ -23,7 +23,7 @@ class ViewController: NSViewController { @IBOutlet weak var txtTX: NSTextField! @IBOutlet weak var txtRX: NSTextField! - var serverPort:Int32 = 5658 + var serverPort:Int32 = 8081 var serverAddr:String = "10.9.9.203" var sock:Int32 = -1 @@ -150,11 +150,10 @@ class ViewController: NSViewController { @IBOutlet weak var btnSend: NSButton! @IBAction func UI_SendData(sender: AnyObject) { // Use ordinary read/write calls on ZeroTier socket - // TCP if(selectedProtocol == SOCK_STREAM) { - write(sock, txtTX.description, 4); + write(sock, txtTX.description, txtTX.description.characters.count); } // UDP if(selectedProtocol == SOCK_DGRAM) @@ -228,7 +227,7 @@ class ViewController: NSViewController { var service_thread : NSThread! func ztnc_start_service() { - // If you plan on using SOCKS Proxy + // If you plan on using SOCKS Proxy, you don't need to initialize the RPC //start_service("/Users/Joseph/utest3") // If you plan on using direct calls via RPC diff --git a/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/LaunchScreen.storyboard b/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/LaunchScreen.storyboard index 2e721e1..ebf48f6 100644 --- a/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/LaunchScreen.storyboard +++ b/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -15,7 +16,6 @@ - diff --git a/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/Main.storyboard b/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/Main.storyboard index beac0f4..b2b1fbe 100644 --- a/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/Main.storyboard +++ b/integrations/apple/example_app/iOS/Example_iOS_App/Base.lproj/Main.storyboard @@ -20,6 +20,9 @@ @@ -40,7 +47,7 @@