Просмотр исходного кода

fixed the crash on sandboxed apps

Kevin Bradley лет назад: 5
Родитель
Сommit
2ebed530ef
4 измененных файлов с 20 добавлено и 10 удалено
  1. 17 7
      flexinjected/Tweak.x
  2. 1 1
      flexinjected/Tweak.x.jsont
  3. 1 1
      flexinjected/compile_commands.json
  4. 1 1
      layout/DEBIAN/control

+ 17 - 7
flexinjected/Tweak.x

@@ -48,6 +48,7 @@
 @interface LSApplicationProxy: NSObject
 @interface LSApplicationProxy: NSObject
 +(id)applicationProxyForIdentifier:(id)sender;
 +(id)applicationProxyForIdentifier:(id)sender;
 +(id)tv_applicationFlatIcon;
 +(id)tv_applicationFlatIcon;
+-(BOOL)isContainerized;
 @end
 @end
 
 
 @implementation NSObject (Additions)
 @implementation NSObject (Additions)
@@ -79,22 +80,31 @@ __attribute__ ((constructor)) static void FLEXInjected_main() {
     NSDictionary *ourDict = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.nito.flexinjected.plist"];
     NSDictionary *ourDict = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.nito.flexinjected.plist"];
     NSNumber *value = [ourDict objectForKey:bundleID];
     NSNumber *value = [ourDict objectForKey:bundleID];
     if ([value boolValue] == YES) {
     if ([value boolValue] == YES) {
-    
+    BOOL sendAlert = true;
     id prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
     id prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
       UIImage *icon = nil;
       UIImage *icon = nil;
       if (prox){
       if (prox){
           NSLog(@"[FLEXInjected] found prox: %@", prox);
           NSLog(@"[FLEXInjected] found prox: %@", prox);
-          icon = [prox tv_applicationFlatIcon];
+          if ([prox isContainerized]){
+            sendAlert = false;
+          } else {
+                icon = [prox tv_applicationFlatIcon];
+          }
       } else {
       } else {
           NSString *mcsPath = @"/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices";
           NSString *mcsPath = @"/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices";
           [[NSBundle bundleWithPath:mcsPath] load];
           [[NSBundle bundleWithPath:mcsPath] load];
           prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
           prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
-          icon = [prox tv_applicationFlatIcon];
+          if ([prox isContainerized]){
+            sendAlert = false;
+          } else {
+            icon = [prox tv_applicationFlatIcon];
+           }
+      }
+      if (sendAlert){
+        NSString *message = [NSString stringWithFormat:@"Injected into bundle: %@", bundleID];
+        sendNotification(@"FlexInjected", message, icon);
+        NSLog(@"[FLEXInjected) bundle ID %@", bundleID);
       }
       }
-     NSString *message = [NSString stringWithFormat:@"Injected into bundle: %@", bundleID];
-     sendNotification(@"FlexInjected", message, icon);
-     NSLog(@"[FLEXInjected) bundle ID %@", bundleID);
-    
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
         NSLog(@"[FLEXInjected] weouchea...");
         NSLog(@"[FLEXInjected] weouchea...");
         NSString *p = @"/Library/Frameworks/FLEX.framework";
         NSString *p = @"/Library/Frameworks/FLEX.framework";

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
flexinjected/Tweak.x.jsont


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
flexinjected/compile_commands.json


+ 1 - 1
layout/DEBIAN/control

@@ -4,7 +4,7 @@ Maintainer: Kevin Bradley
 Architecture: appletvos-arm64
 Architecture: appletvos-arm64
 Version: 4.1.1b-1
 Version: 4.1.1b-1
 Depends: firmware (>= 9.0), mobilesubstrate
 Depends: firmware (>= 9.0), mobilesubstrate
-Description: A library for Flipboard Explorer on tvOS, alpha at best!!
+Description: A library for Flipboard Explorer on tvOS, solid beta
 Name: libFLEX
 Name: libFLEX
 Author: Tanner Bennett <tannerbennett@me.com>
 Author: Tanner Bennett <tannerbennett@me.com>
 dev: tannerbennett
 dev: tannerbennett