ios example app update

This commit is contained in:
Joseph Henry
2016-10-24 16:13:41 -07:00
parent 3a69fe1804
commit 3df5034d5a
4 changed files with 12 additions and 12 deletions

View File

@@ -3,5 +3,5 @@
BUILD_NUMBER_STR=$(cat .buildnum) BUILD_NUMBER_STR=$(cat .buildnum)
BUILD_NUMBER=$((BUILD_NUMBER_STR + 1)) BUILD_NUMBER=$((BUILD_NUMBER_STR + 1))
echo $BUILD_NUMBER > .buildnum echo $BUILD_NUMBER > .buildnum
echo "#define ZTSDK_BUILD_VERSION " $BUILD_NUMBER > src/SDK_LocalBuild.h echo "#define ZTSDK_BUILD_VERSION " $BUILD_NUMBER > src/build.h
echo $BUILD_NUMBER echo $BUILD_NUMBER

View File

@@ -1317,7 +1317,6 @@
"-DSDK_DEBUG", "-DSDK_DEBUG",
"-DSDK", "-DSDK",
"-D__IOS__", "-D__IOS__",
"-DLWIP_DEBUG",
"-DSDK_BUNDLED", "-DSDK_BUNDLED",
"-DUSING_BRIDGING_HEADER", "-DUSING_BRIDGING_HEADER",
"-DSDK_IPV4", "-DSDK_IPV4",

View File

@@ -427,6 +427,15 @@ void *zts_start_core_service(void *thread_id) {
// set_intercept_status(INTERCEPT_DISABLED); // Ignore network calls from ZT service // set_intercept_status(INTERCEPT_DISABLED); // Ignore network calls from ZT service
//#endif //#endif
#if defined(__IOS__)
// Go to the app's data directory so we can shorten the sun_path we bind to
char current_dir[MAX_DIR_SZ];
getcwd(current_dir, MAX_DIR_SZ);
std::string targetDir = homeDir; // + "/../../";
chdir(targetDir.c_str());
homeDir = localHomeDir;
#endif
#if defined(__UNITY_3D__) #if defined(__UNITY_3D__)
char current_dir[MAX_DIR_SZ]; char current_dir[MAX_DIR_SZ];
getcwd(current_dir, MAX_DIR_SZ); getcwd(current_dir, MAX_DIR_SZ);
@@ -467,6 +476,7 @@ void *zts_start_core_service(void *thread_id) {
if ((*pi != ".")&&(*pi != "..")) { if ((*pi != ".")&&(*pi != "..")) {
if (!ZeroTier::OSUtils::mkdir(ptmp)) { if (!ZeroTier::OSUtils::mkdir(ptmp)) {
DEBUG_ERROR("home path does not exist, and could not create"); DEBUG_ERROR("home path does not exist, and could not create");
perror("error\n");
} }
} }
} }
@@ -476,14 +486,7 @@ void *zts_start_core_service(void *thread_id) {
return NULL; return NULL;
} }
#if defined(__IOS__)
// Go to the app's data directory so we can shorten the sun_path we bind to
char current_dir[MAX_DIR_SZ];
getcwd(current_dir, MAX_DIR_SZ);
std::string targetDir = homeDir + "/../../";
chdir(targetDir.c_str());
homeDir = localHomeDir;
#endif
//chdir(current_dir); // Return to previous current working directory (at the request of Unity3D) //chdir(current_dir); // Return to previous current working directory (at the request of Unity3D)
#if defined(__UNITY_3D__) #if defined(__UNITY_3D__)

View File

@@ -695,8 +695,6 @@ NetconEthernetTap::NetconEthernetTap(
// SIP-0 // SIP-0
// Load and initialize network stack library // Load and initialize network stack library
#if defined(SDK_LWIP) #if defined(SDK_LWIP)
DEBUG_INFO("Did I get here?");
Utils::snprintf(stackPath,sizeof(stackPath),"%s%sliblwip.so",homePath,ZT_PATH_SEPARATOR_S); Utils::snprintf(stackPath,sizeof(stackPath),"%s%sliblwip.so",homePath,ZT_PATH_SEPARATOR_S);
lwipstack = new lwIP_stack(stackPath); lwipstack = new lwIP_stack(stackPath);
if(!lwipstack) { if(!lwipstack) {