Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.1.1 #1001

Merged
merged 9 commits into from
Feb 7, 2024
Merged

6.1.1 #1001

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions .github/workflows/develop-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions Monal/Classes/AccountPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Monal/Classes/DataLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Monal/Classes/MLConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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://"]
Expand Down
10 changes: 4 additions & 6 deletions Monal/Classes/MLOMEMO.m
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,10 @@ -(void) processOMEMODevices:(NSSet<NSNumber*>*) receivedDevices from:(NSString*)
-(void) handleOwnDevicelistUpdate:(NSSet<NSNumber*>*) receivedDevices
{
//check for new deviceids not previously known, but only if the devicelist is not empty
if([self.ownDeviceList count] > 0)
{
NSMutableSet<NSNumber*>* newDevices = [receivedDevices mutableCopy];
[newDevices minusSet:self.ownDeviceList];
for(NSNumber* device in newDevices)
NSMutableSet<NSNumber*>* 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];
Expand All @@ -455,7 +454,6 @@ -(void) handleOwnDevicelistUpdate:(NSSet<NSNumber*>*) 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];
Expand Down
2 changes: 1 addition & 1 deletion Monal/Classes/MLPubSub.m
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
26 changes: 22 additions & 4 deletions Monal/Classes/MLSQLite.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
4 changes: 4 additions & 0 deletions Monal/Classes/MLVoIPProcessor.m
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
Expand Down
2 changes: 2 additions & 0 deletions Monal/Classes/PasswordMigration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions Monal/Classes/SCRAM.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions Monal/Classes/WelcomeLogIn.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ struct WelcomeLogIn: View {

#if IS_ALPHA
let appLogoId = "AlphaAppLogo"
#elseif IS_QUICKSY
let appLogoId = "QuicksyAppLogo"
#else
let appLogoId = "AppLogo"
#endif
Expand Down
12 changes: 8 additions & 4 deletions Monal/Classes/XMPPIQ.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
{
Expand Down
32 changes: 32 additions & 0 deletions Monal/Images.xcassets/QuicksyAppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Monal/Images.xcassets/QuicksyAppLogo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Monal/Images.xcassets/QuicksyCallKitLogo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Monal/Monal-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
</array>
<key>SBUsesNetwork</key>
<true/>
<key>SRResearchDataGeneration</key>
<false/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
Expand Down Expand Up @@ -146,7 +148,5 @@
</dict>
</dict>
</array>
<key>SRResearchDataGeneration</key>
<false/>
</dict>
</plist>
6 changes: 3 additions & 3 deletions Monal/Monal-iOS/Launch Screen.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina5_9" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -19,7 +19,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2023 monal-im.org. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2024 monal-im.org. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="20" y="771" width="335" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
Expand Down
Loading
Loading