Explorar o código

minor org and cleanup, made separarte tvOS target. added optional convenience build script

Kevin Bradley %!s(int64=5) %!d(string=hai) anos
pai
achega
ae8f70cb97

+ 4 - 0
.gitignore

@@ -20,3 +20,7 @@ DerivedData
 /Example/Pods
 Podfile.lock
 IDEWorkspaceChecks.plist
+
+#tvOS specific
+libflex_*
+flexinjected/packages/*

+ 4 - 2
Classes/GlobalStateExplorers/FLEXWebViewController.m

@@ -99,7 +99,9 @@
 #endif
 }
 
-#pragma mark - KBWebVIew Delegate
+#if TARGET_OS_TV
+
+#pragma mark - KBWebView Delegate
 
 -(void) webViewDidStartLoad:(KBWebView *)webView {
     LOG_SELF;
@@ -126,7 +128,7 @@
     
 }
 
-#if !TARGET_OS_TV
+#else
 #pragma mark - WKWebView Delegate
 
 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {

+ 1 - 1
Classes/GlobalStateExplorers/Globals/FLEXGlobalsViewController.m

@@ -168,7 +168,7 @@
     self.showsSearchBar = YES;
     self.searchBarDebounceInterval = kFLEXDebounceInstant;
     #if !TARGET_OS_TV
-    self.navigationItem.backBarButtonItem = [UIBarButtonItem backItemWithTitle:@"Back"];
+    self.navigationItem.backBarButtonItem = [UIBarButtonItem flex_backItemWithTitle:@"Back"];
     #endif
     _manuallyDeselectOnAppear = NSProcessInfo.processInfo.operatingSystemVersion.majorVersion < 10;
 }

+ 0 - 1
Classes/Utility/FLEXUtility.m

@@ -267,7 +267,6 @@ return 0;
     NSArray<NSString *> *supportedOrientations = NSBundle.mainBundle.infoDictionary[@"UISupportedInterfaceOrientations"];
     #if !TARGET_OS_TV
     UIInterfaceOrientationMask supportedOrientationsMask = 0;
-    NSUInteger supportedOrientationsMask = 0;
     if ([supportedOrientations containsObject:@"UIInterfaceOrientationPortrait"]) {
         supportedOrientationsMask |= UIInterfaceOrientationMaskPortrait;
     }

tvOS/FLEXFontListTableViewController.h → Classes/tvOS/FLEXFontListTableViewController.h


tvOS/FLEXFontListTableViewController.m → Classes/tvOS/FLEXFontListTableViewController.m


+ 0 - 3
tvOS/KBDatePickerView.h

@@ -49,7 +49,4 @@ DECLARE_ENUM(KBDatePickerMode, PICKER_MODE)
 + (NSDateFormatter * _Nonnull )sharedDateFormatter;
 @end
 
-#define DLog(format, ...) CFShow((__bridge CFStringRef)[NSString stringWithFormat:format, ## __VA_ARGS__]);
-#define LOG_SELF        NSLog(@"[KBDatePickerView] %@ %@", self, NSStringFromSelector(_cmd))
 #define DPLog(format, ...) NSLog(@"[KBDatePickerView] %@",[NSString stringWithFormat:format, ## __VA_ARGS__]);
-#define DLOG_SELF DLog(@"%@ %@", self, NSStringFromSelector(_cmd))

+ 3 - 4
tvOS/KBDatePickerView.m

@@ -117,7 +117,6 @@ DEFINE_ENUM(KBDatePickerMode, PICKER_MODE)
 
 - (void)menuGestureRecognized:(UITapGestureRecognizer *)gestureRecognizer {
     if (gestureRecognizer.state == UIGestureRecognizerStateEnded){
-        LOG_SELF;
         id superview = [self superview];
         if ([superview respondsToSelector:@selector(delegate)]){
             UIViewController *vc = [superview delegate];
@@ -126,8 +125,7 @@ DEFINE_ENUM(KBDatePickerMode, PICKER_MODE)
             [vc updateFocusIfNeeded];
         }
         
-        return;
-        
+      /*
         //[self setPreferredFocusedItem:self.toggleTypeButton]; //PRIVATE_API call, trying to avoid those to stay app store friendly!
         UIApplication *sharedApp = [UIApplication sharedApplication];
 #pragma clang diagnostic push
@@ -138,8 +136,9 @@ DEFINE_ENUM(KBDatePickerMode, PICKER_MODE)
         if (rootViewController.view == self.superview){
             [rootViewController setNeedsFocusUpdate];
             [rootViewController updateFocusIfNeeded];
-        }
+        } */
     }
+       
 }
 
 + (NSDateFormatter *)sharedDateFormatter {

tvOS/KBSelectableTextView.h → Classes/tvOS/KBSelectableTextView.h


tvOS/KBSelectableTextView.m → Classes/tvOS/KBSelectableTextView.m


tvOS/KBSlider.h → Classes/tvOS/KBSlider.h


tvOS/KBSlider.m → Classes/tvOS/KBSlider.m


tvOS/Macros.h → Classes/tvOS/Macros.h


tvOS/fakes.h → Classes/tvOS/fakes.h


tvOS/fakes.m → Classes/tvOS/fakes.m


BIN=BIN
Cursor.png


+ 26 - 0
FLEX-tvOS-Info.plist

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>$(CURRENT_PROJECT_VERSION)</string>
+	<key>NSPrincipalClass</key>
+	<string></string>
+</dict>
+</plist>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 851 - 13
FLEX.xcodeproj/project.pbxproj


+ 67 - 0
FLEX.xcodeproj/xcshareddata/xcschemes/FLEX-tvOS.xcscheme

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1170"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "323F6BC5259B9DB70055BDD6"
+               BuildableName = "FLEX-tvOS.framework"
+               BlueprintName = "FLEX-tvOS"
+               ReferencedContainer = "container:FLEX.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "323F6BC5259B9DB70055BDD6"
+            BuildableName = "FLEX-tvOS.framework"
+            BlueprintName = "FLEX-tvOS"
+            ReferencedContainer = "container:FLEX.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 0 - 1
README.md

@@ -5,7 +5,6 @@
 ### General notes / usage
 - If you don't want to build this yourself i keep the latest version synced in layout/Library/Frameworks
 - Best used with a jailbreak / FLEXInjected (avail from default repos now with 'com.nito.flexinjected')
-- You MIGHT Need to modify the SDK to build right now, working towards removing this necessity, getting closer!
 - After toggling via FLEXInjected it will take 10 seconds after launch for the toolbar to appear, if closed - triple tap play/pause to bring it back
 - When in select mode press the menu button will get you back to the tool bar
 - When in select mode play/pause will also work to click items and is more reliable than selection with the remote touch pad, tapping rather than clicking the touchpad is also more reliable.

+ 11 - 0
tvOSBuild.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+XCP=$(which xcpretty)
+
+echo $XCP
+
+if [ -z $XCP ]; then
+    xcodebuild BUILD_ROOT=build -target FLEX-tvOS
+else
+    xcodebuild BUILD_ROOT=build -target FLEX-tvOS | $XCP
+fi