Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
🐛 Fix occasional crashes by preventing to call non existing methods
Browse files Browse the repository at this point in the history
  • Loading branch information
semvis123 committed May 13, 2021
1 parent 423430c commit c68c183
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion Tweak.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@end

@interface AVOutputDevice : NSObject
-(void)setCurrentBluetoothListeningMode:(NSString *)arg1;
-(NSString *)name;
@end

Expand Down
4 changes: 2 additions & 2 deletions sonyfyApp/Tweak.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@end

@interface THMSGV1T1Payload : NSObject
-(id)getByteArray;
-(id)getByteArray;
-(void)restoreFromPayloadWithByteArray: (IOSByteArray *)arg1;
@end

Expand All @@ -24,7 +24,7 @@
-(id)initWithTHMSGV1T1NcAsmParamBase: (THMSGV1T1NcAsmParam *)arg1;
@end

@interface THMMdr
@interface THMMdr: NSObject
-(void)sendCommandWithComSonySongpalTandemfamilyMessageMdrIPayload: (THMSGV1T1SetNcAsmParam *)arg1;
@end

Expand Down
15 changes: 8 additions & 7 deletions sonyfyApp/Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ id setNCObserver;
THMSGV1T1SetNcAsmParam *setNcAsmParam = [[%c(THMSGV1T1SetNcAsmParam) alloc] initWithTHMSGV1T1NcAsmParamBase:ncAsmParam];
[setNcAsmParam restoreFromPayloadWithByteArray:byteArray];

[self sendCommandWithComSonySongpalTandemfamilyMessageMdrIPayload:setNcAsmParam];

[[objc_getClass("NSDistributedNotificationCenter") defaultCenter]
postNotificationName:@"com.semvis123.sonyfy/NCStatus"
object:nil
userInfo: notification.userInfo
deliverImmediately:YES];
if ([self respondsToSelector:@selector(sendCommandWithComSonySongpalTandemfamilyMessageMdrIPayload:)]) {
[self sendCommandWithComSonySongpalTandemfamilyMessageMdrIPayload:setNcAsmParam];
[[objc_getClass("NSDistributedNotificationCenter") defaultCenter]
postNotificationName:@"com.semvis123.sonyfy/NCStatus"
object:nil
userInfo: notification.userInfo
deliverImmediately:YES];
}
}];
}

Expand Down

0 comments on commit c68c183

Please sign in to comment.