ソースを参照

updated tweak and version info for the next release, beta 1

Kevin Bradley 5 年 前
コミット
c61581220b
共有5 個のファイルを変更した46 個の追加8 個の削除を含む
  1. 41 3
      flexinjected/Tweak.x
  2. 1 1
      flexinjected/Tweak.x.jsont
  3. 1 1
      flexinjected/compile_commands.json
  4. 2 2
      flexinjected/layout/DEBIAN/control
  5. 1 1
      layout/DEBIAN/control

+ 41 - 3
flexinjected/Tweak.x

@@ -10,6 +10,11 @@
 - (void)_addTVOSGestureRecognizer:(UIViewController *)explorer;
 @end
 
+@interface NSDistributedNotificationCenter : NSNotificationCenter
++ (id)defaultCenter;
+- (void)addObserver:(id)arg1 selector:(SEL)arg2 name:(id)arg3 object:(id)arg4;
+- (void)postNotificationName:(id)arg1 object:(id)arg2 userInfo:(id)arg3;
+@end
 
 @interface UIWindow (Additions)
 - (UIViewController *)visibleViewController;
@@ -40,12 +45,32 @@
 }
 @end
 
+@interface LSApplicationProxy: NSObject
++(id)applicationProxyForIdentifier:(id)sender;
++(id)tv_applicationFlatIcon;
+@end
+
 @implementation NSObject (Additions)
 - (UIViewController *)topViewController {
     return [[[UIApplication sharedApplication] keyWindow] visibleViewController];
 }
 @end
 
+static void sendNotification(NSString *title, NSString *message, UIImage *image) {
+
+    NSMutableDictionary *dict = [NSMutableDictionary new];
+    dict[@"message"] = message;
+    dict[@"title"] = title;
+    dict[@"timeout"] = [NSNumber numberWithInteger:4];
+    if (image){
+        NSData *imageData = UIImagePNGRepresentation(image);
+        if (imageData){
+            dict[@"imageData"] = imageData;
+        }
+    }
+    [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"com.nito.bulletinh4x/displayBulletin" object:nil userInfo:dict];
+}
+
 // The dylib constructor sets decryptedIPAPath, spawns a thread to do the app decryption, then exits.
 __attribute__ ((constructor)) static void FLEXInjected_main() {
     
@@ -53,8 +78,23 @@ __attribute__ ((constructor)) static void FLEXInjected_main() {
     NSString *bundleID = [bundle bundleIdentifier];
     NSDictionary *ourDict = [[NSDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.nito.flexinjected.plist"];
     NSNumber *value = [ourDict objectForKey:bundleID];
-    NSLog(@"[FLEXInjected) bundle ID %@", bundleID);
     if ([value boolValue] == YES) {
+    
+    id prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
+      UIImage *icon = nil;
+      if (prox){
+          NSLog(@"[FLEXInjected] found prox: %@", prox);
+          icon = [prox tv_applicationFlatIcon];
+      } else {
+          NSString *mcsPath = @"/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices";
+          [[NSBundle bundleWithPath:mcsPath] load];
+          prox = [%c(LSApplicationProxy) applicationProxyForIdentifier:bundleID];
+          icon = [prox tv_applicationFlatIcon];
+      }
+     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(), ^{
         NSLog(@"[FLEXInjected] weouchea...");
         NSString *p = @"/Library/Frameworks/FLEX.framework";
@@ -70,8 +110,6 @@ __attribute__ ((constructor)) static void FLEXInjected_main() {
         [flexManager _addTVOSGestureRecognizer:tvc];
         [flexManager showExplorer];
     });
-      
-        NSLog(@"[FLEXInjected] All done, exiting constructor.");
         
     }
 }

ファイルの差分が大きいため隠しています
+ 1 - 1
flexinjected/Tweak.x.jsont


ファイルの差分が大きいため隠しています
+ 1 - 1
flexinjected/compile_commands.json


+ 2 - 2
flexinjected/layout/DEBIAN/control

@@ -1,7 +1,7 @@
 Package: com.nito.flexinjected
 Name: FLEXInjected
-Depends: mobilesubstrate, preferenceloader (>=1.5-15), applist (>=1.3-11), libflex (>=4.1.1a-1)
-Version: 1.0.0
+Depends: mobilesubstrate, preferenceloader (>=1.5-15), applist (>=1.3-11), libflex (>=4.1.1b-1)
+Version: 1.2
 Architecture: appletvos-arm64
 Description: Inject FLEX into your favorite Applications utilizing applist
 Maintainer: Kevin Bradley

+ 1 - 1
layout/DEBIAN/control

@@ -2,7 +2,7 @@ Package: libflex
 Section: Development
 Maintainer: Kevin Bradley
 Architecture: appletvos-arm64
-Version: 4.1.1a-1
+Version: 4.1.1b-1
 Depends: firmware (>= 9.0), mobilesubstrate
 Description: A library for Flipboard Explorer on tvOS, alpha at best!!
 Name: libFLEX