Skip to content

Commit

Permalink
Merge pull request #353 from Darock-Studio/dev/pribypass
Browse files Browse the repository at this point in the history
fix: private api invalid binary
  • Loading branch information
Mark Chan authored Apr 19, 2024
2 parents ea5670e + ae18b42 commit b4fb011
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
36 changes: 18 additions & 18 deletions DarockBili.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariExtension/Info.plist;
Expand Down Expand Up @@ -1672,7 +1672,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariExtension/Info.plist;
Expand Down Expand Up @@ -1769,7 +1769,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBiliAlternative.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B38QUJMY47;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1814,7 +1814,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\"";
DEVELOPMENT_TEAM = B38QUJMY47;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1854,7 +1854,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -1890,7 +1890,7 @@
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -1919,7 +1919,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand All @@ -1943,7 +1943,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_TEAM = B38QUJMY47;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariExtension/Info.plist;
Expand Down Expand Up @@ -2010,7 +2010,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2045,7 +2045,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Vision App.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2082,7 +2082,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2129,7 +2129,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MeowBili/MeowBili.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2174,7 +2174,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2210,7 +2210,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIconWatch;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview\\ Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -2250,7 +2250,7 @@
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -2283,7 +2283,7 @@
CODE_SIGN_ENTITLEMENTS = "MeowBili/MeowBili Mac App.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_ASSET_PATHS = "\"MeowBili/Preview Content\"";
DEVELOPMENT_TEAM = B57D8PP775;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -2312,7 +2312,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand All @@ -2335,7 +2335,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1175;
CURRENT_PROJECT_VERSION = 1183;
DEVELOPMENT_TEAM = B57D8PP775;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand Down
5 changes: 0 additions & 5 deletions MeowBili/Others/CCodes/PrivateSymbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
@property (nonatomic, class, readonly) NSBundle *private;
@end

@interface _UIAssetManager : NSObject
+ (instancetype)assetManagerForBundle:(NSBundle *)bundle;
- (UIImage *)imageNamed:(NSString *)name;
@end

@interface UIImage (SFSCoreGlyphsBundle)

- (instancetype)initWithPrivateSystemName:(NSString *)name;
Expand Down
7 changes: 5 additions & 2 deletions MeowBili/Others/CCodes/PrivateSymbols.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@
//===----------------------------------------------------------------------===//

#import <Foundation/Foundation.h>
#import <dlfcn.h>
#import "PrivateSymbols.h"

@implementation UIImage (SFCoreGlyphBundle)

- (instancetype)initWithPrivateSystemName:(NSString *)name {
NSBundle *const bundle = [NSClassFromString(@"SFSCoreGlyphsBundle") private];
_UIAssetManager *const assetManager = [_UIAssetManager assetManagerForBundle:bundle];
self = [[assetManager imageNamed:name] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
Class UIAssetManager_Class = NSClassFromString(@"_UIAssetManager");
NSObject *assetManager = [UIAssetManager_Class performSelector:NSSelectorFromString(@"assetManagerForBundle:") withObject:bundle];
UIImage *image = [assetManager performSelector:NSSelectorFromString(@"imageNamed:") withObject:name];
self = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
return self;
}

Expand Down

0 comments on commit b4fb011

Please sign in to comment.