apple API update
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,3 +25,4 @@ zerotierone
|
||||
|
||||
# Other
|
||||
.depend
|
||||
.buildnum
|
||||
|
||||
7
increment.sh
Executable file
7
increment.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
BUILD_NUMBER_STR=$(cat .buildnum)
|
||||
BUILD_NUMBER=$((BUILD_NUMBER_STR + 1))
|
||||
echo $BUILD_NUMBER > .buildnum
|
||||
echo "#define ZTSDK_BUILD_VERSION " $BUILD_NUMBER > src/SDK_LocalBuild.h
|
||||
echo $BUILD_NUMBER
|
||||
@@ -1375,7 +1375,6 @@
|
||||
"-D__UNITY_3D__",
|
||||
"-DSDK",
|
||||
"-DSDK_DEBUG",
|
||||
"-DUSE_SOCKS_PROXY",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-Unity3D-iOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1400,7 +1399,6 @@
|
||||
OTHER_CFLAGS = (
|
||||
"-D__UNITY_3D__",
|
||||
"-DSDK",
|
||||
"-DUSE_SOCKS_PROXY",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-Unity3D-iOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1434,7 +1432,6 @@
|
||||
"-D__IOS__",
|
||||
"-DLWIP_DEBUG",
|
||||
"-DSDK_BUNDLED",
|
||||
"-DUSE_SOCKS_PROXY",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-iOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1468,7 +1465,6 @@
|
||||
"-DSDK",
|
||||
"-D__IOS__",
|
||||
"-DSDK_BUNDLED",
|
||||
"-DUSE_SOCKS_PROXY",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-iOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1504,7 +1500,6 @@
|
||||
"-DSDK_DEBUG",
|
||||
"-D__XCODE__",
|
||||
"-DLWIP_DEBUG",
|
||||
"-DUSE_SOCKS_PROXY",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-OSX";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1535,7 +1530,6 @@
|
||||
"-DSDK_SERVICE",
|
||||
"-DSDK_BUNDLED",
|
||||
"-D__XCODE__",
|
||||
"-DUSE_SOCKS_PROXY",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-OSX";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -1558,7 +1552,6 @@
|
||||
"-DSDK_DEBUG",
|
||||
"-DSDK",
|
||||
"-D__UNITY_3D__",
|
||||
"-DUSE_SOCKS_PROXY",
|
||||
"-DSDK_BUNDLED",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "zerotier.ZeroTierSDK-Unity3D-OSX";
|
||||
|
||||
@@ -89,6 +89,7 @@ ios_unity3d_bundle:
|
||||
# Build library for Android Unity integrations
|
||||
# Build JNI library for Android app integration
|
||||
android_jni_lib:
|
||||
./increment.sh
|
||||
cd $(INT)/android/android_jni_lib/proj; ./gradlew assembleDebug
|
||||
mkdir -p $(BUILD)/android_jni_lib
|
||||
cp docs/android_zt_sdk.md $(BUILD)/android_jni_lib/README.md
|
||||
@@ -177,4 +178,4 @@ update_docs:
|
||||
cp docs/integrations.md integrations/README.md
|
||||
cp docs/zt_sdk_intro.md README.md
|
||||
cp docs/docker_linux_zt_sdk.md integrations/docker/README.md
|
||||
cp docs/osx_unity3d_zt_sdk.md integrations/Unity3D/README.md
|
||||
cp docs/osx_unity3d_zt_sdk.md integrations/Unity3D/README.md
|
||||
|
||||
@@ -47,7 +47,7 @@ extern "C" {
|
||||
#define INTERCEPT_DISABLED 222
|
||||
|
||||
extern void load_symbols();
|
||||
extern void zt_init_rpc(const char *path, const char *nwid);
|
||||
extern void zts_init_rpc(const char *path, const char *nwid);
|
||||
extern char *api_netpath;
|
||||
extern char *debug_logfile;
|
||||
|
||||
|
||||
1
src/SDK_LocalBuild.h
Normal file
1
src/SDK_LocalBuild.h
Normal file
@@ -0,0 +1 @@
|
||||
#define ZTSDK_BUILD_VERSION 34
|
||||
@@ -71,7 +71,7 @@ extern "C" {
|
||||
|
||||
// Prototypes
|
||||
void *zts_start_service(void *thread_id);
|
||||
void zt_init_rpc(const char * path, const char * nwid);
|
||||
void zts_init_rpc(const char * path, const char * nwid);
|
||||
void dwr(int level, const char *fmt, ... );
|
||||
|
||||
#if defined(__UNITY_3D__)
|
||||
@@ -146,9 +146,9 @@ void zts_join_network(const char * nwid) {
|
||||
if(!ZeroTier::OSUtils::writeFile(confFile.c_str(), "")) {
|
||||
dwr(MSG_ERROR, "unable to write network conf file: %s\n", confFile.c_str());
|
||||
}
|
||||
zt1Service->join(nwid);
|
||||
// Provide the API with the RPC information
|
||||
zt_init_rpc(homeDir.c_str(), nwid);
|
||||
|
||||
zts_init_rpc(homeDir.c_str(), nwid);
|
||||
// SOCKS5 Proxy server
|
||||
// Default is 127.0.0.1:RANDOM_PORT
|
||||
#if defined(USE_SOCKS_PROXY)
|
||||
@@ -345,8 +345,8 @@ char *zts_get_homepath() {
|
||||
void *zts_start_service(void *thread_id) {
|
||||
|
||||
//#ifdef ZTSDK_BUILD_VERSION
|
||||
dwr(MSG_DEBUG, "ZTSDK_BUILD_VERSION = %d", ZTSDK_BUILD_VERSION);
|
||||
LOGV("ZTSDK_BUILD_VERSION = %d", ZTSDK_BUILD_VERSION);
|
||||
dwr(MSG_DEBUG, "ZTSDK_BUILD_VERSION = %d\n", ZTSDK_BUILD_VERSION);
|
||||
LOGV("ZTSDK_BUILD_VERSION = %d\n", ZTSDK_BUILD_VERSION);
|
||||
//#endif
|
||||
|
||||
#if defined(SDK_BUNDLED) && !defined(__ANDROID__)
|
||||
@@ -422,7 +422,7 @@ void *zts_start_service(void *thread_id) {
|
||||
|
||||
// Initialize RPC
|
||||
if(rpcEnabled) {
|
||||
zt_init_rpc(localHomeDir.c_str(), rpcNWID.c_str());
|
||||
zts_init_rpc(localHomeDir.c_str(), rpcNWID.c_str());
|
||||
}
|
||||
|
||||
// Generate random port for new service instance
|
||||
|
||||
@@ -86,7 +86,7 @@ int (*realclose)(CLOSE_SIG);
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
// Assembles (and/or) sets the RPC path for communication with the ZeroTier service
|
||||
void zt_init_rpc(const char *path, const char *nwid)
|
||||
void zts_init_rpc(const char *path, const char *nwid)
|
||||
{
|
||||
// dwr(MSG_DEBUG_EXTRA, "zt_init_rpc\n");
|
||||
#if !defined(__IOS__)
|
||||
@@ -120,7 +120,7 @@ int (*realclose)(CLOSE_SIG);
|
||||
}
|
||||
}
|
||||
|
||||
void get_api_netpath() { zt_init_rpc("",""); }
|
||||
void get_api_netpath() { zts_init_rpc("",""); }
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ------------------------------------ send() ----------------------------------
|
||||
|
||||
@@ -82,8 +82,8 @@ extern "C" void zt_get_proxy_server_address(const char *nwid, struct sockaddr_st
|
||||
// Explicit ZT API wrappers
|
||||
#if !defined(__IOS__)
|
||||
// This isn't available for iOS since function interposition isn't as reliable
|
||||
extern "C" void zts_init_rpc(const char *path, const char *nwid) {
|
||||
zt_init_rpc(path, nwid);
|
||||
extern "C" void zt_init_rpc(const char *path, const char *nwid) {
|
||||
zts_init_rpc(path, nwid);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user