Merge pull request #618 from Halo-Michael/main

Fix Network for Chinese model
This commit is contained in:
Lars Fröder 2023-11-29 18:30:50 +01:00 committed by GitHub
commit c1f0677c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 20 deletions

View File

@ -7,10 +7,8 @@
static EXPLOIT_TYPE gPlatformVulnerabilities; static EXPLOIT_TYPE gPlatformVulnerabilities;
@interface PSAppDataUsagePolicyCache : NSObject void* _CTServerConnectionCreate(CFAllocatorRef, void *, void *);
+ (instancetype)sharedInstance; int64_t _CTServerConnectionSetCellularUsagePolicy(CFTypeRef* ct, NSString* identifier, NSDictionary* policies);
- (void)setUsagePoliciesForBundle:(NSString*)bundleId cellular:(BOOL)cellular wifi:(BOOL)wifi;
@end
#define POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE 1 #define POSIX_SPAWN_PERSONA_FLAGS_OVERRIDE 1
extern int posix_spawnattr_set_persona_np(const posix_spawnattr_t* __restrict, uid_t, uint32_t); extern int posix_spawnattr_set_persona_np(const posix_spawnattr_t* __restrict, uid_t, uint32_t);
@ -19,14 +17,14 @@ extern int posix_spawnattr_set_persona_gid_np(const posix_spawnattr_t* __restric
void chineseWifiFixup(void) void chineseWifiFixup(void)
{ {
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/SettingsCellular.framework"]; _CTServerConnectionSetCellularUsagePolicy(
[bundle load]; _CTServerConnectionCreate(kCFAllocatorDefault, NULL, NULL),
NSBundle.mainBundle.bundleIdentifier,
PSAppDataUsagePolicyCache* policyCache = [NSClassFromString(@"PSAppDataUsagePolicyCache") sharedInstance]; @{
if([policyCache respondsToSelector:@selector(setUsagePoliciesForBundle:cellular:wifi:)]) @"kCTCellularDataUsagePolicy" : @"kCTCellularDataUsagePolicyAlwaysAllow",
{ @"kCTWiFiDataUsagePolicy" : @"kCTCellularDataUsagePolicyAlwaysAllow"
[policyCache setUsagePoliciesForBundle:NSBundle.mainBundle.bundleIdentifier cellular:true wifi:true]; }
} );
} }
NSString *getExecutablePath(void) NSString *getExecutablePath(void)

View File

@ -19,7 +19,7 @@ include $(THEOS)/makefiles/common.mk
APPLICATION_NAME = TrollStorePersistenceHelper APPLICATION_NAME = TrollStorePersistenceHelper
TrollStorePersistenceHelper_FILES = $(wildcard *.m) $(wildcard ../Shared/*.m) TrollStorePersistenceHelper_FILES = $(wildcard *.m) $(wildcard ../Shared/*.m)
TrollStorePersistenceHelper_FRAMEWORKS = UIKit CoreGraphics CoreServices TrollStorePersistenceHelper_FRAMEWORKS = UIKit CoreGraphics CoreServices CoreTelephony
TrollStorePersistenceHelper_PRIVATE_FRAMEWORKS = Preferences MobileContainerManager TrollStorePersistenceHelper_PRIVATE_FRAMEWORKS = Preferences MobileContainerManager
TrollStorePersistenceHelper_CFLAGS = -fobjc-arc -I../Shared TrollStorePersistenceHelper_CFLAGS = -fobjc-arc -I../Shared

View File

@ -6,10 +6,7 @@
<string>com.opa334.trollstorepersistencehelper</string> <string>com.opa334.trollstorepersistencehelper</string>
<key>com.apple.CommCenter.fine-grained</key> <key>com.apple.CommCenter.fine-grained</key>
<array> <array>
<string>cellular-plan</string>
<string>data-usage</string>
<string>data-allowed-write</string> <string>data-allowed-write</string>
<string>preferences-write</string>
</array> </array>
<key>com.apple.private.persona-mgmt</key> <key>com.apple.private.persona-mgmt</key>
<true/> <true/>

View File

@ -9,7 +9,7 @@ include $(THEOS)/makefiles/common.mk
APPLICATION_NAME = TrollStore APPLICATION_NAME = TrollStore
TrollStore_FILES = $(wildcard *.m) $(wildcard ../Shared/*.m) TrollStore_FILES = $(wildcard *.m) $(wildcard ../Shared/*.m)
TrollStore_FRAMEWORKS = UIKit CoreGraphics CoreServices TrollStore_FRAMEWORKS = UIKit CoreGraphics CoreServices CoreTelephony
TrollStore_PRIVATE_FRAMEWORKS = Preferences MobileIcons MobileContainerManager TrollStore_PRIVATE_FRAMEWORKS = Preferences MobileIcons MobileContainerManager
TrollStore_LIBRARIES = archive TrollStore_LIBRARIES = archive
TrollStore_CFLAGS = -fobjc-arc -I../Shared TrollStore_CFLAGS = -fobjc-arc -I../Shared

View File

@ -37,10 +37,7 @@
<true/> <true/>
<key>com.apple.CommCenter.fine-grained</key> <key>com.apple.CommCenter.fine-grained</key>
<array> <array>
<string>cellular-plan</string>
<string>data-usage</string>
<string>data-allowed-write</string> <string>data-allowed-write</string>
<string>preferences-write</string>
</array> </array>
<key>com.apple.springboard.opensensitiveurl</key> <key>com.apple.springboard.opensensitiveurl</key>
<true/> <true/>