diff --git a/.github/workflows/develop-push.yml b/.github/workflows/develop-push.yml index b88e0a5692..19f1cf75a6 100644 --- a/.github/workflows/develop-push.yml +++ b/.github/workflows/develop-push.yml @@ -16,7 +16,7 @@ jobs: # The type of runner that the job will run on runs-on: ['ARM64', 'self-hosted'] env: - APP_NAME: "Monal" + APP_NAME: "Monal.alpha" APP_DIR: "Monal.alpha.app" BUILD_TYPE: "Alpha" ALPHA_UPLOAD_SECRET: ${{ secrets.ALPHA_UPLOAD_SECRET }} @@ -61,26 +61,26 @@ jobs: - name: Uploading to alpha site run: ./scripts/uploadAlpha.sh - name: Notarize catalyst - run: xcrun notarytool submit ./Monal/build/app/Monal.zip --wait --team-id S8D843U34Y --key "/Users/ci/appstoreconnect/apiKey.p8" --key-id "$(cat /Users/ci/appstoreconnect/apiKeyId.txt)" --issuer "$(cat /Users/ci/appstoreconnect/apiIssuerId.txt)" + run: xcrun notarytool submit ./Monal/build/app/Monal.alpha.zip --wait --team-id S8D843U34Y --key "/Users/ci/appstoreconnect/apiKey.p8" --key-id "$(cat /Users/ci/appstoreconnect/apiKeyId.txt)" --issuer "$(cat /Users/ci/appstoreconnect/apiIssuerId.txt)" - name: Update monal homebrew alpha repo run: scripts/updateAlphaHomebrew.sh - - uses: actions/upload-artifact@v3 - with: - name: monal-catalyst - path: Monal/build/app/Monal.tar - if-no-files-found: error - - uses: actions/upload-artifact@v3 - with: - name: monal-ios - path: Monal/build/ipa/Monal.ipa - if-no-files-found: error - - uses: actions/upload-artifact@v3 - with: - name: monal-catalyst-dsym - path: Monal/build/macos_Monal.xcarchive/dSYMs - if-no-files-found: error - - uses: actions/upload-artifact@v3 - with: - name: monal-ios-dsym - path: Monal/build/ios_Monal.xcarchive/dSYMs - if-no-files-found: error + #- uses: actions/upload-artifact@v3 + # with: + # name: monal-catalyst + # path: "Monal/build/app/Monal.alpha.tar" + # if-no-files-found: error + #- uses: actions/upload-artifact@v3 + # with: + # name: monal-ios + # path: "Monal/build/ipa/Monal.alpha.ipa" + # if-no-files-found: error + #- uses: actions/upload-artifact@v3 + # with: + # name: monal-catalyst-dsym + # path: Monal/build/macos_Monal.xcarchive/dSYMs + # if-no-files-found: error + #- uses: actions/upload-artifact@v3 + # with: + # name: monal-ios-dsym + # path: Monal/build/ios_Monal.xcarchive/dSYMs + # if-no-files-found: error diff --git a/Monal/Classes/AccountPicker.swift b/Monal/Classes/AccountPicker.swift index cdcfe7afe0..f2c2520e59 100644 --- a/Monal/Classes/AccountPicker.swift +++ b/Monal/Classes/AccountPicker.swift @@ -15,6 +15,8 @@ struct AccountPicker: View { let callType: MLCallType #if IS_ALPHA let appLogoId = "AlphaAppLogo" +#elseif IS_QUICKSY + let appLogoId = "QuicksyAppLogo" #else let appLogoId = "AppLogo" #endif diff --git a/Monal/Classes/DataLayer.m b/Monal/Classes/DataLayer.m index b5050b0bee..5ef936ab45 100644 --- a/Monal/Classes/DataLayer.m +++ b/Monal/Classes/DataLayer.m @@ -1449,9 +1449,9 @@ -(void) autodeleteAllMessagesAfter3Days //delete all chats with empty history from active chats list [self.db executeNonQuery:@"DELETE FROM activechats AS AC WHERE NOT EXISTS (SELECT account_id FROM message_history AS MH WHERE MH.account_id=AC.account_id AND MH.buddy_name=AC.buddy_name);"]; [self.db executeNonQuery:@"PRAGMA secure_delete=off;"]; - //vacuum db after delete - [self.db vacuum]; }]; + //vacuum db after delete (must be done outside of transactions) + [self.db vacuum]; } -(void) deleteMessageHistory:(NSNumber*) messageNo diff --git a/Monal/Classes/MLConstants.h b/Monal/Classes/MLConstants.h index 6a1b6cd8e0..717cd64dce 100644 --- a/Monal/Classes/MLConstants.h +++ b/Monal/Classes/MLConstants.h @@ -28,6 +28,11 @@ static const DDLogLevel ddLogLevel = LOG_LEVEL_STDOUT; #define kMonalOpenURL [NSURL URLWithString:@"monalAlphaOpen://"] #define kBackgroundProcessingTask @"im.monal.alpha.process" #define kBackgroundRefreshingTask @"im.monal.alpha.refresh" +#elif defined(IS_QUICKSY) + #define kAppGroup @"group.quicksy" + #define kMonalOpenURL [NSURL URLWithString:@"quicksyOpen://"] + #define kBackgroundProcessingTask @"im.monal.process" + #define kBackgroundRefreshingTask @"im.monal.refresh" #else #define kAppGroup @"group.monal" #define kMonalOpenURL [NSURL URLWithString:@"monalOpen://"] diff --git a/Monal/Classes/MLOMEMO.m b/Monal/Classes/MLOMEMO.m index 4c19e4a64a..c0c8de1604 100644 --- a/Monal/Classes/MLOMEMO.m +++ b/Monal/Classes/MLOMEMO.m @@ -437,11 +437,10 @@ -(void) processOMEMODevices:(NSSet*) receivedDevices from:(NSString*) -(void) handleOwnDevicelistUpdate:(NSSet*) receivedDevices { //check for new deviceids not previously known, but only if the devicelist is not empty - if([self.ownDeviceList count] > 0) - { - NSMutableSet* newDevices = [receivedDevices mutableCopy]; - [newDevices minusSet:self.ownDeviceList]; - for(NSNumber* device in newDevices) + NSMutableSet* newDevices = [receivedDevices mutableCopy]; + [newDevices minusSet:self.ownDeviceList]; + for(NSNumber* device in newDevices) + if([device unsignedIntValue] != self.monalSignalStore.deviceid) { DDLogWarn(@"Got new deviceid %@ for own account %@", device, self.account.connectionProperties.identity.jid); UNMutableNotificationContent* content = [UNMutableNotificationContent new]; @@ -455,7 +454,6 @@ -(void) handleOwnDevicelistUpdate:(NSSet*) receivedDevices if(error) DDLogError(@"Error posting new deviceid notification: %@", error); } - } //update own devicelist (this can be an empty list, if the list on our server is empty) self.ownDeviceList = [receivedDevices mutableCopy]; diff --git a/Monal/Classes/MLPubSub.m b/Monal/Classes/MLPubSub.m index 5d8a0874f6..a280833ea8 100644 --- a/Monal/Classes/MLPubSub.m +++ b/Monal/Classes/MLPubSub.m @@ -319,7 +319,7 @@ -(void) retractItemWithId:(NSString*) itemId onNode:(NSString*) node andHandler: MLXMLNode* item = [[MLXMLNode alloc] initWithElement:@"item" withAttributes:@{@"id": itemId} andChildren:@[] andData:nil]; XMPPIQ* query = [[XMPPIQ alloc] initWithType:kiqSetType]; [query addChildNode:[[MLXMLNode alloc] initWithElement:@"pubsub" andNamespace:@"http://jabber.org/protocol/pubsub" withAttributes:@{} andChildren:@[ - [[MLXMLNode alloc] initWithElement:@"retract" withAttributes:@{@"node": node} andChildren:@[item] andData:nil] + [[MLXMLNode alloc] initWithElement:@"retract" withAttributes:@{@"node": node, @"notify": @"true"} andChildren:@[item] andData:nil] ] andData:nil]]; [account sendIq:query withHandler:$newHandlerWithInvalidation(self, handleRetractResult, handleRetractResultInvalidation, $ID(node), diff --git a/Monal/Classes/MLSQLite.m b/Monal/Classes/MLSQLite.m index a53f110f2b..1ae83ef847 100644 --- a/Monal/Classes/MLSQLite.m +++ b/Monal/Classes/MLSQLite.m @@ -621,6 +621,10 @@ -(NSNumber*) lastInsertId -(void) enableWAL { + NSMutableDictionary* threadData = [[NSThread currentThread] threadDictionary]; + MLAssert([threadData[@"_sqliteTransactionsRunning"][_dbFile] intValue] == 0, @"Could not enable wal, inside transaction!", (@{ + @"threadDictionary": threadData + })); NSString* mode = [self internalExecuteScalar:@"PRAGMA journal_mode;" andArguments:@[]]; if([mode isEqualToString:@"wal"]) return; @@ -636,16 +640,30 @@ -(void) enableWAL -(void) checkpointWal { - NSArray* result = [self executeReader:@"PRAGMA wal_checkpoint(TRUNCATE);"]; - DDLogInfo(@"Chekpointing returned: %@", result); + NSMutableDictionary* threadData = [[NSThread currentThread] threadDictionary]; + //being inside a transaction is non-fatal, the db file will just not be up to date then + if([threadData[@"_sqliteTransactionsRunning"][_dbFile] intValue] == 0) + { + NSArray* result = [self executeReader:@"PRAGMA wal_checkpoint(TRUNCATE);"]; + DDLogInfo(@"Chekpointing returned: %@", result); + } + else + DDLogError(@"Could not checkpoint wal, inside transaction: %@", threadData); } // optimize db -(void) vacuum { + //trying to vaccum the db inside a transaction is non-fatal, the db file will just not be shrinked then DDLogDebug(@"Vacuum DB"); - [self executeNonQuery:@"VACUUM;" andArguments:@[] withException:YES]; - DDLogDebug(@"Vacuum DB success"); + NSMutableDictionary* threadData = [[NSThread currentThread] threadDictionary]; + if([threadData[@"_sqliteTransactionsRunning"][_dbFile] intValue] == 0) + { + [self executeNonQuery:@"VACUUM;" andArguments:@[] withException:YES]; + DDLogDebug(@"Vacuum DB success"); + } + else + DDLogError(@"Could not vaccum db, inside transaction: %@", threadData); } @end diff --git a/Monal/Classes/MLVoIPProcessor.m b/Monal/Classes/MLVoIPProcessor.m index d85f96583a..bcdf8e7a63 100644 --- a/Monal/Classes/MLVoIPProcessor.m +++ b/Monal/Classes/MLVoIPProcessor.m @@ -80,7 +80,11 @@ -(id) init config.supportsVideo = YES; config.includesCallsInRecents = YES; //see https://stackoverflow.com/a/45823730/3528174 +#ifndef QUICKSY config.iconTemplateImageData = UIImagePNGRepresentation([UIImage imageNamed:@"CallKitLogo"]); +#else + config.iconTemplateImageData = UIImagePNGRepresentation([UIImage imageNamed:@"QuicksyCallKitLogo"]); +#endif self.cxProvider = [[CXProvider alloc] initWithConfiguration:config]; [self.cxProvider setDelegate:self queue:dispatch_get_main_queue()]; self.callController = [[CXCallController alloc] initWithQueue:dispatch_get_main_queue()]; diff --git a/Monal/Classes/PasswordMigration.swift b/Monal/Classes/PasswordMigration.swift index 20c9216f00..f090ca344c 100644 --- a/Monal/Classes/PasswordMigration.swift +++ b/Monal/Classes/PasswordMigration.swift @@ -11,6 +11,8 @@ struct PasswordMigration: View { @State var needingMigration: [Int:[String:NSObject]] #if IS_ALPHA let appLogoId = "AlphaAppLogo" +#elseif IS_QUICKSY + let appLogoId = "QuicksyAppLogo" #else let appLogoId = "AppLogo" #endif diff --git a/Monal/Classes/SCRAM.m b/Monal/Classes/SCRAM.m index 3a2682e20a..0ce10f4bf2 100644 --- a/Monal/Classes/SCRAM.m +++ b/Monal/Classes/SCRAM.m @@ -86,7 +86,8 @@ -(NSString*) clientFirstMessageWithChannelBinding:(NSString* _Nullable) channelB _gssHeader = @"y,,"; //supported by us BUT NOT advertised by the server else _gssHeader = [NSString stringWithFormat:@"p=%@,,", channelBindingType]; //supported by us AND advertised by the server - _clientFirstMessageBare = [NSString stringWithFormat:@"n=%@,r=%@", [self quote:_username], _nonce]; + //the g attribute is a random grease to check if servers are rfc compliant (e.g. accept optional attributes) + _clientFirstMessageBare = [NSString stringWithFormat:@"n=%@,r=%@,g=%@", [self quote:_username], _nonce, [NSUUID UUID].UUIDString]; return [NSString stringWithFormat:@"%@%@", _gssHeader, _clientFirstMessageBare]; } @@ -138,7 +139,8 @@ -(NSString*) clientFinalMessageWithChannelBindingData:(NSData* _Nullable) channe NSData* storedKey = [self hash:clientKey]; //calculate authMessage (e.g. client-first-message-bare + "," + server-first-message + "," + client-final-message-without-proof) - NSString* clientFinalMessageWithoutProof = [NSString stringWithFormat:@"c=%@,r=%@", [HelperTools encodeBase64WithData:gssHeaderWithChannelBindingData], _nonce]; + //the x attribute is a random grease to check if servers are rfc compliant (e.g. accept optional attributes) + NSString* clientFinalMessageWithoutProof = [NSString stringWithFormat:@"c=%@,r=%@,x=%@", [HelperTools encodeBase64WithData:gssHeaderWithChannelBindingData], _nonce, [NSUUID UUID].UUIDString]; NSString* authMessage = [NSString stringWithFormat:@"%@,%@,%@", _clientFirstMessageBare, _serverFirstMessage, clientFinalMessageWithoutProof]; //calculate clientSignature (e.g. HMAC(StoredKey, AuthMessage)) diff --git a/Monal/Classes/WelcomeLogIn.swift b/Monal/Classes/WelcomeLogIn.swift index ee9d4d357b..e1d68f2585 100644 --- a/Monal/Classes/WelcomeLogIn.swift +++ b/Monal/Classes/WelcomeLogIn.swift @@ -31,6 +31,8 @@ struct WelcomeLogIn: View { #if IS_ALPHA let appLogoId = "AlphaAppLogo" +#elseif IS_QUICKSY + let appLogoId = "QuicksyAppLogo" #else let appLogoId = "AppLogo" #endif diff --git a/Monal/Classes/XMPPIQ.m b/Monal/Classes/XMPPIQ.m index da7938c483..49b0436885 100644 --- a/Monal/Classes/XMPPIQ.m +++ b/Monal/Classes/XMPPIQ.m @@ -69,12 +69,16 @@ -(void) setPushEnableWithNode:(NSString*) node onAppserver:(NSString*) jid #ifdef IS_ALPHA [pushModule appendString:@"monalAlpha"]; #else //IS_ALPHA -#if TARGET_OS_MACCATALYST +#if TARGET_OS_MACCATALYST && defined(IS_QUICKSY) + [pushModule appendString:@"quicksyProdCatalyst"]; +#elif TARGET_OS_MACCATALYST [pushModule appendString:@"monalProdCatalyst"]; -#else //TARGET_OS_MACCATALYST +#elif defined(IS_QUICKSY) + [pushModule appendString:@"quicksyProdiOS"]; +#else [pushModule appendString:@"monalProdiOS"]; -#endif //NOT TARGET_OS_MACCATALYST -#endif //NOT IS_ALPHA +#endif +#endif if([[HelperTools defaultsDB] boolForKey:@"isSandboxAPNS"]) { diff --git a/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Contents.json b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..feff128c9f --- /dev/null +++ b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Contents.json @@ -0,0 +1,32 @@ +{ + "images" : [ + { + "filename" : "Quicksy-ios-1024.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "filename" : "Quicksy-macos-512.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "filename" : "Quicksy-macos-512.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "filename" : "Quicksy-macos-1024.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-ios-1024.png b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-ios-1024.png new file mode 100644 index 0000000000..7239ddd968 Binary files /dev/null and b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-ios-1024.png differ diff --git a/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-macos-1024.png b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-macos-1024.png new file mode 100644 index 0000000000..7239ddd968 Binary files /dev/null and b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-macos-1024.png differ diff --git a/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-macos-512.png b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-macos-512.png new file mode 100644 index 0000000000..fc0f54445d Binary files /dev/null and b/Monal/Images.xcassets/QuicksyAppIcon.appiconset/Quicksy-macos-512.png differ diff --git a/Monal/Images.xcassets/QuicksyAppLogo.imageset/Contents.json b/Monal/Images.xcassets/QuicksyAppLogo.imageset/Contents.json new file mode 100644 index 0000000000..9af007e622 --- /dev/null +++ b/Monal/Images.xcassets/QuicksyAppLogo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Quicksy-ios-1024.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Monal/Images.xcassets/QuicksyAppLogo.imageset/Quicksy-ios-1024.png b/Monal/Images.xcassets/QuicksyAppLogo.imageset/Quicksy-ios-1024.png new file mode 100644 index 0000000000..7239ddd968 Binary files /dev/null and b/Monal/Images.xcassets/QuicksyAppLogo.imageset/Quicksy-ios-1024.png differ diff --git a/Monal/Images.xcassets/QuicksyCallKitLogo.imageset/Contents.json b/Monal/Images.xcassets/QuicksyCallKitLogo.imageset/Contents.json new file mode 100644 index 0000000000..53ac8b4ec2 --- /dev/null +++ b/Monal/Images.xcassets/QuicksyCallKitLogo.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "callkit_logo.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Monal/Images.xcassets/QuicksyCallKitLogo.imageset/callkit_logo.png b/Monal/Images.xcassets/QuicksyCallKitLogo.imageset/callkit_logo.png new file mode 100644 index 0000000000..bb4f00da26 Binary files /dev/null and b/Monal/Images.xcassets/QuicksyCallKitLogo.imageset/callkit_logo.png differ diff --git a/Monal/Monal-Info.plist b/Monal/Monal-Info.plist index 4bda9713d4..b426877650 100644 --- a/Monal/Monal-Info.plist +++ b/Monal/Monal-Info.plist @@ -95,6 +95,8 @@ SBUsesNetwork + SRResearchDataGeneration + UIBackgroundModes audio @@ -146,7 +148,5 @@ - SRResearchDataGeneration - diff --git a/Monal/Monal-iOS/Launch Screen.storyboard b/Monal/Monal-iOS/Launch Screen.storyboard index 0398ef4ad6..26ec0ecd94 100644 --- a/Monal/Monal-iOS/Launch Screen.storyboard +++ b/Monal/Monal-iOS/Launch Screen.storyboard @@ -1,9 +1,9 @@ - + - + @@ -19,7 +19,7 @@ -