Compare commits

...
5 changed files with 42 additions and 16 deletions
+8 -8
View File
@@ -23,7 +23,7 @@ extern BOOL castConfirm();
extern BOOL ytMiniPlayer(); extern BOOL ytMiniPlayer();
extern BOOL hidePreviousAndNextButton(); extern BOOL hidePreviousAndNextButton();
extern BOOL hidePaidPromotionCard(); extern BOOL hidePaidPromotionCard();
extern BOOL fixGoogleSigin(); extern BOOL fixGoogleSignIn();
extern BOOL replacePreviousAndNextButton(); extern BOOL replacePreviousAndNextButton();
// Settings // Settings
@@ -62,12 +62,12 @@ extern BOOL replacePreviousAndNextButton();
return YES; return YES;
}; };
YTSettingsSectionItem *fixGoogleSigin = [[%c(YTSettingsSectionItem) alloc] initWithTitle:LOC(@"FIX_GOOGLE_SIGNIN") titleDescription:LOC(@"FIX_GOOGLE_SIGNIN_DESC")]; YTSettingsSectionItem *fixGoogleSignIn = [[%c(YTSettingsSectionItem) alloc] initWithTitle:LOC(@"FIX_GOOGLE_SIGNIN") titleDescription:LOC(@"FIX_GOOGLE_SIGNIN_DESC")];
fixGoogleSigin.hasSwitch = YES; fixGoogleSignIn.hasSwitch = YES;
fixGoogleSigin.switchVisible = YES; fixGoogleSignIn.switchVisible = YES;
fixGoogleSigin.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"fixGoogleSigin_enabled"]; fixGoogleSignIn.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"fixGoogleSignIn_enabled"];
fixGoogleSigin.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) { fixGoogleSignIn.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"fixGoogleSigin_enabled"]; [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"fixGoogleSignIn_enabled"];
return YES; return YES;
}; };
@@ -188,7 +188,7 @@ extern BOOL replacePreviousAndNextButton();
return YES; return YES;
}; };
NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[killApp, autoFull, castConfirm, ytMiniPlayer, fixGoogleSigin, hideAutoplaySwitch, hideCC, hideHUD, hidePaidPromotionCard, hidePreviousAndNextButton, hideHoverCard, bigYTMiniPlayer, oledDarkMode, oledKeyBoard, replacePreviousAndNextButton, reExplore]]; NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[killApp, autoFull, castConfirm, ytMiniPlayer, fixGoogleSignIn, hideAutoplaySwitch, hideCC, hideHUD, hidePaidPromotionCard, hidePreviousAndNextButton, hideHoverCard, bigYTMiniPlayer, oledDarkMode, oledKeyBoard, replacePreviousAndNextButton, reExplore]];
[delegate setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouPlus" titleDescription:nil headerHidden:NO]; [delegate setSectionItems:sectionItems forCategory:uYouPlusSection title:@"uYouPlus" titleDescription:nil headerHidden:NO];
} }
@@ -4,7 +4,7 @@
"REPLACE_PREVIOUS_NEXT_BUTTON_DESC" = "Replace Previous and Next Button with Fast forward and Rewind button. App restart is required."; "REPLACE_PREVIOUS_NEXT_BUTTON_DESC" = "Replace Previous and Next Button with Fast forward and Rewind button. App restart is required.";
"FIX_GOOGLE_SIGNIN" = "Fix Google Sign in (for TrollStore user only)"; "FIX_GOOGLE_SIGNIN" = "Fix Google Sign in (for TrollStore user only)";
"FIX_GOOGLE_SIGNIN_DESC" = "Only works when the app was installed via TrollStore: Turn on this option so you can sign in with your Google account. App restart is required."; "FIX_GOOGLE_SIGNIN_DESC" = "Turn on this option only when you can't sign in with your Google account and the app was installed via TrollStore. If you can log in normally, keep it disabled. App restart is required.";
"KILL_APP" = "Close YouTube"; "KILL_APP" = "Close YouTube";
"KILL_APP_DESC" = "Tap here to close YouTube!"; "KILL_APP_DESC" = "Tap here to close YouTube!";
@@ -16,7 +16,7 @@
"REPLACE_PREVIOUS_NEXT_BUTTON_DESC" = "Replace Previous and Next Button with Fast forward and Rewind button. App restart is required."; "REPLACE_PREVIOUS_NEXT_BUTTON_DESC" = "Replace Previous and Next Button with Fast forward and Rewind button. App restart is required.";
"FIX_GOOGLE_SIGNIN" = "Fix Google Sign in (for TrollStore user only)"; "FIX_GOOGLE_SIGNIN" = "Fix Google Sign in (for TrollStore user only)";
"FIX_GOOGLE_SIGNIN_DESC" = "Only works when the app was installed via TrollStore: Turn on this option so you can sign in with your Google account. App restart is required."; "FIX_GOOGLE_SIGNIN_DESC" = "Turn on this option only when you can't sign in with your Google account and the app was installed via TrollStore. If you can log in normally, keep it disabled. App restart is required.";
"KILL_APP" = "Close YouTube"; "KILL_APP" = "Close YouTube";
"KILL_APP_DESC" = "Tap here to close YouTube!"; "KILL_APP_DESC" = "Tap here to close YouTube!";
@@ -4,7 +4,7 @@
"REPLACE_PREVIOUS_NEXT_BUTTON_DESC" = "Thay thế nút chuyển video bằng nút tua nhanh. Cần khởi động lại ứng dụng."; "REPLACE_PREVIOUS_NEXT_BUTTON_DESC" = "Thay thế nút chuyển video bằng nút tua nhanh. Cần khởi động lại ứng dụng.";
"FIX_GOOGLE_SIGNIN" = "Sửa lỗi không thể đăng nhập tài khoản Google"; "FIX_GOOGLE_SIGNIN" = "Sửa lỗi không thể đăng nhập tài khoản Google";
"FIX_GOOGLE_SIGNIN_DESC" = "Lưu ý rằng tính năng này chỉ hoạt đng khi ứng dụng được cài đặt bằng TrollStore: Bật tính năng này để sửa lỗi không thể đăng nhập bằng tài khoản Google. Cần khởi động lại ứng dụng."; "FIX_GOOGLE_SIGNIN_DESC" = "Chỉ bật tính năng này khi bạn không thể đăng nhập tài khoản Google và ứng dụng được cài qua TrollStore. Nếu bạn có thể đăng nhập bình thường thì hãy tắt tính năng này. Cần khởi động lại ứng dụng.";
"KILL_APP" = "Đóng ứng dụng"; "KILL_APP" = "Đóng ứng dụng";
"KILL_APP_DESC" = "Chạm để đóng YouTube!"; "KILL_APP_DESC" = "Chạm để đóng YouTube!";
+31 -5
View File
@@ -49,6 +49,7 @@ static NSString *accessGroupID() {
return accessGroup; return accessGroup;
} }
//
BOOL hideHUD() { BOOL hideHUD() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
} }
@@ -91,8 +92,8 @@ BOOL ytMiniPlayer() {
BOOL hidePaidPromotionCard() { BOOL hidePaidPromotionCard() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hidePaidPromotionCard_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"hidePaidPromotionCard_enabled"];
} }
BOOL fixGoogleSigin() { BOOL fixGoogleSignIn() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"fixGoogleSigin_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"fixGoogleSignIn_enabled"];
} }
BOOL replacePreviousAndNextButton() { BOOL replacePreviousAndNextButton() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"replacePreviousAndNextButton_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"replacePreviousAndNextButton_enabled"];
@@ -482,9 +483,34 @@ BOOL replacePreviousAndNextButton() {
} }
%end %end
// Fix "Google couldn't confirm this attempt to sign in is safe. If you think this is a mistake, you can close and try again to sign in" - qnblackcat/uYouPlus#420
// Thanks to @AhmedBafkir and @kkirby - https://github.com/qnblackcat/uYouPlus/discussions/447#discussioncomment-3672881
%group gFixGoogleSignIn
%hook SSORPCService
+ (id)URLFromURL:(id)arg1 withAdditionalFragmentParameters:(NSDictionary *)arg2 {
NSURL *orig = %orig;
NSURLComponents *urlComponents = [[NSURLComponents alloc] initWithURL:orig resolvingAgainstBaseURL:NO];
NSMutableArray *newQueryItems = [urlComponents.queryItems mutableCopy];
for (NSURLQueryItem *queryItem in urlComponents.queryItems) {
if ([queryItem.name isEqualToString:@"system_version"]
|| [queryItem.name isEqualToString:@"app_version"]
|| [queryItem.name isEqualToString:@"kdlc"]
|| [queryItem.name isEqualToString:@"kss"]
|| [queryItem.name isEqualToString:@"lib_ver"]
|| [queryItem.name isEqualToString:@"device_model"]) {
[newQueryItems removeObject:queryItem];
}
}
urlComponents.queryItems = [newQueryItems copy];
return urlComponents.URL;
}
%end
%end
// Fix "You can't sign in to this app because Google can't confirm that it's safe" warning when signing in. by julioverne & PoomSmart // Fix "You can't sign in to this app because Google can't confirm that it's safe" warning when signing in. by julioverne & PoomSmart
// https://gist.github.com/PoomSmart/ef5b172fd4c5371764e027bea2613f93 // https://gist.github.com/PoomSmart/ef5b172fd4c5371764e027bea2613f93
// https://github.com/qnblackcat/uYouPlus/pull/398 // https://github.com/qnblackcat/uYouPlus/pull/398
/*
%group gDevice_challenge_request_hack %group gDevice_challenge_request_hack
%hook SSOService %hook SSOService
+ (id)fetcherWithRequest:(NSMutableURLRequest *)request configuration:(id)configuration { + (id)fetcherWithRequest:(NSMutableURLRequest *)request configuration:(id)configuration {
@@ -500,13 +526,13 @@ BOOL replacePreviousAndNextButton() {
} }
%end %end
%end %end
*/
// Fix login for YouTube 17.33.2 and higher // Fix login for YouTube 17.33.2 and higher
%hook SSOKeychainCore %hook SSOKeychainCore
+ (NSString *)accessGroup { + (NSString *)accessGroup {
return accessGroupID(); return accessGroupID();
} }
+ (NSString *)sharedAccessGroup { + (NSString *)sharedAccessGroup {
return accessGroupID(); return accessGroupID();
} }
@@ -896,7 +922,7 @@ static void replaceTab(YTIGuideResponse *response) {
if (@available(iOS 16, *)) { if (@available(iOS 16, *)) {
%init(iOS16); %init(iOS16);
} }
if (!fixGoogleSigin()) { if (!fixGoogleSignIn()) {
%init(gDevice_challenge_request_hack); %init(gFixGoogleSignIn);
} }
} }