From df585ffab72ae51f91fd6d54ed51468bea966833 Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Tue, 19 Mar 2024 12:47:59 +0530 Subject: [PATCH 1/6] Fix build --- .github/workflows/main.yml | 4 ++-- tinyphone/baseapp.cpp | 9 +++++++++ tinyphone/utils.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1e9700..c1f2f5b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,7 +81,7 @@ jobs: tinyphone_osx_job: name: Build Tinyphone macOS - runs-on: macos-11 + runs-on: macos-13 steps: - name: Checkout uses: actions/checkout@v3 @@ -140,7 +140,7 @@ jobs: #boost pushd tinyphone-osx/vendor/boost - ./boost.sh -macos --boost-version 1.74.0 + ./boost.sh -macos --boost-version 1.84.0 popd #stastd diff --git a/tinyphone/baseapp.cpp b/tinyphone/baseapp.cpp index 8f5eaeb..36d4e81 100644 --- a/tinyphone/baseapp.cpp +++ b/tinyphone/baseapp.cpp @@ -21,6 +21,15 @@ using namespace std; using namespace pj; +/** + * @file baseapp.cpp + * @brief Implementation of the base application functionality for TinyPhone. + * + * This file contains the implementation of the base application functionality for TinyPhone. + * It includes functions for initializing the PJSUA endpoint, starting and stopping the application, + * and retrieving the phone object. + */ + #define MAX_DNS_SERVERS 4 inline void pj_logerror(pj_status_t status, char * message) { diff --git a/tinyphone/utils.h b/tinyphone/utils.h index ea3e44d..d0f1e06 100644 --- a/tinyphone/utils.h +++ b/tinyphone/utils.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "consts.h" From ed0d2935b49982ca0446a27d4b33c0b2aa6d80ca Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Tue, 19 Mar 2024 12:50:34 +0530 Subject: [PATCH 2/6] Update project.pbxproj --- tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj b/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj index 8274720..89c1d3c 100644 --- a/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj +++ b/tinyphone-osx/Tinyphone.xcodeproj/project.pbxproj @@ -294,6 +294,7 @@ B3DDA55125515DF700D269C9 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1110; LastUpgradeCheck = 1320; ORGANIZATIONNAME = "Kinshuk Bairagi"; @@ -630,7 +631,7 @@ /usr/local/lib, ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = "36.0.0.84"; + MARKETING_VERSION = 36.0.0.84; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "-DBOOST_SYSTEM_DYN_LINK", @@ -682,7 +683,7 @@ /usr/local/lib, ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = "36.0.0.84"; + MARKETING_VERSION = 36.0.0.84; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "-DBOOST_SYSTEM_DYN_LINK", From ced99140c682b023415dbbe2e96f2dacf0ebb979 Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Tue, 19 Mar 2024 12:50:44 +0530 Subject: [PATCH 3/6] Update Tinyphone.xcscheme --- .../xcshareddata/xcschemes/Tinyphone.xcscheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyphone-osx/Tinyphone.xcodeproj/xcshareddata/xcschemes/Tinyphone.xcscheme b/tinyphone-osx/Tinyphone.xcodeproj/xcshareddata/xcschemes/Tinyphone.xcscheme index bdd8aa6..1fb10c6 100644 --- a/tinyphone-osx/Tinyphone.xcodeproj/xcshareddata/xcschemes/Tinyphone.xcscheme +++ b/tinyphone-osx/Tinyphone.xcodeproj/xcshareddata/xcschemes/Tinyphone.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 19 Mar 2024 12:56:22 +0530 Subject: [PATCH 4/6] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1f2f5b..b3a4624 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -105,8 +105,8 @@ jobs: KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH - #echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH + #echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH # create temporary keychain security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH From d4f83898113de9eab2f985a48461760cd6bcbbf1 Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Tue, 19 Mar 2024 13:08:45 +0530 Subject: [PATCH 5/6] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3a4624..ab7bc3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,7 +128,7 @@ jobs: shell: bash run : | export HOMEBREW_NO_INSTALL_CLEANUP=true - brew install autoconf automake libtool tree wget opencore-amr + brew install autoconf automake libtool opencore-amr wget https://gist.githubusercontent.com/kingster/1954ead3c38a40cac88c5c1311bb39c5/raw/343da2c7a2a52ee5a1c03902cc5e44ed83b1dd5d/cryptopp.rb brew install --build-from-source -f cryptopp.rb npm install -g appdmg From c6d7a83ef561ba94561a25c0c65d49d41948294c Mon Sep 17 00:00:00 2001 From: Kinshuk Bairagi Date: Tue, 19 Mar 2024 16:54:58 +0530 Subject: [PATCH 6/6] Move OSx config file to Application Support dir Move osx local config file to ~/Library/Application Support/com.github.voiceip.tphone/ --- tinyphone-osx/src/Tinyphone-C-Interface.h | 2 ++ tinyphone-osx/src/Tinyphone-OC.mm | 7 +++++++ tinyphone-osx/src/osxapp.cpp | 2 +- tinyphone/config.cpp | 4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tinyphone-osx/src/Tinyphone-C-Interface.h b/tinyphone-osx/src/Tinyphone-C-Interface.h index 508e07b..d9c4583 100644 --- a/tinyphone-osx/src/Tinyphone-C-Interface.h +++ b/tinyphone-osx/src/Tinyphone-C-Interface.h @@ -19,6 +19,8 @@ const char* GetOSXProductVersion(); const char* GetResourceFilePath(const char * name); +const char* GetAppSupportFilePath(const char * name); + const char* GetLogsDirectory(); #endif /* Tinyphone_C_Interface_h */ diff --git a/tinyphone-osx/src/Tinyphone-OC.mm b/tinyphone-osx/src/Tinyphone-OC.mm index a64947c..25d2390 100644 --- a/tinyphone-osx/src/Tinyphone-OC.mm +++ b/tinyphone-osx/src/Tinyphone-OC.mm @@ -62,6 +62,13 @@ void ShowOSXAlert(const char *dataPayload, bool blocking) { return [myInstance GetProductVersion]; } +const char* GetAppSupportFilePath(const char * name){ + NSString* file = @(name); + NSString* basePath = @(GetAppSupportDirectory()); + NSString* finalPath = [basePath stringByAppendingPathComponent:file]; + return [finalPath UTF8String];; +} + const char* GetResourceFilePath(const char * name){ CFURLRef appUrlRef = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("config.json"), NULL, NULL); if (appUrlRef != nullptr){ diff --git a/tinyphone-osx/src/osxapp.cpp b/tinyphone-osx/src/osxapp.cpp index 91037a6..97d981c 100644 --- a/tinyphone-osx/src/osxapp.cpp +++ b/tinyphone-osx/src/osxapp.cpp @@ -57,7 +57,7 @@ struct UIAccountInfoArray Accounts(){ acc.active = account->getInfo().regIsActive; accounts.push_back(acc); } - arrInfo.count = accounts.size(); + arrInfo.count = (int) accounts.size(); if (accounts.size() < 10 ) { std::copy(accounts.begin(), accounts.end(), arrInfo.accounts); } diff --git a/tinyphone/config.cpp b/tinyphone/config.cpp index cfd7056..a599fe3 100644 --- a/tinyphone/config.cpp +++ b/tinyphone/config.cpp @@ -109,7 +109,9 @@ namespace tp { #ifdef ALLOW_OFFLINE_CONFIG std::string local_file_path = LOCAL_CONFIG_FILE; #ifdef __APPLE__ - auto apple_config_file = GetResourceFilePath(local_file_path.c_str()); + auto apple_config_file = GetAppSupportFilePath(local_file_path.c_str()); + std::cout << "Checking if Local File Exists " << apple_config_file << std::endl; + if(apple_config_file != nullptr){ std::string lp(apple_config_file); local_file_path.swap(lp);