mirror of
				https://github.com/SoPat712/YTLitePlus.git
				synced 2025-10-30 20:34:03 -04:00 
			
		
		
		
	Added sideloading fix #14
This commit is contained in:
		| @@ -14,6 +14,25 @@ NSBundle *YTLitePlusBundle() { | |||||||
| } | } | ||||||
| NSBundle *tweakBundle = YTLitePlusBundle(); | NSBundle *tweakBundle = YTLitePlusBundle(); | ||||||
|  |  | ||||||
|  | // Keychain fix | ||||||
|  | static NSString *accessGroupID() { | ||||||
|  |     NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys: | ||||||
|  |                            (__bridge NSString *)kSecClassGenericPassword, (__bridge NSString *)kSecClass, | ||||||
|  |                            @"bundleSeedID", kSecAttrAccount, | ||||||
|  |                            @"", kSecAttrService, | ||||||
|  |                            (id)kCFBooleanTrue, kSecReturnAttributes, | ||||||
|  |                            nil]; | ||||||
|  |     CFDictionaryRef result = nil; | ||||||
|  |     OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result); | ||||||
|  |     if (status == errSecItemNotFound) | ||||||
|  |         status = SecItemAdd((__bridge CFDictionaryRef)query, (CFTypeRef *)&result); | ||||||
|  |         if (status != errSecSuccess) | ||||||
|  |             return nil; | ||||||
|  |     NSString *accessGroup = [(__bridge NSDictionary *)result objectForKey:(__bridge NSString *)kSecAttrAccessGroup]; | ||||||
|  |  | ||||||
|  |     return accessGroup; | ||||||
|  | } | ||||||
|  |  | ||||||
| // | // | ||||||
| static BOOL IsEnabled(NSString *key) { | static BOOL IsEnabled(NSString *key) { | ||||||
|     return [[NSUserDefaults standardUserDefaults] boolForKey:key]; |     return [[NSUserDefaults standardUserDefaults] boolForKey:key]; | ||||||
| @@ -258,6 +277,39 @@ static BOOL IsEnabled(NSString *key) { | |||||||
| %hook YTYouThereController | %hook YTYouThereController | ||||||
| - (BOOL)shouldShowYouTherePrompt { return NO; } | - (BOOL)shouldShowYouTherePrompt { return NO; } | ||||||
| %end | %end | ||||||
|  | // Fix login for YouTube 18.13.2 and higher | ||||||
|  | %hook SSOKeychainHelper | ||||||
|  | + (NSString *)accessGroup { | ||||||
|  |     return accessGroupID(); | ||||||
|  | } | ||||||
|  | + (NSString *)sharedAccessGroup { | ||||||
|  |     return accessGroupID(); | ||||||
|  | } | ||||||
|  | %end | ||||||
|  |  | ||||||
|  | // Fix login for YouTube 17.33.2 and higher - @BandarHL | ||||||
|  | // https://gist.github.com/BandarHL/492d50de46875f9ac7a056aad084ac10 | ||||||
|  | %hook SSOKeychainCore | ||||||
|  | + (NSString *)accessGroup { | ||||||
|  |     return accessGroupID(); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | + (NSString *)sharedAccessGroup { | ||||||
|  |     return accessGroupID(); | ||||||
|  | } | ||||||
|  | %end | ||||||
|  |  | ||||||
|  | // Fix App Group Directory by move it to document directory | ||||||
|  | %hook NSFileManager | ||||||
|  | - (NSURL *)containerURLForSecurityApplicationGroupIdentifier:(NSString *)groupIdentifier { | ||||||
|  |     if (groupIdentifier != nil) { | ||||||
|  |         NSArray *paths = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask]; | ||||||
|  |         NSURL *documentsURL = [paths lastObject]; | ||||||
|  |         return [documentsURL URLByAppendingPathComponent:@"AppGroup"]; | ||||||
|  |     } | ||||||
|  |     return %orig(groupIdentifier); | ||||||
|  | } | ||||||
|  | %end | ||||||
|  |  | ||||||
| // YTNOCheckLocalNetWork - https://poomsmart.github.io/repo/depictions/ytnochecklocalnetwork.html | // YTNOCheckLocalNetWork - https://poomsmart.github.io/repo/depictions/ytnochecklocalnetwork.html | ||||||
| %hook YTHotConfig | %hook YTHotConfig | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Balackburn
					Balackburn