updated android readme
This commit is contained in:
@@ -9,21 +9,21 @@ 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/netcon/Android) folder in the source tree. Otherwise, let's get started!
|
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/netcon/Android) folder in the source tree. Otherwise, let's get started!
|
||||||
|
|
||||||
**Step 1: Build Shared Library `libZeroTierOneJNI.so`**
|
*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) and 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), if you don't have these things installed and configured we will detect that and just skip those builds automatically.*
|
||||||
|
|
||||||
Open `zerotiersdk/integrations/Android/proj` and build it.
|
**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`.
|
||||||
|
|
||||||
*Note: Building the project will take a while if you are building for all architectures, See note below on how to speed up this process.*
|
**Step 2: Build Shared Library**
|
||||||
|
- `make android_jni_lib`
|
||||||
|
- The resultant `build/android_jni_lib_*/libZeroTierOneJNI.so` will be what you want to import for your own project to provide the API to your app. Select your architecture and copy the shared library into `YourProject/src/main/jniLibs/YOUR_ARCH/`
|
||||||
|
|
||||||
The resultant `zerotiersdk/integrations/Android/java/libs/YOUR_ARCH/libZeroTierOneJNI.so` will be what you want to import for your own project to provide the shim interface to your app. Select your architecture and copy the shared library into `YourProject/src/main/jniLibs/YOUR_ARCH/`
|
**Step 3: App Code Modifications**
|
||||||
|
- Create new package called `ZeroTierSDK` in your project and add a new file called `ZeroTierSDK.java` containing:
|
||||||
**Step 2: App Code Modifications**
|
|
||||||
|
|
||||||
Create new package called `Netcon` in your project and add a new file called `NetconWrapper.java` containing:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
package Netcon;
|
package ZeroTierSDK;
|
||||||
public class NetconWrapper {
|
public class ZeroTierSDK_Wrapper {
|
||||||
public native void startOneService();
|
public native void startOneService();
|
||||||
static { System.loadLibrary("ZeroTierOneJNI”); } // Loads JNI code
|
static { System.loadLibrary("ZeroTierOneJNI”); } // Loads JNI code
|
||||||
}
|
}
|
||||||
@@ -33,17 +33,15 @@ And now, start the service:
|
|||||||
```
|
```
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
NetconWrapper wrapper = new NetconWrapper();
|
ZeroTierSDK_Wrapper wrapper = new ZeroTierSDK_Wrapper();
|
||||||
wrapper.startOneService(); // Calls to JNI code
|
wrapper.startOneService(); // Calls to JNI code
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
```
|
```
|
||||||
**Step 3: Pick a shim for your app**
|
**Step 4: Pick an API for your app**
|
||||||
|
|
||||||
If functional interposition isn't available for the API or library you've chosen to use, ZeroTier offers a SOCKS5 proxy server which can allow connectivity to your virtual network as long as your client API supports the SOCKS5 protocol. This proxy service will run alongside the tap service and can be turned on by compiling with the `-DUSE_SOCKS_PROXY` flag. By default, the proxy service is available at `0.0.0.0:1337`.
|
If functional interposition isn't available for the API or library you've chosen to use, ZeroTier offers a SOCKS5 proxy server which can allow connectivity to your virtual network as long as your client API supports the SOCKS5 protocol. This proxy service will run alongside the tap service and can be turned on by compiling with the `-DUSE_SOCKS_PROXY` flag. By default, the proxy service is available at `0.0.0.0:1337`.
|
||||||
|
|
||||||
**Step 4: Add necessary app permissions**
|
**Step 5: Add necessary app permissions**
|
||||||
|
|
||||||
In order for your application to write the auth keys to the internal storage you'll need to set a few permissions in your `AndroidManifest.xml` file:
|
In order for your application to write the auth keys to the internal storage you'll need to set a few permissions in your `AndroidManifest.xml` file:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -51,13 +49,11 @@ In order for your application to write the auth keys to the internal storage you
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
```
|
```
|
||||||
|
|
||||||
**Step 5: Join a network!**
|
**Step 6: Join a network!**
|
||||||
|
|
||||||
Simply call `zt_join_network("XXXXXXXXXXXXXXXX")`
|
Simply call `zt_join_network("XXXXXXXXXXXXXXXX")`
|
||||||
|
|
||||||
***
|
***
|
||||||
**Additional notes**
|
**Additional notes**
|
||||||
|
|
||||||
As mentioned above, you can reduce the amount of time required to build the ZeroTier JNI library by only building for the architectures you want. You can specify the architectures in `zerotiersdk/integrations/Android/java/jni/Application.mk`
|
|
||||||
|
|
||||||
If you change the method/class/package name for the Netcon glue code in `NetconWrapper.java` (Not recommended!), you must also change the name of the JNI implementation in the Netcon source to match the new java name. For example, if the glue code is contained in a package `Java.com.example.joseph.NetconProxyTest`, a JNI implementation name of `Java_com_example_joseph_netconproxytest_NetconWrapper_startOneService` would be required in the appropriate C/C++ source/header files.
|
If you change the method/class/package name for the Netcon glue code in `NetconWrapper.java` (Not recommended!), you must also change the name of the JNI implementation in the Netcon source to match the new java name. For example, if the glue code is contained in a package `Java.com.example.joseph.NetconProxyTest`, a JNI implementation name of `Java_com_example_joseph_netconproxytest_NetconWrapper_startOneService` would be required in the appropriate C/C++ source/header files.
|
||||||
Binary file not shown.
@@ -56,8 +56,6 @@
|
|||||||
7CC003DC1D121833003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
7CC003DC1D121833003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
||||||
7CC003DD1D121833003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
7CC003DD1D121833003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
||||||
7CC003DE1D121833003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
7CC003DE1D121833003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
||||||
7CC003DF1D121833003E68DC /* PortMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D61D121833003E68DC /* PortMapper.cpp */; };
|
|
||||||
7CC003E01D121833003E68DC /* RoutingTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D81D121833003E68DC /* RoutingTable.cpp */; };
|
|
||||||
7CC0041F1D121840003E68DC /* C25519.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003E61D121840003E68DC /* C25519.cpp */; };
|
7CC0041F1D121840003E68DC /* C25519.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003E61D121840003E68DC /* C25519.cpp */; };
|
||||||
7CC004201D121840003E68DC /* CertificateOfMembership.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003E81D121840003E68DC /* CertificateOfMembership.cpp */; };
|
7CC004201D121840003E68DC /* CertificateOfMembership.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003E81D121840003E68DC /* CertificateOfMembership.cpp */; };
|
||||||
7CC004211D121840003E68DC /* Cluster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003EA1D121840003E68DC /* Cluster.cpp */; };
|
7CC004211D121840003E68DC /* Cluster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003EA1D121840003E68DC /* Cluster.cpp */; };
|
||||||
@@ -119,7 +117,6 @@
|
|||||||
7CC0045D1D1316F5003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
7CC0045D1D1316F5003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
||||||
7CC0045E1D1316F5003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
7CC0045E1D1316F5003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
||||||
7CC0045F1D1316F5003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
7CC0045F1D1316F5003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
||||||
7CC004601D1316F5003E68DC /* PortMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D61D121833003E68DC /* PortMapper.cpp */; };
|
|
||||||
7CC004621D131704003E68DC /* etharp.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039D1D1217F2003E68DC /* etharp.c */; };
|
7CC004621D131704003E68DC /* etharp.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039D1D1217F2003E68DC /* etharp.c */; };
|
||||||
7CC004631D131704003E68DC /* ethernetif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039E1D1217F2003E68DC /* ethernetif.c */; };
|
7CC004631D131704003E68DC /* ethernetif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039E1D1217F2003E68DC /* ethernetif.c */; };
|
||||||
7CC004641D131704003E68DC /* slipif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039F1D1217F2003E68DC /* slipif.c */; };
|
7CC004641D131704003E68DC /* slipif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039F1D1217F2003E68DC /* slipif.c */; };
|
||||||
@@ -193,8 +190,6 @@
|
|||||||
7CC004A81D131E21003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
7CC004A81D131E21003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
||||||
7CC004A91D131E21003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
7CC004A91D131E21003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
||||||
7CC004AA1D131E21003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
7CC004AA1D131E21003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
||||||
7CC004AB1D131E21003E68DC /* PortMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D61D121833003E68DC /* PortMapper.cpp */; };
|
|
||||||
7CC004AC1D131E21003E68DC /* RoutingTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D81D121833003E68DC /* RoutingTable.cpp */; };
|
|
||||||
7CC004AD1D131E2D003E68DC /* etharp.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039D1D1217F2003E68DC /* etharp.c */; };
|
7CC004AD1D131E2D003E68DC /* etharp.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039D1D1217F2003E68DC /* etharp.c */; };
|
||||||
7CC004AE1D131E2D003E68DC /* ethernetif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039E1D1217F2003E68DC /* ethernetif.c */; };
|
7CC004AE1D131E2D003E68DC /* ethernetif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039E1D1217F2003E68DC /* ethernetif.c */; };
|
||||||
7CC004AF1D131E2D003E68DC /* slipif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039F1D1217F2003E68DC /* slipif.c */; };
|
7CC004AF1D131E2D003E68DC /* slipif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039F1D1217F2003E68DC /* slipif.c */; };
|
||||||
@@ -268,8 +263,6 @@
|
|||||||
7CC004F81D1324A2003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
7CC004F81D1324A2003E68DC /* BackgroundResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003CE1D121833003E68DC /* BackgroundResolver.cpp */; };
|
||||||
7CC004F91D1324A2003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
7CC004F91D1324A2003E68DC /* Http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D11D121833003E68DC /* Http.cpp */; };
|
||||||
7CC004FA1D1324A2003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
7CC004FA1D1324A2003E68DC /* OSUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D31D121833003E68DC /* OSUtils.cpp */; };
|
||||||
7CC004FB1D1324A2003E68DC /* PortMapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D61D121833003E68DC /* PortMapper.cpp */; };
|
|
||||||
7CC004FC1D1324A2003E68DC /* RoutingTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC003D81D121833003E68DC /* RoutingTable.cpp */; };
|
|
||||||
7CC004FD1D1324AB003E68DC /* etharp.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039D1D1217F2003E68DC /* etharp.c */; };
|
7CC004FD1D1324AB003E68DC /* etharp.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039D1D1217F2003E68DC /* etharp.c */; };
|
||||||
7CC004FE1D1324AB003E68DC /* ethernetif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039E1D1217F2003E68DC /* ethernetif.c */; };
|
7CC004FE1D1324AB003E68DC /* ethernetif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039E1D1217F2003E68DC /* ethernetif.c */; };
|
||||||
7CC004FF1D1324AB003E68DC /* slipif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039F1D1217F2003E68DC /* slipif.c */; };
|
7CC004FF1D1324AB003E68DC /* slipif.c in Sources */ = {isa = PBXBuildFile; fileRef = 7CC0039F1D1217F2003E68DC /* slipif.c */; };
|
||||||
@@ -994,7 +987,6 @@
|
|||||||
7CC003681D1217C3003E68DC /* netbuf.c in Sources */,
|
7CC003681D1217C3003E68DC /* netbuf.c in Sources */,
|
||||||
7CC0036B1D1217C3003E68DC /* sockets.c in Sources */,
|
7CC0036B1D1217C3003E68DC /* sockets.c in Sources */,
|
||||||
7CC0038B1D1217D1003E68DC /* timers.c in Sources */,
|
7CC0038B1D1217D1003E68DC /* timers.c in Sources */,
|
||||||
7CC003DF1D121833003E68DC /* PortMapper.cpp in Sources */,
|
|
||||||
7CC0039C1D1217DD003E68DC /* ip.c in Sources */,
|
7CC0039C1D1217DD003E68DC /* ip.c in Sources */,
|
||||||
7CC004251D121840003E68DC /* IncomingPacket.cpp in Sources */,
|
7CC004251D121840003E68DC /* IncomingPacket.cpp in Sources */,
|
||||||
7CC003DC1D121833003E68DC /* BackgroundResolver.cpp in Sources */,
|
7CC003DC1D121833003E68DC /* BackgroundResolver.cpp in Sources */,
|
||||||
@@ -1036,7 +1028,6 @@
|
|||||||
7CC004271D121840003E68DC /* Multicaster.cpp in Sources */,
|
7CC004271D121840003E68DC /* Multicaster.cpp in Sources */,
|
||||||
7CC003521D12178D003E68DC /* SDK_Intercept.c in Sources */,
|
7CC003521D12178D003E68DC /* SDK_Intercept.c in Sources */,
|
||||||
7CC004281D121840003E68DC /* Network.cpp in Sources */,
|
7CC004281D121840003E68DC /* Network.cpp in Sources */,
|
||||||
7CC003E01D121833003E68DC /* RoutingTable.cpp in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -1110,7 +1101,6 @@
|
|||||||
7CC0045D1D1316F5003E68DC /* BackgroundResolver.cpp in Sources */,
|
7CC0045D1D1316F5003E68DC /* BackgroundResolver.cpp in Sources */,
|
||||||
7CC0045E1D1316F5003E68DC /* Http.cpp in Sources */,
|
7CC0045E1D1316F5003E68DC /* Http.cpp in Sources */,
|
||||||
7CC0045F1D1316F5003E68DC /* OSUtils.cpp in Sources */,
|
7CC0045F1D1316F5003E68DC /* OSUtils.cpp in Sources */,
|
||||||
7CC004601D1316F5003E68DC /* PortMapper.cpp in Sources */,
|
|
||||||
7CC0043C1D1316BF003E68DC /* SDK_Debug.c in Sources */,
|
7CC0043C1D1316BF003E68DC /* SDK_Debug.c in Sources */,
|
||||||
7CC0043D1D1316BF003E68DC /* SDK_EthernetTap.cpp in Sources */,
|
7CC0043D1D1316BF003E68DC /* SDK_EthernetTap.cpp in Sources */,
|
||||||
7CC0043E1D1316BF003E68DC /* SDK_Intercept.c in Sources */,
|
7CC0043E1D1316BF003E68DC /* SDK_Intercept.c in Sources */,
|
||||||
@@ -1198,8 +1188,6 @@
|
|||||||
7CC004A81D131E21003E68DC /* BackgroundResolver.cpp in Sources */,
|
7CC004A81D131E21003E68DC /* BackgroundResolver.cpp in Sources */,
|
||||||
7CC004A91D131E21003E68DC /* Http.cpp in Sources */,
|
7CC004A91D131E21003E68DC /* Http.cpp in Sources */,
|
||||||
7CC004AA1D131E21003E68DC /* OSUtils.cpp in Sources */,
|
7CC004AA1D131E21003E68DC /* OSUtils.cpp in Sources */,
|
||||||
7CC004AB1D131E21003E68DC /* PortMapper.cpp in Sources */,
|
|
||||||
7CC004AC1D131E21003E68DC /* RoutingTable.cpp in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -1273,8 +1261,6 @@
|
|||||||
7CC004F81D1324A2003E68DC /* BackgroundResolver.cpp in Sources */,
|
7CC004F81D1324A2003E68DC /* BackgroundResolver.cpp in Sources */,
|
||||||
7CC004F91D1324A2003E68DC /* Http.cpp in Sources */,
|
7CC004F91D1324A2003E68DC /* Http.cpp in Sources */,
|
||||||
7CC004FA1D1324A2003E68DC /* OSUtils.cpp in Sources */,
|
7CC004FA1D1324A2003E68DC /* OSUtils.cpp in Sources */,
|
||||||
7CC004FB1D1324A2003E68DC /* PortMapper.cpp in Sources */,
|
|
||||||
7CC004FC1D1324A2003E68DC /* RoutingTable.cpp in Sources */,
|
|
||||||
7CC004D71D13247A003E68DC /* SDK_Debug.c in Sources */,
|
7CC004D71D13247A003E68DC /* SDK_Debug.c in Sources */,
|
||||||
7CC004D81D13247A003E68DC /* SDK_EthernetTap.cpp in Sources */,
|
7CC004D81D13247A003E68DC /* SDK_EthernetTap.cpp in Sources */,
|
||||||
7CC004D91D13247A003E68DC /* SDK_Intercept.c in Sources */,
|
7CC004D91D13247A003E68DC /* SDK_Intercept.c in Sources */,
|
||||||
@@ -1380,6 +1366,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
HEADER_SEARCH_PATHS = (
|
HEADER_SEARCH_PATHS = (
|
||||||
"$(SRCROOT)/../../../zerotierone",
|
"$(SRCROOT)/../../../zerotierone",
|
||||||
"$(SRCROOT)/../../../ext/lwip/src/include/",
|
"$(SRCROOT)/../../../ext/lwip/src/include/",
|
||||||
@@ -1404,6 +1391,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
HEADER_SEARCH_PATHS = (
|
HEADER_SEARCH_PATHS = (
|
||||||
"$(SRCROOT)/../../../zerotierone",
|
"$(SRCROOT)/../../../zerotierone",
|
||||||
"$(SRCROOT)/../../../ext/lwip/src/include/",
|
"$(SRCROOT)/../../../ext/lwip/src/include/",
|
||||||
|
|||||||
Binary file not shown.
@@ -5,7 +5,7 @@ If you want everything built at once, type `make all` and go play outside for a
|
|||||||
|
|
||||||
*NOTE for Apple platforms: In order to build iOS/OSX Frameworks and Bundles you will need XCode command line tools `xcode-select --install`*
|
*NOTE for Apple platforms: In order to build iOS/OSX Frameworks and Bundles you will need XCode command line tools `xcode-select --install`*
|
||||||
|
|
||||||
*NOTE for Android: for Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) and 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), if you don't have these things installed and configured we will detect that and just skip those builds automatically. Additionally, you can 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`*
|
*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) and 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), if you don't have these things installed and configured we will detect that and just skip those builds automatically. Additionally, you can 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`*
|
||||||
|
|
||||||
Below are the specific instructions for each integration requiring *little to no modification to your code*. Remember, with a full build we'll put a copy of the appropriate integration instructions in the resultant binary's folder for you anyway.
|
Below are the specific instructions for each integration requiring *little to no modification to your code*. Remember, with a full build we'll put a copy of the appropriate integration instructions in the resultant binary's folder for you anyway.
|
||||||
|
|
||||||
|
|||||||
@@ -38,11 +38,6 @@ LDLIBS?=
|
|||||||
|
|
||||||
include objects.mk
|
include objects.mk
|
||||||
|
|
||||||
ifeq ($(ZT_OFFICIAL_RELEASE),1)
|
|
||||||
DEFS+=-DZT_OFFICIAL_RELEASE
|
|
||||||
ZT_USE_MINIUPNPC=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ZT_DEBUG),1)
|
ifeq ($(ZT_DEBUG),1)
|
||||||
DEFS+=-DZT_TRACE
|
DEFS+=-DZT_TRACE
|
||||||
CFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
CFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
||||||
|
|||||||
12
make-mac.mk
12
make-mac.mk
@@ -50,24 +50,31 @@ endif
|
|||||||
|
|
||||||
CXXFLAGS=$(CFLAGS) -fno-rtti
|
CXXFLAGS=$(CFLAGS) -fno-rtti
|
||||||
|
|
||||||
all:
|
all: osx_app_framework ios_app_framework osx_unity3d_bundle ios_unity3d_bundle android_jni_lib osx_shared_lib
|
||||||
|
|
||||||
# TODO: CHECK if XCODE TOOLS are installed
|
# TODO: CHECK if XCODE TOOLS are installed
|
||||||
# Build frameworks for application development
|
# Build frameworks for application development
|
||||||
osx_app_framework:
|
osx_app_framework:
|
||||||
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_OSX build SYMROOT="../../../build/osx_app_framework"
|
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_OSX build SYMROOT="../../../build/osx_app_framework"
|
||||||
|
cp docs/osx_zt_sdk.md build/osx_app_framework/README.md
|
||||||
ios_app_framework:
|
ios_app_framework:
|
||||||
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_iOS build SYMROOT="../../../build/ios_app_framework"
|
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_iOS build SYMROOT="../../../build/ios_app_framework"
|
||||||
|
cp docs/ios_zt_sdk.md build/ios_app_framework/README.md
|
||||||
# Build bundles for Unity integrations
|
# Build bundles for Unity integrations
|
||||||
osx_unity3d_bundle:
|
osx_unity3d_bundle:
|
||||||
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_Unity3D_OSX build SYMROOT="../../../build/osx_unity3d_bundle"
|
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_Unity3D_OSX build SYMROOT="../../../build/osx_unity3d_bundle"
|
||||||
|
cp docs/osx_unity3d_zt_sdk.md build/osx_unity3d_bundle/README.md
|
||||||
ios_unity3d_bundle:
|
ios_unity3d_bundle:
|
||||||
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_Unity3D_iOS build SYMROOT="../../../build/ios_unity3d_bundle"
|
cd integrations/apple/ZeroTierSDK_Apple; xcodebuild -scheme ZeroTierSDK_Unity3D_iOS build SYMROOT="../../../build/ios_unity3d_bundle"
|
||||||
|
cp docs/ios_unity3d_zt_sdk.md build/ios_unity3d_bundle/README.md
|
||||||
# TODO: CHECK if ANDROID/GRADLE TOOLS are installed
|
# TODO: CHECK if ANDROID/GRADLE TOOLS are installed
|
||||||
# Build library for Android Unity integrations
|
# Build library for Android Unity integrations
|
||||||
# Build JNI library for Android app integration
|
# Build JNI library for Android app integration
|
||||||
android_jni_library:
|
android_jni_lib:
|
||||||
cd integrations/android/proj; ./gradlew assembleDebug
|
cd integrations/android/proj; ./gradlew assembleDebug
|
||||||
|
# cd integrations/android/java/libs/; for f in *; do mv "$f" "android_jni_lib_$f"; done
|
||||||
|
mv integrations/android/java/libs/* build
|
||||||
|
cp docs/android_zt_sdk.md build/README.md
|
||||||
|
|
||||||
osx_shared_lib: $(OBJS)
|
osx_shared_lib: $(OBJS)
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
@@ -81,6 +88,7 @@ osx_shared_lib: $(OBJS)
|
|||||||
cp src/libztintercept.so build/osx_shared_lib/libztintercept.so
|
cp src/libztintercept.so build/osx_shared_lib/libztintercept.so
|
||||||
ln -sf zerotier-sdk-service zerotier-cli
|
ln -sf zerotier-sdk-service zerotier-cli
|
||||||
ln -sf zerotier-sdk-service zerotier-idtool
|
ln -sf zerotier-sdk-service zerotier-idtool
|
||||||
|
cp docs/osx_zt_sdk.md build/osx_shared_lib/README.md
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf zerotier-cli zerotier-idtool
|
rm -rf zerotier-cli zerotier-idtool
|
||||||
|
|||||||
Reference in New Issue
Block a user