├── .gitignore ├── GoNativeIOS.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── GonativeIO.xcscheme ├── GoNativeIOS.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── GoogleService-Info.plist ├── INSTRUCTIONS-TO-OPEN.txt ├── LeanIOS ├── AppIcon ├── Assets.xcassets │ ├── Contents.json │ ├── navigationBarTintColor.colorset │ │ └── Contents.json │ ├── sidebarBackgroundColor.colorset │ │ └── Contents.json │ ├── sidebarTextColor.colorset │ │ └── Contents.json │ ├── statusBarBackgroundColor.colorset │ │ └── Contents.json │ ├── tabBarTintColor.colorset │ │ └── Contents.json │ ├── tintColor.colorset │ │ └── Contents.json │ └── titleColor.colorset │ │ └── Contents.json ├── Base.lproj │ └── Main.storyboard ├── BlobDownloader.js ├── GNBackgroundAudio.h ├── GNBackgroundAudio.m ├── GNConfigPreferences.h ├── GNConfigPreferences.m ├── GNCustomHeaders.h ├── GNCustomHeaders.m ├── GNFileWriterSharer.h ├── GNFileWriterSharer.m ├── GNJSBridgeInterface.h ├── GNJSBridgeInterface.m ├── GNLogManager.h ├── GNLogManager.m ├── GNRegistrationManager.h ├── GNRegistrationManager.m ├── GNSwiftUtilities.swift ├── GTMNSString+HTML.h ├── GTMNSString+HTML.m ├── GoNativeIOS-Info.plist ├── GoNativeIOS-Prefix.pch ├── GoNativeJSBridgeLibrary.js ├── GoNativeKeychain.swift ├── GonativeIO-Bridging-Header.h ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── icon-1024.png │ │ ├── icon-120.png │ │ ├── icon-152.png │ │ ├── icon-167.png │ │ ├── icon-180.png │ │ ├── icon-29.png │ │ ├── icon-40.png │ │ ├── icon-58.png │ │ ├── icon-76.png │ │ └── icon-80.png │ ├── Contents.json │ ├── HeaderImage.imageset │ │ ├── Contents.json │ │ ├── header.png │ │ ├── header@2x.png │ │ ├── header@3x.png │ │ ├── headerDark.png │ │ ├── headerDark@2x.png │ │ └── headerDark@3x.png │ ├── LaunchBackground.imageset │ │ ├── 2x.png │ │ ├── 2xDark.png │ │ └── Contents.json │ ├── LaunchCenter.imageset │ │ ├── 2x.png │ │ ├── 2xDark.png │ │ └── Contents.json │ ├── NavBarImage.imageset │ │ ├── Contents.json │ │ ├── navBar.png │ │ └── navBarDark.png │ ├── cast_off.imageset │ │ ├── Contents.json │ │ ├── cast_off-1.png │ │ └── cast_off.png │ ├── chevronDown.imageset │ │ ├── Contents.json │ │ ├── chevron-down.png │ │ ├── chevron-down@2x.png │ │ └── chevron-down@3x.png │ ├── chevronUp.imageset │ │ ├── Contents.json │ │ ├── chevron-up.png │ │ ├── chevron-up@2x.png │ │ └── chevron-up@3x.png │ ├── eye.imageset │ │ ├── Contents.json │ │ ├── ios7-eye-29.png │ │ ├── ios7-eye-58.png │ │ └── ios7-eye-87.png │ ├── gear.imageset │ │ ├── Contents.json │ │ ├── ios7-gear-outline.png │ │ ├── ios7-gear-outline@2x.png │ │ └── ios7-gear-outline@3x.png │ ├── gonative-car.imageset │ │ ├── Contents.json │ │ ├── car-108.png │ │ ├── car-36.png │ │ └── car-72.png │ ├── gonative-classic.imageset │ │ ├── Contents.json │ │ ├── classic-108.png │ │ ├── classic-36.png │ │ └── classic-72.png │ ├── gonative-motor.imageset │ │ ├── Contents.json │ │ ├── motor-108.png │ │ ├── motor-36.png │ │ └── motor-72.png │ ├── gonative-van.imageset │ │ ├── Contents.json │ │ ├── van-108.png │ │ ├── van-36.png │ │ └── van-72.png │ ├── leftImage.imageset │ │ ├── Contents.json │ │ ├── ios7-arrow-left.png │ │ └── ios7-arrow-left@2x.png │ ├── navImage.imageset │ │ ├── Contents.json │ │ ├── navicon.png │ │ ├── navicon@2x.png │ │ └── navicon@3x.png │ └── rightImage.imageset │ │ ├── Contents.json │ │ ├── ios7-arrow-right.png │ │ └── ios7-arrow-right@2x.png ├── LEANActionManager.h ├── LEANActionManager.m ├── LEANAppDelegate.h ├── LEANAppDelegate.m ├── LEANConfigUpdater.h ├── LEANConfigUpdater.m ├── LEANDlogDefinition.h ├── LEANDocumentSharer.h ├── LEANDocumentSharer.m ├── LEANIcons.swift ├── LEANInstallation.h ├── LEANInstallation.m ├── LEANJsCustomCodeExecutor.h ├── LEANJsCustomCodeExecutor.m ├── LEANLaunchScreenManager.h ├── LEANLaunchScreenManager.m ├── LEANLoginManager.h ├── LEANLoginManager.m ├── LEANMenuViewController.h ├── LEANMenuViewController.m ├── LEANNavigationController.h ├── LEANNavigationController.m ├── LEANProfilePicker.h ├── LEANProfilePicker.m ├── LEANRegexRulesManager.h ├── LEANRegexRulesManager.m ├── LEANRootViewController.h ├── LEANRootViewController.m ├── LEANTabManager.h ├── LEANTabManager.m ├── LEANToolbarManager.h ├── LEANToolbarManager.m ├── LEANUrlCache.h ├── LEANUrlCache.m ├── LEANUrlInspector.h ├── LEANUrlInspector.m ├── LEANUtilities.h ├── LEANUtilities.m ├── LEANWebViewController.h ├── LEANWebViewController.m ├── LEANWebViewIntercept.h ├── LEANWebViewIntercept.m ├── LEANWebViewPool.h ├── LEANWebViewPool.m ├── LaunchScreen.storyboard ├── LaunchScreenNav.storyboard ├── LaunchScreenNoNav.storyboard ├── MenuChildIcon.xib ├── MenuChildNoIcon.xib ├── MenuGroupIcon.xib ├── MenuGroupNoIcon.xib ├── NSURL+LEANUtilities.h ├── NSURL+LEANUtilities.m ├── REFrostedViewController │ ├── RECommonFunctions.h │ ├── RECommonFunctions.m │ ├── REFrostedContainerViewController.h │ ├── REFrostedContainerViewController.m │ ├── REFrostedViewController.h │ ├── REFrostedViewController.m │ ├── UIImage+REFrostedViewController.h │ ├── UIImage+REFrostedViewController.m │ ├── UIView+REFrostedViewController.h │ ├── UIView+REFrostedViewController.m │ ├── UIViewController+REFrostedViewController.h │ └── UIViewController+REFrostedViewController.m ├── Reachability.h ├── Reachability.m ├── Settings.bundle │ ├── Root.plist │ └── en.lproj │ │ └── Root.strings ├── SidebarHeaderView.xib ├── WindowsController.swift ├── appConfig.json ├── appbeep.wav ├── ar.lproj │ └── Localizable.strings ├── ca.lproj │ └── Localizable.strings ├── cs.lproj │ └── Localizable.strings ├── custom-icons.json ├── custom-icons.ttf ├── custom_sound_1.aff ├── custom_sound_2.aff ├── custom_sound_3.aff ├── custom_sound_4.aff ├── custom_sound_5.aff ├── da.lproj │ └── Localizable.strings ├── de.lproj │ └── Localizable.strings ├── en.lproj │ ├── InfoPlist.strings │ └── Localizable.strings ├── es-419.lproj │ └── Localizable.strings ├── es.lproj │ └── Localizable.strings ├── fi.lproj │ └── Localizable.strings ├── fr.lproj │ └── Localizable.strings ├── gd.lproj │ └── Localizable.strings ├── generate-app-icons.sh ├── generate-header-image.sh ├── generate-navigation-title-image.sh ├── he.lproj │ └── Localizable.strings ├── hu.lproj │ └── Localizable.strings ├── iosHeaderImage ├── it.lproj │ └── Localizable.strings ├── jquery-2.1.0.min.js ├── licenses │ ├── 00-preamble.license │ ├── FontAwesome.license │ ├── REFrostedViewController.license │ ├── Zipzap.license │ ├── generate.pl │ └── ios-fontawesome.license ├── localCache.zip ├── main.m ├── nl.lproj │ └── Localizable.strings ├── nn-NO.lproj │ └── Localizable.strings ├── notification.aff ├── offline.html ├── pt-BR.lproj │ └── Localizable.strings ├── pt-PT.lproj │ └── Localizable.strings └── tr.lproj │ └── Localizable.strings ├── LeanIOSTests ├── GoNativeIOSTests-Info.plist ├── LeanIOSTests.m └── en.lproj │ └── InfoPlist.strings ├── Podfile ├── Podfile.lock ├── Project.entitlements ├── README.md ├── lib ├── include │ └── zipzap │ │ ├── ZZAESDecryptInputStream.h │ │ ├── ZZArchive.h │ │ ├── ZZArchiveEntry.h │ │ ├── ZZArchiveEntryWriter.h │ │ ├── ZZChannel.h │ │ ├── ZZChannelOutput.h │ │ ├── ZZConstants.h │ │ ├── ZZDataChannel.h │ │ ├── ZZDataChannelOutput.h │ │ ├── ZZDataProvider.h │ │ ├── ZZDeflateOutputStream.h │ │ ├── ZZError.h │ │ ├── ZZFileChannel.h │ │ ├── ZZFileChannelOutput.h │ │ ├── ZZHeaders.h │ │ ├── ZZInflateInputStream.h │ │ ├── ZZNewArchiveEntry.h │ │ ├── ZZNewArchiveEntryWriter.h │ │ ├── ZZOldArchiveEntry.h │ │ ├── ZZOldArchiveEntryWriter.h │ │ ├── ZZScopeGuard.h │ │ ├── ZZStandardCryptoEngine.h │ │ ├── ZZStandardDecryptInputStream.h │ │ ├── ZZStoreOutputStream.h │ │ └── zipzap.h └── libzipzap.a └── plugins.rb /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *~ 3 | xcuserdata 4 | *.xccheckout 5 | .DS_Store 6 | Pods/ 7 | .idea 8 | -------------------------------------------------------------------------------- /GoNativeIOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GoNativeIOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GoNativeIOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /GoNativeIOS.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /INSTRUCTIONS-TO-OPEN.txt: -------------------------------------------------------------------------------- 1 | GoNative.io iOS Instructions to Open Project 2 | ============================================ 3 | 4 | Please open xcworkspace in Xcode. Do not open the xcodeproj file. 5 | 6 | For more information on how to build your app: 7 | https://support.gonative.io/help/how-do-i-build-the-ios-app-from-source-code 8 | -------------------------------------------------------------------------------- /LeanIOS/AppIcon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/AppIcon -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/navigationBarTintColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0xF8", 9 | "green" : "0xF8", 10 | "red" : "0xF8" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0x33", 27 | "green" : "0x33", 28 | "red" : "0x33" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/sidebarBackgroundColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0xF8", 9 | "green" : "0xF8", 10 | "red" : "0xF8" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0x33", 27 | "green" : "0x33", 28 | "red" : "0x33" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/sidebarTextColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.431", 9 | "green" : "0.286", 10 | "red" : "0.118" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0xDC", 27 | "green" : "0xC5", 28 | "red" : "0xAD" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/statusBarBackgroundColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0xFF", 9 | "green" : "0xFF", 10 | "red" : "0xFF" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0x00", 27 | "green" : "0x00", 28 | "red" : "0x00" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/tabBarTintColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0xF8", 9 | "green" : "0xF8", 10 | "red" : "0xF8" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0x33", 27 | "green" : "0x33", 28 | "red" : "0x33" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/tintColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0x6D", 9 | "green" : "0x48", 10 | "red" : "0x1E" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0xDC", 27 | "green" : "0xC5", 28 | "red" : "0xAD" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LeanIOS/Assets.xcassets/titleColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0x6D", 9 | "green" : "0x48", 10 | "red" : "0x1E" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0xDC", 27 | "green" : "0xC5", 28 | "red" : "0xAD" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LeanIOS/BlobDownloader.js: -------------------------------------------------------------------------------- 1 | function gonativeDownloadBlobUrl(url) { 2 | var req = new XMLHttpRequest(); 3 | req.open('GET', url, true); 4 | req.responseType = 'blob'; 5 | 6 | req.onload = function(event) { 7 | var blob = req.response; 8 | saveBlob(blob); 9 | }; 10 | req.send(); 11 | 12 | function sendMessage(message) { 13 | if (window.webkit && window.webkit.messageHandlers && 14 | window.webkit.messageHandlers.fileWriterSharer) { 15 | window.webkit.messageHandlers.fileWriterSharer.postMessage(message); 16 | } 17 | if (window.gonative_file_writer_sharer && window.gonative_file_writer_sharer.postMessage) { 18 | window.gonative_file_writer_sharer.postMessage(JSON.stringify(message)); 19 | } 20 | } 21 | 22 | function saveBlob(blob, filename) { 23 | var chunkSize = 1024 * 1024; // 1mb 24 | var index = 0; 25 | // random string to identify this file transfer 26 | var id = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); 27 | 28 | function sendHeader() { 29 | sendMessage({ 30 | event: 'fileStart', 31 | id: id, 32 | size: blob.size, 33 | type: blob.type, 34 | name: filename 35 | }); 36 | } 37 | 38 | function sendChunk() { 39 | if (index >= blob.size) { 40 | return sendEnd(); 41 | } 42 | 43 | var chunkToSend = blob.slice(index, index + chunkSize); 44 | var reader = new FileReader(); 45 | reader.readAsDataURL(chunkToSend); 46 | reader.onloadend = function() { 47 | sendMessage({ 48 | event: 'fileChunk', 49 | id: id, 50 | data: reader.result 51 | }); 52 | index += chunkSize; 53 | setTimeout(sendChunk); 54 | }; 55 | } 56 | 57 | function sendEnd() { 58 | sendMessage({ 59 | event: 'fileEnd', 60 | id:id 61 | }); 62 | } 63 | 64 | sendHeader(); 65 | sendChunk(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /LeanIOS/GNBackgroundAudio.h: -------------------------------------------------------------------------------- 1 | // 2 | // GNBackgroundAudio.h 3 | // GonativeIO 4 | // 5 | // Created by Weiyin He on 12/30/19. 6 | // Copyright © 2019 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface GNBackgroundAudio : NSObject 14 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query; 15 | - (void)start; 16 | - (void)end; 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /LeanIOS/GNBackgroundAudio.m: -------------------------------------------------------------------------------- 1 | // 2 | // GNBackgroundAudio.m 3 | // GonativeIO 4 | // 5 | // Created by Weiyin He on 12/30/19. 6 | // Copyright © 2019 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "GNBackgroundAudio.h" 11 | 12 | @interface GNBackgroundAudio() 13 | @property AVAudioPlayer *audioPlayer; 14 | @property BOOL keepAwake; 15 | @property BOOL isMixedSession; 16 | @end 17 | 18 | @implementation GNBackgroundAudio 19 | 20 | -(instancetype)init 21 | { 22 | self = [super init]; 23 | 24 | NSString* path = [[NSBundle mainBundle] pathForResource:@"appbeep" ofType:@"wav"]; 25 | NSURL* url = [NSURL fileURLWithPath:path]; 26 | self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil]; 27 | self.audioPlayer.volume = 0; 28 | self.audioPlayer.numberOfLoops = -1; 29 | 30 | self.keepAwake = NO; 31 | return self; 32 | } 33 | 34 | -(void)dealloc 35 | { 36 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 37 | } 38 | 39 | -(void)handleUrl:(NSURL *)url query:(NSDictionary*)query { 40 | if ([@"/start" isEqualToString:url.path]) { 41 | [self start]; 42 | } else if ([@"/end" isEqualToString:url.path]) { 43 | [self end]; 44 | } 45 | } 46 | 47 | -(void)start 48 | { 49 | // Turn on mixed session 50 | if (!self.isMixedSession) { 51 | AVAudioSession *session = [AVAudioSession sharedInstance]; 52 | [session setActive:NO error:nil]; 53 | [session setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil]; 54 | [session setActive:YES error:nil]; 55 | self.isMixedSession = YES; 56 | } 57 | 58 | self.keepAwake = YES; 59 | [self startKeepingAwake]; 60 | } 61 | 62 | -(void)end 63 | { 64 | self.keepAwake = NO; 65 | [self stopKeepingAwake]; 66 | 67 | // Turn off mixed session 68 | if (self.isMixedSession) { 69 | AVAudioSession *session = [AVAudioSession sharedInstance]; 70 | [session setActive:NO error:nil]; 71 | [session setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionDuckOthers error:nil]; 72 | self.isMixedSession = NO; 73 | } 74 | } 75 | 76 | -(void)startKeepingAwake 77 | { 78 | if (!self.keepAwake) return; 79 | [self.audioPlayer play]; 80 | } 81 | 82 | -(void)stopKeepingAwake 83 | { 84 | [self.audioPlayer pause]; 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /LeanIOS/GNConfigPreferences.h: -------------------------------------------------------------------------------- 1 | // 2 | // GNConfigPreferences.h 3 | // GonativeIO 4 | // 5 | // Created by Weiyin He on 3/16/18. 6 | // Copyright © 2018 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GNConfigPreferences : NSObject 12 | + (instancetype)sharedPreferences; 13 | 14 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query; 15 | - (void)setInitialUrl:(NSString*)url; 16 | - (NSString*)getInitialUrl; 17 | @end 18 | -------------------------------------------------------------------------------- /LeanIOS/GNConfigPreferences.m: -------------------------------------------------------------------------------- 1 | // 2 | // GNConfigPreferences.m 3 | // GonativeIO 4 | // 5 | // Created by Weiyin He on 3/16/18. 6 | // Copyright © 2018 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "GNConfigPreferences.h" 10 | #import "LEANAppDelegate.h" 11 | 12 | #define kInitialUrlKey @"io.gonative.ios.initialUrl" 13 | 14 | @implementation GNConfigPreferences 15 | +(instancetype)sharedPreferences 16 | { 17 | static GNConfigPreferences *sharedPreferences; 18 | @synchronized(self) 19 | { 20 | if (!sharedPreferences){ 21 | sharedPreferences = [[GNConfigPreferences alloc] init]; 22 | } 23 | return sharedPreferences; 24 | } 25 | } 26 | 27 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query 28 | { 29 | if ([@"/set" isEqualToString:url.path]) { 30 | [self setInitialUrl:query[@"initialUrl"]]; 31 | } 32 | } 33 | 34 | -(void)setInitialUrl:(NSString*)url 35 | { 36 | url = [self processUrl:url]; 37 | 38 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 39 | if (url && url.length > 0) { 40 | [defaults setObject:url forKey:kInitialUrlKey]; 41 | } else { 42 | [defaults removeObjectForKey:kInitialUrlKey]; 43 | } 44 | [defaults synchronize]; 45 | 46 | // set in app delegate so that page does not get reloaded 47 | LEANAppDelegate *appDelegate = (LEANAppDelegate*)[UIApplication sharedApplication].delegate; 48 | appDelegate.previousInitialUrl = url; 49 | } 50 | 51 | -(NSString*)getInitialUrl 52 | { 53 | NSString *url = [[NSUserDefaults standardUserDefaults] objectForKey:kInitialUrlKey]; 54 | return [self processUrl:url]; 55 | } 56 | 57 | -(NSString*)processUrl:(NSString*)url 58 | { 59 | if (!url || url.length == 0) return nil; 60 | 61 | // if protocol is not specified, add http:// 62 | if ([url rangeOfString:@"://"].location == NSNotFound) { 63 | url = [NSString stringWithFormat:@"http://%@", url]; 64 | } 65 | 66 | return url; 67 | } 68 | @end 69 | -------------------------------------------------------------------------------- /LeanIOS/GNCustomHeaders.h: -------------------------------------------------------------------------------- 1 | // 2 | // GNCustomHeaders.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 5/1/17. 6 | // Copyright © 2017 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface GNCustomHeaders : NSObject 13 | +(NSDictionary*)getCustomHeaders; 14 | -(NSURLRequest*)modifyRequest:(NSURLRequest*)request; 15 | -(BOOL)shouldModifyRequest:(NSURLRequest *)request webview:(WKWebView *)webview; 16 | @end 17 | -------------------------------------------------------------------------------- /LeanIOS/GNCustomHeaders.m: -------------------------------------------------------------------------------- 1 | // 2 | // GNCustomHeaders.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 5/1/17. 6 | // Copyright © 2017 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "GNCustomHeaders.h" 10 | 11 | static NSString * kOurRequestProperty = @"io.gonative.ios.GNCustomHeaders"; 12 | 13 | @interface GNCustomHeaders() 14 | @property NSArray *backHistory; 15 | @property NSArray *forwardHistory; 16 | @end 17 | 18 | @implementation GNCustomHeaders 19 | +(NSDictionary*)getCustomHeaders 20 | { 21 | NSDictionary *config = [GoNativeAppConfig sharedAppConfig].customHeaders; 22 | if (!config) { 23 | return nil; 24 | } 25 | 26 | NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:config.count]; 27 | 28 | for (id key in config) { 29 | if ([key isKindOfClass:[NSString class]] && [key length] > 0) { 30 | id val = [self interpolateValues:config[key]]; 31 | if (val) { 32 | result[key] = val; 33 | } 34 | } 35 | } 36 | 37 | return result; 38 | } 39 | 40 | +(NSString*)interpolateValues:(NSString*)value 41 | { 42 | if (![value isKindOfClass:[NSString class]]) { 43 | return nil; 44 | } 45 | 46 | if ([value containsString:@"%DEVICEID%"]) { 47 | NSString *deviceId = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; 48 | value = [value stringByReplacingOccurrencesOfString:@"%DEVICEID%" withString:deviceId]; 49 | } 50 | 51 | if ([value containsString:@"%DEVICENAME64%"]) { 52 | NSString *deviceName = [[UIDevice currentDevice] name]; 53 | NSData *data = [deviceName dataUsingEncoding:NSUTF8StringEncoding]; 54 | NSString *deviceName64 = [data base64EncodedStringWithOptions:0]; 55 | value = [value stringByReplacingOccurrencesOfString:@"%DEVICENAME64%" withString:deviceName64]; 56 | } 57 | 58 | return value; 59 | } 60 | 61 | -(NSURLRequest*)modifyRequest:(NSURLRequest*)request 62 | { 63 | NSMutableURLRequest *modifiedRequest = [request mutableCopy]; 64 | 65 | NSDictionary *headers = [GNCustomHeaders getCustomHeaders]; 66 | for (NSString *key in headers) { 67 | [modifiedRequest setValue:headers[key] forHTTPHeaderField:key]; 68 | } 69 | 70 | return modifiedRequest; 71 | } 72 | 73 | -(BOOL)shouldModifyRequest:(NSURLRequest *)request webview:(WKWebView *)webview 74 | { 75 | BOOL goingBack = [self isBackNavigationRequest:request webview:webview]; 76 | BOOL goingForward = [self isForwardNavigationRequest:request webview:webview]; 77 | 78 | if (goingBack || goingForward) { 79 | return NO; 80 | } 81 | 82 | if (request.HTTPMethod && ![request.HTTPMethod isEqualToString:@"GET"]) { 83 | return NO; 84 | } 85 | 86 | NSDictionary *headers = [GNCustomHeaders getCustomHeaders]; 87 | if (!headers || headers.count == 0) { 88 | return NO; 89 | } 90 | 91 | for (NSString *key in headers) { 92 | if (![request valueForHTTPHeaderField:key]) { 93 | return YES; 94 | } 95 | } 96 | 97 | return NO; 98 | } 99 | 100 | -(BOOL)isBackNavigationRequest:(NSURLRequest *)request webview:(WKWebView *)webview 101 | { 102 | NSArray *newBackHistory = [webview backForwardList].backList; 103 | NSArray *prevBackHistory = self.backHistory; 104 | 105 | self.backHistory = newBackHistory; 106 | 107 | NSString *lastItemUrl = [prevBackHistory lastObject].URL.absoluteString; 108 | return newBackHistory.count < prevBackHistory.count && [lastItemUrl isEqualToString:request.URL.absoluteString]; 109 | } 110 | 111 | -(BOOL)isForwardNavigationRequest:(NSURLRequest *)request webview:(WKWebView *)webview 112 | { 113 | NSArray *newForwardHistory = [webview backForwardList].forwardList; 114 | NSArray *prevForwardHistory = self.forwardHistory; 115 | 116 | self.forwardHistory = newForwardHistory; 117 | 118 | NSString *lastItemUrl = [prevForwardHistory lastObject].URL.absoluteString; 119 | return newForwardHistory.count < prevForwardHistory.count && [lastItemUrl isEqualToString:request.URL.absoluteString]; 120 | } 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /LeanIOS/GNFileWriterSharer.h: -------------------------------------------------------------------------------- 1 | // 2 | // GNFileWriterSharer.h 3 | // GonativeIO 4 | // 5 | // Created by Weiyin He on 11/16/19. 6 | // Copyright © 2019 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "LEANWebViewController.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | static NSString * GNFileWriterSharerName = @"fileWriterSharer"; 16 | static NSUInteger GNFileWriterSharerMaxSize = 1024 * 1024 * 1024; // 1 gigabyte 17 | 18 | 19 | @interface GNFileWriterSharer : NSObject 20 | @property (weak) UIView *webView; 21 | @property (weak) LEANWebViewController *wvc; 22 | - (void)downloadBlobUrl:(NSURL *)url filename:(NSString *_Nullable)filename; 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /LeanIOS/GNJSBridgeInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // GNJSBridgeInterface.h 3 | // GoNativeIOS 4 | // 5 | // Created by Anuj Sevak on 2021-11-10. 6 | // Copyright © 2021 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LEANWebViewController.h" 11 | #import "LEANRootViewController.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | static NSString * GNJSBridgeName = @"JSBridge"; 16 | 17 | @interface GNJSBridgeInterface : NSObject 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /LeanIOS/GNJSBridgeInterface.m: -------------------------------------------------------------------------------- 1 | // 2 | // GNJSBridgeInterface.m 3 | // GonativeIO 4 | // 5 | // Created by Anuj Sevak on 2021-11-10. 6 | // Copyright © 2021 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "GNJSBridgeInterface.h" 10 | #import 11 | 12 | @implementation GNJSBridgeInterface : NSObject 13 | 14 | - (LEANWebViewController *)webViewController 15 | { 16 | // Get current webview controller 17 | UIViewController *topController = [UIApplication sharedApplication].keyWindow.rootViewController; 18 | 19 | while (topController.presentedViewController) { 20 | topController = topController.presentedViewController; 21 | } 22 | if ([topController isKindOfClass:[LEANRootViewController class]]) { 23 | LEANRootViewController *rvc = (LEANRootViewController *)topController; 24 | 25 | // Get top most WebViewController 26 | LEANWebViewController *wvc; 27 | NSArray *viewControllers = rvc.webViewController.navigationController.viewControllers; 28 | for (int i = 0; i < viewControllers.count; i++) { 29 | if ([viewControllers[i] isKindOfClass:[LEANWebViewController class]]) { 30 | wvc = (LEANWebViewController *)viewControllers[i]; 31 | } 32 | } 33 | return wvc; 34 | } 35 | return nil; 36 | } 37 | 38 | - (void)userContentController:(nonnull WKUserContentController *)userContentController didReceiveScriptMessage:(nonnull WKScriptMessage *)message { 39 | LEANWebViewController *wvc = [self webViewController]; 40 | if (![wvc isKindOfClass:[LEANWebViewController class]]) return; 41 | 42 | if([message.body isKindOfClass:[NSDictionary class]]){ 43 | [wvc handleJSBridgeFunctions:(NSDictionary*)message.body]; 44 | } else if ([message.body isKindOfClass:[NSString class]]){ 45 | NSURL *url = [NSURL URLWithString:(NSString*) message.body]; 46 | if(!url) return; 47 | [wvc handleJSBridgeFunctions:url]; 48 | } 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /LeanIOS/GNLogManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // GNLogManager.h 3 | // GoNativeIOS 4 | // 5 | // Created by bld on 11/29/22. 6 | // Copyright © 2022 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface GNLogManager : NSObject 15 | - (instancetype)initWithWebview:(WKWebView *)webview enabled:(BOOL)enabled; 16 | - (void)handleUrl:(NSURL *)url query:(NSDictionary *)query; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /LeanIOS/GNLogManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // GNLogManager.m 3 | // GonativeIO 4 | // 5 | // Created by bld on 11/29/22. 6 | // Copyright © 2022 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "GNLogManager.h" 10 | 11 | @interface GNLogManager() 12 | @property WKWebView *webview; 13 | @end 14 | 15 | @implementation GNLogManager 16 | 17 | - (instancetype)initWithWebview:(WKWebView *)webview enabled:(BOOL)enabled { 18 | self = [super init]; 19 | if (self) { 20 | self.webview = webview; 21 | 22 | if (enabled) { 23 | [self enableLogging]; 24 | } 25 | } 26 | return self; 27 | } 28 | 29 | - (void)enableLogging { 30 | NSString *js = @" " 31 | "var globalConsole = console; " 32 | "var console = { " 33 | " log: function(data) { " 34 | " gonative.webconsolelogs.print({ data, type: 'console.log' }) " 35 | " }, " 36 | " error: function(data) { " 37 | " gonative.webconsolelogs.print({ data, type: 'console.error' }) " 38 | " }, " 39 | " warn: function(data) { " 40 | " gonative.webconsolelogs.print({ data, type: 'console.warn' }) " 41 | " }, " 42 | " debug: function(data) { " 43 | " gonative.webconsolelogs.print({ data, type: 'console.debug' }) " 44 | " }, " 45 | "}; " 46 | " "; 47 | [self.webview evaluateJavaScript:js completionHandler:nil]; 48 | NSLog(@"Web console logs enabled"); 49 | } 50 | 51 | - (void)handleUrl:(NSURL *)url query:(NSDictionary *)query { 52 | if (![url.host isEqualToString:@"webconsolelogs"] || ![url.path isEqualToString:@"/print"]) { 53 | return; 54 | } 55 | 56 | @try { 57 | NSLog(@"[%@] %@", query[@"type"], query[@"data"]); 58 | } @catch(id exception) { 59 | // Do nothing 60 | } 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /LeanIOS/GNRegistrationManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // GNRegistrationService.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 10/3/15. 6 | // Copyright © 2015 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GNRegistrationManager : NSObject 12 | + (instancetype)sharedManager; 13 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query; 14 | - (void)processConfig:(NSArray*)endpoints; 15 | - (void)checkUrl:(NSURL*)url; 16 | - (void)setOneSignalUserId:(NSString *)userId pushToken:(NSString*)pushToken subscribed:(BOOL)subscribed; 17 | - (void)setOneSignalRequiresPrivacyConsent:(BOOL)requiresPrivacyConsent; 18 | - (void)setCustomData:(NSDictionary*)data; 19 | - (void)sendToAllEndpoints; 20 | @end 21 | -------------------------------------------------------------------------------- /LeanIOS/GNSwiftUtilities.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GNSwiftUtilities.swift 3 | // GonativeIO 4 | // 5 | // Created by Hunaid Hassan on 26.05.23. 6 | // Copyright © 2023 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @objc 12 | public class GNSwiftUtilities: NSObject { 13 | @objc class func deviceToken(data: Data) -> String { 14 | return data.map { String(format: "%02x", $0) }.joined() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LeanIOS/GTMNSString+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMNSString+HTML.h 3 | // Dealing with NSStrings that contain HTML 4 | // 5 | // Copyright 2006-2008 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | // use this file except in compliance with the License. You may obtain a copy 9 | // of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | // License for the specific language governing permissions and limitations under 17 | // the License. 18 | // 19 | 20 | #import 21 | 22 | /// Utilities for NSStrings containing HTML 23 | @interface NSString (GTMNSStringHTMLAdditions) 24 | 25 | /// Get a string where internal characters that need escaping for HTML are escaped 26 | // 27 | /// For example, '&' become '&'. This will only cover characters from table 28 | /// A.2.2 of http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters 29 | /// which is what you want for a unicode encoded webpage. If you have a ascii 30 | /// or non-encoded webpage, please use stringByEscapingAsciiHTML which will 31 | /// encode all characters. 32 | /// 33 | /// For obvious reasons this call is only safe once. 34 | // 35 | // Returns: 36 | // Autoreleased NSString 37 | // 38 | - (NSString *)gtm_stringByEscapingForHTML; 39 | 40 | /// Get a string where internal characters that need escaping for HTML are escaped 41 | // 42 | /// For example, '&' become '&' 43 | /// All non-mapped characters (unicode that don't have a &keyword; mapping) 44 | /// will be converted to the appropriate &#xxx; value. If your webpage is 45 | /// unicode encoded (UTF16 or UTF8) use stringByEscapingHTML instead as it is 46 | /// faster, and produces less bloated and more readable HTML (as long as you 47 | /// are using a unicode compliant HTML reader). 48 | /// 49 | /// For obvious reasons this call is only safe once. 50 | // 51 | // Returns: 52 | // Autoreleased NSString 53 | // 54 | - (NSString *)gtm_stringByEscapingForAsciiHTML; 55 | 56 | /// Get a string where internal characters that are escaped for HTML are unescaped 57 | // 58 | /// For example, '&' becomes '&' 59 | /// Handles and 2 cases as well 60 | /// 61 | // Returns: 62 | // Autoreleased NSString 63 | // 64 | - (NSString *)gtm_stringByUnescapingFromHTML; 65 | 66 | @end -------------------------------------------------------------------------------- /LeanIOS/GoNativeIOS-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | 18 | #import 19 | -------------------------------------------------------------------------------- /LeanIOS/GonativeIO-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | #import "LEANUtilities.h" 7 | #import "LEANWebViewController.h" 8 | #import "LEANRootViewController.h" 9 | #import "REFrostedViewController.h" 10 | -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "icon-29.png", 17 | "scale" : "1x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "icon-58.png", 23 | "scale" : "2x" 24 | }, 25 | { 26 | "idiom" : "iphone", 27 | "size" : "29x29", 28 | "scale" : "3x" 29 | }, 30 | { 31 | "size" : "40x40", 32 | "idiom" : "iphone", 33 | "filename" : "icon-80.png", 34 | "scale" : "2x" 35 | }, 36 | { 37 | "idiom" : "iphone", 38 | "size" : "40x40", 39 | "scale" : "3x" 40 | }, 41 | { 42 | "idiom" : "iphone", 43 | "size" : "57x57", 44 | "scale" : "1x" 45 | }, 46 | { 47 | "idiom" : "iphone", 48 | "size" : "57x57", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-120.png", 55 | "scale" : "2x" 56 | }, 57 | { 58 | "size" : "60x60", 59 | "idiom" : "iphone", 60 | "filename" : "icon-180.png", 61 | "scale" : "3x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "20x20", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "20x20", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "size" : "29x29", 75 | "idiom" : "ipad", 76 | "filename" : "icon-29.png", 77 | "scale" : "1x" 78 | }, 79 | { 80 | "size" : "29x29", 81 | "idiom" : "ipad", 82 | "filename" : "icon-58.png", 83 | "scale" : "2x" 84 | }, 85 | { 86 | "size" : "40x40", 87 | "idiom" : "ipad", 88 | "filename" : "icon-40.png", 89 | "scale" : "1x" 90 | }, 91 | { 92 | "size" : "40x40", 93 | "idiom" : "ipad", 94 | "filename" : "icon-80.png", 95 | "scale" : "2x" 96 | }, 97 | { 98 | "idiom" : "ipad", 99 | "size" : "50x50", 100 | "scale" : "1x" 101 | }, 102 | { 103 | "idiom" : "ipad", 104 | "size" : "50x50", 105 | "scale" : "2x" 106 | }, 107 | { 108 | "idiom" : "ipad", 109 | "size" : "72x72", 110 | "scale" : "1x" 111 | }, 112 | { 113 | "idiom" : "ipad", 114 | "size" : "72x72", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "76x76", 119 | "idiom" : "ipad", 120 | "filename" : "icon-76.png", 121 | "scale" : "1x" 122 | }, 123 | { 124 | "size" : "76x76", 125 | "idiom" : "ipad", 126 | "filename" : "icon-152.png", 127 | "scale" : "2x" 128 | }, 129 | { 130 | "size" : "83.5x83.5", 131 | "idiom" : "ipad", 132 | "filename" : "icon-167.png", 133 | "scale" : "2x" 134 | }, 135 | { 136 | "size" : "1024x1024", 137 | "idiom" : "ios-marketing", 138 | "filename" : "icon-1024.png", 139 | "scale" : "1x" 140 | } 141 | ], 142 | "info" : { 143 | "version" : 1, 144 | "author" : "xcode" 145 | } 146 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-120.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-152.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-167.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-180.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-58.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/AppIcon.appiconset/icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/AppIcon.appiconset/icon-80.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/HeaderImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "header.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "appearances" : [ 10 | { 11 | "appearance" : "luminosity", 12 | "value" : "dark" 13 | } 14 | ], 15 | "filename" : "headerDark.png", 16 | "idiom" : "universal", 17 | "scale" : "1x" 18 | }, 19 | { 20 | "filename" : "header@2x.png", 21 | "idiom" : "universal", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "appearances" : [ 26 | { 27 | "appearance" : "luminosity", 28 | "value" : "dark" 29 | } 30 | ], 31 | "filename" : "headerDark@2x.png", 32 | "idiom" : "universal", 33 | "scale" : "2x" 34 | }, 35 | { 36 | "filename" : "header@3x.png", 37 | "idiom" : "universal", 38 | "scale" : "3x" 39 | }, 40 | { 41 | "appearances" : [ 42 | { 43 | "appearance" : "luminosity", 44 | "value" : "dark" 45 | } 46 | ], 47 | "filename" : "headerDark@3x.png", 48 | "idiom" : "universal", 49 | "scale" : "3x" 50 | } 51 | ], 52 | "info" : { 53 | "author" : "xcode", 54 | "version" : 1 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/HeaderImage.imageset/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/HeaderImage.imageset/header.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/HeaderImage.imageset/header@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/HeaderImage.imageset/header@2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/HeaderImage.imageset/header@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/HeaderImage.imageset/header@3x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/HeaderImage.imageset/headerDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/HeaderImage.imageset/headerDark.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/HeaderImage.imageset/headerDark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/HeaderImage.imageset/headerDark@2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/HeaderImage.imageset/headerDark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/HeaderImage.imageset/headerDark@3x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/LaunchBackground.imageset/2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/LaunchBackground.imageset/2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/LaunchBackground.imageset/2xDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/LaunchBackground.imageset/2xDark.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "dark" 12 | } 13 | ], 14 | "idiom" : "universal", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "filename" : "2x.png", 19 | "idiom" : "universal", 20 | "scale" : "2x" 21 | }, 22 | { 23 | "appearances" : [ 24 | { 25 | "appearance" : "luminosity", 26 | "value" : "dark" 27 | } 28 | ], 29 | "filename" : "2xDark.png", 30 | "idiom" : "universal", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "universal", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "appearances" : [ 39 | { 40 | "appearance" : "luminosity", 41 | "value" : "dark" 42 | } 43 | ], 44 | "idiom" : "universal", 45 | "scale" : "3x" 46 | } 47 | ], 48 | "info" : { 49 | "author" : "xcode", 50 | "version" : 1 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/LaunchCenter.imageset/2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/LaunchCenter.imageset/2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/LaunchCenter.imageset/2xDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/LaunchCenter.imageset/2xDark.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/LaunchCenter.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "dark" 12 | } 13 | ], 14 | "idiom" : "universal", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "filename" : "2x.png", 19 | "idiom" : "universal", 20 | "scale" : "2x" 21 | }, 22 | { 23 | "appearances" : [ 24 | { 25 | "appearance" : "luminosity", 26 | "value" : "dark" 27 | } 28 | ], 29 | "filename" : "2xDark.png", 30 | "idiom" : "universal", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "universal", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "appearances" : [ 39 | { 40 | "appearance" : "luminosity", 41 | "value" : "dark" 42 | } 43 | ], 44 | "idiom" : "universal", 45 | "scale" : "3x" 46 | } 47 | ], 48 | "info" : { 49 | "author" : "xcode", 50 | "version" : 1 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/NavBarImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "dark" 12 | } 13 | ], 14 | "idiom" : "universal", 15 | "scale" : "1x" 16 | }, 17 | { 18 | "filename" : "navBar.png", 19 | "idiom" : "universal", 20 | "scale" : "2x" 21 | }, 22 | { 23 | "appearances" : [ 24 | { 25 | "appearance" : "luminosity", 26 | "value" : "dark" 27 | } 28 | ], 29 | "filename" : "navBarDark.png", 30 | "idiom" : "universal", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "universal", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "appearances" : [ 39 | { 40 | "appearance" : "luminosity", 41 | "value" : "dark" 42 | } 43 | ], 44 | "idiom" : "universal", 45 | "scale" : "3x" 46 | } 47 | ], 48 | "info" : { 49 | "author" : "xcode", 50 | "version" : 1 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/NavBarImage.imageset/navBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/NavBarImage.imageset/navBar.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/NavBarImage.imageset/navBarDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/NavBarImage.imageset/navBarDark.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/cast_off.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "cast_off-1.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "cast_off.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/cast_off.imageset/cast_off-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/cast_off.imageset/cast_off-1.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/cast_off.imageset/cast_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/cast_off.imageset/cast_off.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronDown.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chevron-down.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chevron-down@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "chevron-down@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronDown.imageset/chevron-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/chevronDown.imageset/chevron-down.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronDown.imageset/chevron-down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/chevronDown.imageset/chevron-down@2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronDown.imageset/chevron-down@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/chevronDown.imageset/chevron-down@3x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronUp.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chevron-up.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chevron-up@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "chevron-up@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronUp.imageset/chevron-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/chevronUp.imageset/chevron-up.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronUp.imageset/chevron-up@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/chevronUp.imageset/chevron-up@2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/chevronUp.imageset/chevron-up@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/chevronUp.imageset/chevron-up@3x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/eye.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "ios7-eye-29.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "ios7-eye-58.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "ios7-eye-87.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/eye.imageset/ios7-eye-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/eye.imageset/ios7-eye-29.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/eye.imageset/ios7-eye-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/eye.imageset/ios7-eye-58.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/eye.imageset/ios7-eye-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/eye.imageset/ios7-eye-87.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gear.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "ios7-gear-outline.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "ios7-gear-outline@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "ios7-gear-outline@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gear.imageset/ios7-gear-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gear.imageset/ios7-gear-outline.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gear.imageset/ios7-gear-outline@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gear.imageset/ios7-gear-outline@2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gear.imageset/ios7-gear-outline@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gear.imageset/ios7-gear-outline@3x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-car.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "car-36.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "car-72.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "car-108.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-car.imageset/car-108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-car.imageset/car-108.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-car.imageset/car-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-car.imageset/car-36.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-car.imageset/car-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-car.imageset/car-72.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-classic.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "classic-36.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "classic-72.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "classic-108.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-classic.imageset/classic-108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-classic.imageset/classic-108.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-classic.imageset/classic-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-classic.imageset/classic-36.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-classic.imageset/classic-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-classic.imageset/classic-72.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-motor.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "motor-36.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "motor-72.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "motor-108.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-motor.imageset/motor-108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-motor.imageset/motor-108.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-motor.imageset/motor-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-motor.imageset/motor-36.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-motor.imageset/motor-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-motor.imageset/motor-72.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-van.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "van-36.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "van-72.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "van-108.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-van.imageset/van-108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-van.imageset/van-108.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-van.imageset/van-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-van.imageset/van-36.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/gonative-van.imageset/van-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/gonative-van.imageset/van-72.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/leftImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "ios7-arrow-left.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "ios7-arrow-left@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/leftImage.imageset/ios7-arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/leftImage.imageset/ios7-arrow-left.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/leftImage.imageset/ios7-arrow-left@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/leftImage.imageset/ios7-arrow-left@2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/navImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "navicon.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "navicon@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "navicon@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/navImage.imageset/navicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/navImage.imageset/navicon.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/navImage.imageset/navicon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/navImage.imageset/navicon@2x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/navImage.imageset/navicon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/navImage.imageset/navicon@3x.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/rightImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "ios7-arrow-right.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "ios7-arrow-right@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/rightImage.imageset/ios7-arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/rightImage.imageset/ios7-arrow-right.png -------------------------------------------------------------------------------- /LeanIOS/Images.xcassets/rightImage.imageset/ios7-arrow-right@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/Images.xcassets/rightImage.imageset/ios7-arrow-right@2x.png -------------------------------------------------------------------------------- /LeanIOS/LEANActionManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANActionManager.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 11/25/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LEANWebViewController.h" 11 | 12 | @interface LEANActionManager : NSObject 13 | @property NSMutableArray *items; 14 | @property(readonly, assign) NSString *currentSearchTemplateUrl; 15 | 16 | - (instancetype)initWithWebviewController:(LEANWebViewController*)wvc; 17 | - (void)didLoadUrl:(NSURL*)url; 18 | @end 19 | -------------------------------------------------------------------------------- /LeanIOS/LEANAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANAppDelegate.h 3 | // LeanIOS 4 | // 5 | // Created by Weiyin He on 2/10/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Reachability.h" 11 | #import "GNRegistrationManager.h" 12 | @import GoNativeCore; 13 | 14 | @interface LEANAppDelegate : UIResponder 15 | 16 | @property (strong, nonatomic) UIWindow *window; 17 | @property (strong, nonatomic) GNRegistrationManager *registration; 18 | @property Reachability *internetReachability; 19 | @property BOOL isFirstLaunch; 20 | @property NSString *previousInitialUrl; 21 | @property NSString *apnsToken; 22 | @property (strong, nonatomic) GNBridge *bridge; 23 | 24 | - (void)configureApplication; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /LeanIOS/LEANConfigUpdater.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANConfigUpdater.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 7/22/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANConfigUpdater : NSObject 12 | 13 | + (void)registerEvent:(NSString*)event data:(NSDictionary*)data; 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /LeanIOS/LEANConfigUpdater.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANConfigUpdater.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 7/22/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "LEANConfigUpdater.h" 10 | #import "LEANInstallation.h" 11 | 12 | @interface LEANConfigUpdater () 13 | 14 | @end 15 | 16 | @implementation LEANConfigUpdater 17 | 18 | + (void)registerEvent:(NSString*)event data:(NSDictionary *)data 19 | { 20 | if (!event || [GoNativeAppConfig sharedAppConfig].disableEventRecorder) { 21 | return; 22 | } 23 | 24 | NSMutableDictionary *dict = [[LEANInstallation info] mutableCopy]; 25 | dict[@"event"] = event; 26 | if (data) { 27 | dict[@"additionalData"] = data; 28 | } 29 | 30 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:nil]; 31 | 32 | NSURL *url = [NSURL URLWithString:@"https://events.gonative.io/api/events/new"]; 33 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 34 | [request setHTTPMethod:@"POST"]; 35 | [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; 36 | [request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; 37 | [request setHTTPBody:jsonData]; 38 | 39 | NSURLSession *session = [NSURLSession sharedSession]; 40 | NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { 41 | }]; 42 | [task resume]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /LeanIOS/LEANDlogDefinition.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANDlogDefinition.h 3 | // GoNativeIOS 4 | // 5 | // Created by Anuj Sevak on 2021-06-23. 6 | // Copyright © 2021 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #define DLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) 10 | -------------------------------------------------------------------------------- /LeanIOS/LEANDocumentSharer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANDocumentSharer.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 8/26/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANDocumentSharer : NSObject 12 | + (LEANDocumentSharer*)sharedSharer; 13 | - (void)downloadImage:(NSURL*)url; 14 | - (BOOL)isSharableRequest:(NSURLRequest*)req; 15 | - (void)shareRequest:(NSURLRequest *)req fromButton:(UIBarButtonItem*) button; 16 | - (void)shareUrl:(NSURL*)url fromView:(UIView*)view; 17 | - (void)shareUrl:(NSURL*)url fromView:(UIView*)view filename:(NSString*)filename; 18 | - (void)receivedRequest:(NSURLRequest*)request; 19 | - (void)receivedResponse:(NSURLResponse*)response; 20 | - (void)receivedWebviewResponse:(NSURLResponse*)response; 21 | - (void)receivedData:(NSData*)data; 22 | - (void)cancel; 23 | - (void)finish; 24 | @end 25 | -------------------------------------------------------------------------------- /LeanIOS/LEANIcons.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LEANIcons.swift 3 | // GonativeIO 4 | // 5 | // Created by Anuj Sevak on 2021-04-21. 6 | // Copyright © 2021 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import GonativeIcons 11 | 12 | @objc class LEANIcons: NSObject { 13 | @objc public static let sharedIcons = LEANIcons() 14 | 15 | @objc public class func imageForIconIdentifier(_ name: String, size: CGFloat, color: UIColor) -> UIImage? { 16 | return UIImage.init(iconName: name, size: size, color: color) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LeanIOS/LEANInstallation.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANInstallation.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 8/9/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANInstallation : NSObject 12 | 13 | + (NSDictionary*)info; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /LeanIOS/LEANInstallation.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANInstallation.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 8/9/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "LEANInstallation.h" 10 | #import "LEANAppDelegate.h" 11 | #import 12 | #import 13 | #import 14 | 15 | @implementation LEANInstallation 16 | 17 | + (NSDictionary*)info 18 | { 19 | NSString *publicKey = [GoNativeAppConfig sharedAppConfig].publicKey; 20 | if (!publicKey) publicKey = @""; 21 | 22 | BOOL debug = NO; 23 | #ifdef DEBUG 24 | debug = YES; 25 | #endif 26 | 27 | struct utsname systemInfo; 28 | uname(&systemInfo); 29 | NSString *hardware = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; 30 | if (!hardware) hardware = @""; 31 | 32 | 33 | NSString *distribution; 34 | if (debug) { 35 | distribution = @"debug"; 36 | } else if ([[NSUserDefaults standardUserDefaults] objectForKey:@"isAppio"]) { 37 | distribution = @"appio"; 38 | } else if ([[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) { 39 | distribution = @"adhoc"; 40 | } else { 41 | distribution = @"appstore"; 42 | } 43 | 44 | NSBundle *mainBundle = [NSBundle mainBundle]; 45 | NSDictionary *bundleInfo = mainBundle.infoDictionary; 46 | 47 | NSString *bundleId = mainBundle.bundleIdentifier; 48 | if (!bundleId) bundleId = @""; 49 | 50 | NSString *appBuild = bundleInfo[(NSString*)kCFBundleVersionKey]; 51 | if (!appBuild) appBuild = @""; 52 | 53 | NSString *appVersion = bundleInfo[@"CFBundleShortVersionString"]; 54 | if (!appVersion) appVersion = @""; 55 | 56 | NSString *language = [[NSLocale preferredLanguages] firstObject]; 57 | UIDevice *device = [UIDevice currentDevice]; 58 | NSString *timeZone = [[NSTimeZone localTimeZone] name]; 59 | 60 | NSMutableDictionary *info = [@{@"platform": @"ios", 61 | @"publicKey": publicKey, 62 | @"appId": bundleId, 63 | @"appVersion": appVersion, 64 | @"appBuild": appBuild, 65 | @"distribution": distribution, 66 | @"language": language, 67 | @"os": device.systemName, 68 | @"osVersion": device.systemVersion, 69 | @"model": device.model, 70 | @"timeZone": timeZone, 71 | @"hardware": hardware, 72 | @"installationId": [device.identifierForVendor UUIDString], 73 | @"deviceName": device.name} mutableCopy]; 74 | 75 | LEANAppDelegate *appDelegate = (LEANAppDelegate*)[UIApplication sharedApplication].delegate; 76 | info[@"isFirstLaunch"] = [NSNumber numberWithBool:appDelegate.isFirstLaunch]; 77 | 78 | #if !(TARGET_IPHONE_SIMULATOR) 79 | CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; 80 | NSMutableArray *carrierNames = [NSMutableArray array]; 81 | if (netinfo) { 82 | NSDictionary *carriers = netinfo.serviceSubscriberCellularProviders; 83 | NSString *carrierName = [[carriers allValues] firstObject].carrierName; 84 | if (carrierName) { 85 | info[@"carrierName"] = carrierName; 86 | } 87 | 88 | [carriers enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, CTCarrier * _Nonnull obj, BOOL * _Nonnull stop) { 89 | if (obj.carrierName) { 90 | [carrierNames addObject:obj.carrierName]; 91 | } 92 | }]; 93 | } 94 | info[@"carrierNames"] = carrierNames; 95 | #endif 96 | 97 | return info; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /LeanIOS/LEANJsCustomCodeExecutor.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANJsCustomCodeExecutor.h 3 | // GonativeIO 4 | // 5 | // Created by BSC Dev on 07.06.21. 6 | // Copyright © 2021 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol CustomCodeHandler 14 | - (NSDictionary*)execute:(NSDictionary*)params; 15 | @end 16 | 17 | @interface LEANJsCustomCodeExecutor : NSObject 18 | + (NSDictionary*)execute:(NSDictionary*)params; 19 | + (void)setHandler:(NSObject*)customHandler; 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /LeanIOS/LEANJsCustomCodeExecutor.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANJsCustomCodeExecutor.m 3 | // GonativeIO 4 | // 5 | // Created by BSC Dev on 07.06.21. 6 | // Copyright © 2021 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "LEANJsCustomCodeExecutor.h" 10 | 11 | static NSObject* _handler = nil; 12 | 13 | // The default CustomVCodeHandler "Echo" 14 | // Simply returns the given NSDictionary 15 | @interface EchoHandler : NSObject 16 | @end 17 | 18 | @implementation EchoHandler 19 | - (NSDictionary*)execute:(NSDictionary*)params { 20 | return params; 21 | } 22 | @end 23 | 24 | 25 | @implementation LEANJsCustomCodeExecutor 26 | 27 | /** 28 | * Sets new CustomCodeHandler to override the default EchoHandler 29 | * @param customHandler The new Code Handler 30 | */ 31 | + (void)setHandler:(NSObject*)customHandler { 32 | if(customHandler == nil) 33 | return; 34 | _handler = customHandler; 35 | } 36 | 37 | /** 38 | * Code Handler gets triggered by the LEANWebViewController class 39 | * * 40 | * @param params An NSDictionary consisting of all URI parameters and their values 41 | * @return An NSDictionary as defined by the Code Handler 42 | */ 43 | + (NSDictionary*)execute:(NSDictionary*)params { 44 | if(_handler == nil) { 45 | _handler = [[EchoHandler alloc]init]; 46 | } 47 | 48 | @try { 49 | return [_handler execute:params]; 50 | } @catch(NSException *exception) { 51 | NSLog(@"%@ %@", @"Error executing custom code", exception.reason); 52 | } @finally { 53 | } 54 | 55 | return nil; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /LeanIOS/LEANLaunchScreenManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANLaunchScreenManager.h 3 | // Median 4 | // 5 | // Created by bld on 8/11/23. 6 | // Copyright © 2023 Median. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANLaunchScreenManager : NSObject 12 | + (LEANLaunchScreenManager *)sharedManager; 13 | - (void)show; 14 | - (void)hide; 15 | - (void)hideAfterDelay:(double)delay; 16 | @end 17 | -------------------------------------------------------------------------------- /LeanIOS/LEANLaunchScreenManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANLaunchScreenManager.m 3 | // Median 4 | // 5 | // Created by bld on 8/11/23. 6 | // Copyright © 2023 Median. All rights reserved. 7 | // 8 | 9 | #import "LEANLaunchScreenManager.h" 10 | 11 | @interface LEANLaunchScreenManager() 12 | @property UIImageView *launchScreen; 13 | @end 14 | 15 | @implementation LEANLaunchScreenManager 16 | 17 | + (LEANLaunchScreenManager *)sharedManager { 18 | static LEANLaunchScreenManager *shared; 19 | @synchronized(self) { 20 | if (!shared) { 21 | shared = [[LEANLaunchScreenManager alloc] init]; 22 | } 23 | return shared; 24 | } 25 | } 26 | 27 | - (void)show { 28 | self.launchScreen = [[UIImageView alloc] initWithFrame:UIScreen.mainScreen.bounds]; 29 | self.launchScreen.image = [UIImage imageNamed:@"LaunchBackground"]; 30 | self.launchScreen.clipsToBounds = YES; 31 | 32 | UIImageView *centerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200, 400)]; 33 | centerImageView.image = [UIImage imageNamed:@"LaunchCenter"]; 34 | centerImageView.contentMode = UIViewContentModeScaleAspectFit; 35 | centerImageView.center = CGPointMake(self.launchScreen.bounds.size.width / 2, self.launchScreen.bounds.size.height / 2); 36 | [self.launchScreen addSubview:centerImageView]; 37 | 38 | UIWindow *currentWindow = [UIApplication sharedApplication].windows.lastObject; 39 | [currentWindow addSubview:self.launchScreen]; 40 | } 41 | 42 | - (void)hide { 43 | if (self.launchScreen) { 44 | [self.launchScreen removeFromSuperview]; 45 | self.launchScreen = nil; 46 | } 47 | } 48 | 49 | - (void)hideAfterDelay:(double)delay { 50 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 51 | [self hide]; 52 | }); 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /LeanIOS/LEANLoginManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANLoginManager.h 3 | // LeanIOS 4 | // 5 | // Created by Weiyin He on 2/12/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | static NSString *kLEANLoginManagerNotificationName = @"io.gonative.ios.LoginManagerNotification"; 12 | static NSString *kLEANLoginManagerStatusChangedNotification = @"io.gonative.ios.LoginManager.statusChanged"; 13 | 14 | @interface LEANLoginManager : NSObject 15 | @property BOOL loggedIn; 16 | @property NSString *loginStatus; 17 | 18 | // singleton 19 | +(LEANLoginManager*)sharedManager; 20 | 21 | // force a check. Interrupts pending check. Use this if it's highly likely the state has changed. 22 | -(void) checkLogin; 23 | 24 | // Run a check if there is not one already pending. 25 | -(void) checkIfNotAlreadyChecking; 26 | 27 | -(void) stopChecking; 28 | @end 29 | -------------------------------------------------------------------------------- /LeanIOS/LEANMenuViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANMenuViewController.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 2/7/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "REFrostedViewController.h" 11 | #import "LEANLoginManager.h" 12 | 13 | @interface LEANMenuViewController : UITableViewController 14 | - (void)updateMenuWithStatus:(NSString*)status; 15 | - (void)parseProfilePickerJSON:(NSString*)json; 16 | @end 17 | -------------------------------------------------------------------------------- /LeanIOS/LEANNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANNavigationController.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 2/8/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "REFrostedViewController.h" 11 | 12 | @interface LEANNavigationController : UINavigationController 13 | @property BOOL sidebarEnabled; 14 | - (void)panGestureRecognized:(UIPanGestureRecognizer *)sender; 15 | @end 16 | -------------------------------------------------------------------------------- /LeanIOS/LEANNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANNavigationController.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 2/8/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "LEANNavigationController.h" 10 | #import "LEANWebViewController.h" 11 | #import "LEANRootViewController.h" 12 | 13 | @interface LEANNavigationController () 14 | @end 15 | 16 | @implementation LEANNavigationController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | 22 | GoNativeAppConfig *appConfig = [GoNativeAppConfig sharedAppConfig]; 23 | 24 | // recognize swipe from left edge 25 | if (appConfig.showNavigationMenu) { 26 | self.sidebarEnabled = YES; 27 | UIScreenEdgePanGestureRecognizer *r = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)]; 28 | if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.view.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) { 29 | r.edges = UIRectEdgeRight; 30 | } else { 31 | r.edges = UIRectEdgeLeft; 32 | } 33 | [self.view addGestureRecognizer:r]; 34 | } else { 35 | self.sidebarEnabled = NO; 36 | } 37 | 38 | self.delegate = self; 39 | } 40 | 41 | -(void)viewDidLayoutSubviews 42 | { 43 | GoNativeAppConfig *appConfig = [GoNativeAppConfig sharedAppConfig]; 44 | 45 | // theme and colors 46 | if ([appConfig.iosTheme isEqualToString:@"dark"]) { 47 | self.navigationBar.barStyle = UIBarStyleBlack; 48 | self.view.backgroundColor = [UIColor blackColor]; 49 | } else { 50 | self.navigationBar.barStyle = UIBarStyleDefault; 51 | 52 | if (@available(iOS 12.0, *)) { 53 | if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { 54 | self.view.backgroundColor = [UIColor blackColor]; 55 | } else { 56 | self.view.backgroundColor = [UIColor whiteColor]; 57 | } 58 | } else { 59 | self.view.backgroundColor = [UIColor whiteColor]; 60 | } 61 | } 62 | 63 | UIColor *titleColor = [UIColor colorNamed:@"titleColor"]; 64 | UIColor *navBarTintColor = [UIColor colorNamed:@"navigationBarTintColor"]; 65 | NSDictionary *titleTextAttributes = @{NSForegroundColorAttributeName: titleColor}; 66 | self.navigationBar.titleTextAttributes = titleTextAttributes; 67 | self.navigationBar.barTintColor = navBarTintColor; 68 | 69 | if (@available(iOS 13.0, *)) { 70 | UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init]; 71 | [appearance configureWithOpaqueBackground]; 72 | [appearance setBackgroundColor:navBarTintColor]; 73 | [appearance setTitleTextAttributes:titleTextAttributes]; 74 | [self.navigationBar setStandardAppearance:appearance]; 75 | [self.navigationBar setScrollEdgeAppearance:appearance]; 76 | } 77 | 78 | [super viewDidLayoutSubviews]; 79 | } 80 | 81 | - (UIViewController *)childViewControllerForStatusBarStyle { 82 | return self.visibleViewController; 83 | } 84 | 85 | #pragma mark - UINavigationControllerDelegate 86 | - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated 87 | { 88 | if ([viewController isKindOfClass:[LEANWebViewController class]] && [GoNativeAppConfig sharedAppConfig].showToolbar) { 89 | [navigationController setToolbarHidden:NO animated:YES]; 90 | } 91 | else { 92 | [navigationController setToolbarHidden:YES animated:YES]; 93 | } 94 | 95 | 96 | } 97 | 98 | #pragma mark - Gesture recognizer 99 | 100 | - (void)panGestureRecognized:(UIScreenEdgePanGestureRecognizer *)sender 101 | { 102 | if (self.sidebarEnabled) { 103 | [self.frostedViewController panGestureRecognized:sender]; 104 | } 105 | } 106 | 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /LeanIOS/LEANProfilePicker.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANProfilePicker.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 5/14/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANProfilePicker : NSObject 12 | 13 | @property NSMutableArray *names; 14 | @property NSMutableArray *links; 15 | @property NSInteger selectedIndex; 16 | 17 | - (void)parseJson:(NSString*)json; 18 | - (BOOL)hasProfiles; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /LeanIOS/LEANProfilePicker.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANProfilePicker.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 5/14/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "LEANProfilePicker.h" 10 | 11 | @interface LEANProfilePicker () 12 | @end 13 | 14 | @implementation LEANProfilePicker 15 | 16 | - (id) init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | self.names = [[NSMutableArray alloc] init]; 21 | self.links = [[NSMutableArray alloc] init]; 22 | self.selectedIndex = -1; 23 | } 24 | 25 | return self; 26 | } 27 | 28 | - (void)parseJson:(NSString*)json; 29 | { 30 | id parsed = [NSJSONSerialization JSONObjectWithData:[json dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]; 31 | if (![parsed isKindOfClass:[NSArray class]]) { 32 | // don't do anything if not array 33 | return; 34 | } 35 | 36 | [self.names removeAllObjects]; 37 | [self.links removeAllObjects]; 38 | 39 | for (int i = 0; i < [parsed count]; i++) { 40 | id profile = parsed[i]; 41 | if (![profile isKindOfClass:[NSDictionary class]]) { 42 | continue; 43 | } 44 | 45 | [self.names addObject:profile[@"name"]]; 46 | [self.links addObject:profile[@"link"]]; 47 | if ([profile[@"selected"] boolValue]) { 48 | self.selectedIndex = i; 49 | } 50 | } 51 | 52 | } 53 | 54 | - (BOOL)hasProfiles 55 | { 56 | return [self.names count] > 0; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /LeanIOS/LEANRegexRulesManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANRegexRulesManager.h 3 | // GoNativeIOS 4 | // 5 | // Created by bld ai on 6/14/22. 6 | // Copyright © 2022 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LEANWebViewController.h" 11 | 12 | @interface LEANRegexRulesManager : NSObject 13 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query; 14 | - (void)setRules:(NSArray *)rules; 15 | - (NSDictionary *)matchesWithUrlString:(NSString *)urlString; 16 | @end 17 | -------------------------------------------------------------------------------- /LeanIOS/LEANRegexRulesManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANRegexRulesManager.m 3 | // GonativeIO 4 | // 5 | // Created by bld ai on 6/14/22. 6 | // Copyright © 2022 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "LEANRegexRulesManager.h" 10 | #import "GonativeIO-Swift.h" 11 | 12 | @interface LEANRegexRulesManager() 13 | @property NSArray *regexes; 14 | @property NSArray *isInternal; 15 | @end 16 | 17 | @implementation LEANRegexRulesManager 18 | 19 | - (instancetype)init 20 | { 21 | self = [super init]; 22 | if (self) { 23 | [self initializeValues]; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)initializeValues { 29 | NSArray *regexArray; 30 | NSArray *isInternalArray; 31 | [[GoNativeAppConfig sharedAppConfig] initializeRegexRules:®exArray isInternalArray:&isInternalArray]; 32 | self.regexes = regexArray; 33 | self.isInternal = isInternalArray; 34 | } 35 | 36 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query { 37 | if ([@"/set" isEqualToString:url.path]) { 38 | [self setRules:query[@"rules"]]; 39 | } 40 | } 41 | 42 | - (void)setRules:(NSArray *)rules { 43 | if (rules != nil && ![rules isKindOfClass:[NSArray class]]) return; 44 | NSArray *regexArray; 45 | NSArray *isInternalArray; 46 | [[GoNativeAppConfig sharedAppConfig] setRegexRules:rules regexArray:®exArray isInternalArray:&isInternalArray]; 47 | self.regexes = regexArray; 48 | self.isInternal = isInternalArray; 49 | } 50 | 51 | - (NSDictionary *)matchesWithUrlString:(NSString *)urlString { 52 | for (NSUInteger i = 0; i < [self.regexes count] && i < [self.isInternal count]; i++) { 53 | NSPredicate *predicate = self.regexes[i]; 54 | 55 | if (![predicate isKindOfClass:[NSPredicate class]]) continue; 56 | 57 | @try { 58 | if ([predicate evaluateWithObject:urlString]) { 59 | BOOL isInternal = [self.isInternal[i] boolValue]; 60 | return @{ @"matches": @YES, @"isInternal": @(isInternal) }; 61 | } 62 | } 63 | @catch (NSException* exception) { 64 | NSLog(@"Error in regex internal external: %@", exception); 65 | } 66 | } 67 | return @{ @"matches": @NO }; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /LeanIOS/LEANRootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANRootViewController.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 2/7/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "REFrostedViewController.h" 10 | #import "LEANWebViewController.h" 11 | 12 | @interface LEANRootViewController : REFrostedViewController 13 | 14 | @property LEANWebViewController *webViewController; 15 | 16 | // these are run on the top-most webview 17 | - (void)loadUrl:(NSURL*)url; 18 | - (void)loadUrlUsingJavascript:(NSURL *)url; 19 | - (void)runJavascript:(NSString*)js; 20 | 21 | - (BOOL)webviewOnTop; 22 | - (void)setInitialUrl:(NSURL *)url; // for initial launch from push notification 23 | - (void)presentAlert:(UIAlertController*)alert; 24 | @end 25 | -------------------------------------------------------------------------------- /LeanIOS/LEANTabManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANTabManager.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 8/14/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LEANWebViewController.h" 11 | 12 | @interface LEANTabManager : NSObject 13 | - (instancetype)initWithTabBar:(UITabBar*)tabBar webviewController:(LEANWebViewController*)wvc; 14 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query; 15 | - (void)didLoadUrl:(NSURL*)url; 16 | - (void)selectTabWithUrl:(NSString*)url javascript:(NSString*)javascript; 17 | - (void)autoSelectTabForUrl:(NSURL*)url; 18 | - (void)selectTabNumber:(NSUInteger)number; 19 | - (void)deselectTabs; 20 | - (void)setTabsWithJson:(NSDictionary*)json; 21 | - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection; 22 | 23 | @property BOOL javascriptTabs; // disables auto-loading of tabs from config 24 | @end 25 | -------------------------------------------------------------------------------- /LeanIOS/LEANToolbarManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANToolbarManager.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 5/20/15. 6 | // Copyright (c) 2015 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LEANWebViewController.h" 11 | 12 | @interface LEANToolbarManager : NSObject 13 | - (instancetype)initWithToolbar:(UIToolbar*)toolbar webviewController:(LEANWebViewController*)wvc; 14 | - (void)handleUrl:(NSURL *)url query:(NSDictionary*)query; 15 | - (void)didLoadUrl:(NSURL*)url; 16 | - (void)setToolbarEnabled:(BOOL)enabled; 17 | @property NSString *urlMimeType; 18 | @end 19 | -------------------------------------------------------------------------------- /LeanIOS/LEANUrlCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANUrlCache.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 6/4/14. 6 | // Copyright (c) 2014 The Lean App. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANUrlCache : NSObject 12 | - (BOOL)hasCacheForRequest:(NSURLRequest*)request; 13 | - (NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request; 14 | @end 15 | -------------------------------------------------------------------------------- /LeanIOS/LEANUrlCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANUrlCache.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 6/4/14. 6 | // Copyright (c) 2014 The Lean App. All rights reserved. 7 | // 8 | 9 | #import "LEANUrlCache.h" 10 | #import 11 | 12 | @interface LEANUrlCache () 13 | @property ZZArchive *cacheFile; 14 | @property id manifest; 15 | @property NSMutableDictionary *urlsToManifest; 16 | @property NSMutableDictionary *filesToEntries; 17 | @end 18 | 19 | @implementation LEANUrlCache 20 | 21 | - (instancetype)init 22 | { 23 | self = [super init]; 24 | if (self) { 25 | self.urlsToManifest = [[NSMutableDictionary alloc] init]; 26 | 27 | NSURL *path = [[NSBundle mainBundle] URLForResource:@"localCache" withExtension:@"zip"]; 28 | self.cacheFile = [ZZArchive archiveWithURL:path error:nil]; 29 | self.filesToEntries = [[NSMutableDictionary alloc] init]; 30 | 31 | for (ZZArchiveEntry *entry in self.cacheFile.entries) { 32 | [self.filesToEntries setObject:entry forKey:entry.fileName]; 33 | 34 | if ([entry.fileName isEqualToString:@"manifest.json"]) { 35 | NSInputStream *inputStream = [entry newStreamWithError:nil]; 36 | [inputStream open]; 37 | self.manifest = [NSJSONSerialization JSONObjectWithStream:inputStream options:0 error:nil]; 38 | [inputStream close]; 39 | } 40 | } 41 | 42 | // process 43 | if (self.manifest) { 44 | for (id file in self.manifest[@"files"]) { 45 | NSString *temp = [LEANUrlCache urlWithoutProtocol:file[@"url"]]; 46 | [self.urlsToManifest setObject:file forKey:temp]; 47 | } 48 | } 49 | } 50 | 51 | return self; 52 | } 53 | 54 | - (BOOL)hasCacheForRequest:(NSURLRequest*)request 55 | { 56 | if (!self.urlsToManifest) return NO; 57 | 58 | NSString *urlString = [LEANUrlCache urlWithoutProtocol:[[request URL] absoluteString]]; 59 | id cached = self.urlsToManifest[urlString]; 60 | if (cached) { 61 | return YES; 62 | } else { 63 | return NO; 64 | } 65 | } 66 | 67 | - (NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request 68 | { 69 | if (!self.urlsToManifest) return nil; 70 | 71 | NSString *urlString = [LEANUrlCache urlWithoutProtocol:[[request URL] absoluteString]]; 72 | id cached = self.urlsToManifest[urlString]; 73 | if (cached) { 74 | NSString *internalPath = cached[@"path"]; 75 | ZZArchiveEntry *entry = self.filesToEntries[internalPath]; 76 | if (entry) { 77 | NSError *zipError; 78 | NSData *data = [entry newDataWithError:&zipError]; 79 | 80 | if (!zipError) { 81 | NSString *mimeType = cached[@"mimetype"]; 82 | NSURLResponse *response = [[NSURLResponse alloc] initWithURL:[request URL] MIMEType:mimeType expectedContentLength:entry.uncompressedSize textEncodingName:nil]; 83 | NSCachedURLResponse *cachedResponse = [[NSCachedURLResponse alloc] initWithResponse:response data:data]; 84 | 85 | return cachedResponse; 86 | } 87 | } 88 | 89 | } 90 | 91 | return nil; 92 | } 93 | 94 | + (NSString*)urlWithoutProtocol:(NSString*)url 95 | { 96 | NSRange loc = [url rangeOfString:@":"]; 97 | if (loc.location == NSNotFound) { 98 | return url; 99 | } else { 100 | return [url substringFromIndex:loc.location+1]; 101 | } 102 | 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /LeanIOS/LEANUrlInspector.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANUrlInspector.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 4/22/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANUrlInspector : NSObject 12 | 13 | @property NSString *userId; 14 | 15 | - (void)setup; 16 | + (LEANUrlInspector*)sharedInspector; 17 | - (void)inspectUrl:(NSURL*)url; 18 | @end 19 | -------------------------------------------------------------------------------- /LeanIOS/LEANUrlInspector.m: -------------------------------------------------------------------------------- 1 | // 2 | // LEANUrlInspector.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 4/22/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "LEANUrlInspector.h" 10 | 11 | @interface LEANUrlInspector () 12 | @property NSRegularExpression *userIdRegex; 13 | @end 14 | 15 | @implementation LEANUrlInspector 16 | 17 | + (LEANUrlInspector *)sharedInspector 18 | { 19 | static LEANUrlInspector *sharedInspector; 20 | 21 | @synchronized(self) 22 | { 23 | if (!sharedInspector){ 24 | sharedInspector = [[LEANUrlInspector alloc] init]; 25 | [sharedInspector setup]; 26 | } 27 | 28 | return sharedInspector; 29 | } 30 | } 31 | 32 | - (void)setup 33 | { 34 | self.userId = @""; 35 | if ([GoNativeAppConfig sharedAppConfig].userIdRegex) { 36 | self.userIdRegex = [NSRegularExpression regularExpressionWithPattern:[GoNativeAppConfig sharedAppConfig].userIdRegex options:0 error:nil]; 37 | } else { 38 | self.userIdRegex = nil; 39 | } 40 | } 41 | 42 | - (void)inspectUrl:(NSURL *)url 43 | { 44 | NSString *urlString = [url absoluteString]; 45 | 46 | NSTextCheckingResult *result = [self.userIdRegex firstMatchInString:urlString options:0 range:NSMakeRange(0, [urlString length])]; 47 | 48 | // first range is the entire regex. Second range is the (selection) 49 | if ([result numberOfRanges] >= 2) { 50 | self.userId = [urlString substringWithRange:[result rangeAtIndex:1]]; 51 | } 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /LeanIOS/LEANUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // LeanUtilities.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 2/4/14. 6 | // Copyright (c) 2014 Weiyin He. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface LEANUtilities : NSObject 13 | + (NSDictionary*) dictionaryFromQueryString: (NSString*) string; 14 | +(NSString*)urlEscapeString:(NSString *)unencodedString; 15 | +(NSString*)urlQueryStringWithDictionary:(NSDictionary*) dictionary; 16 | +(NSString*)addQueryStringToUrlString:(NSString *)urlString withDictionary:(NSDictionary *)dictionary; 17 | +(NSDictionary*)parseQueryParamsWithUrl:(NSURL*)url; 18 | +(NSURL*)urlWithString:(NSString*)string; 19 | +(NSString*)utiFromMimetype:(NSString*)mimeType; 20 | +(BOOL)isValidEmail:(NSString*)email; 21 | +(NSString *)stripHTML:(NSString*)x replaceWith:(NSString*) replacement; 22 | + (UIColor *)colorFromHexString:(NSString *)hexString; 23 | +(UIColor*)colorWithAlphaFromHexString:(NSString*)hexString; 24 | + (void)overrideGeolocation:(UIView*)webview; 25 | + (void)matchStatusBarToBodyBackgroundColor:(WKWebView *)webview enabled:(BOOL)enabled; 26 | +(NSString*)jsWrapString:(NSString*)string; 27 | +(NSString*)capitalizeWords:(NSString*)string; 28 | +(NSString*)getLaunchImageName; 29 | +(void)configureWebView:(UIView*)webview; 30 | + (WKProcessPool *)wkProcessPool; 31 | +(NSArray*)createRegexArrayFromStrings:(id)input; 32 | +(BOOL)string:(NSString*)string matchesAnyRegex:(NSArray*)regexes; 33 | +(NSString*)createJsForPostTo:(NSString*)url data:(NSDictionary*)data; 34 | +(NSString*)createJsForCallback:(NSString*)functionName data:(NSDictionary*)data; 35 | +(BOOL)checkNativeBridgeUrl:(NSString*)url; 36 | +(BOOL)cookie:(NSHTTPCookie*)cookie matchesUrl:(NSURL*)url; 37 | @end 38 | -------------------------------------------------------------------------------- /LeanIOS/LEANWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANWebViewController.h 3 | // LeanIOS 4 | // 5 | // Created by Weiyin He on 2/10/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "REFrostedViewController.h" 12 | #import "LEANProfilePicker.h" 13 | @class LEANTabManager; 14 | 15 | static NSString *kLEANWebViewControllerUserStartedLoading = @"io.gonative.ios.WebViewController.started"; 16 | static NSString *kLEANWebViewControllerUserFinishedLoading = @"io.gonative.ios.WebViewController.finished"; 17 | static NSString *kLEANWebViewControllerClearPools = @"io.gonative.ios.WebViewController.clearPools"; 18 | 19 | @interface LEANWebViewController : UIViewController 20 | @property BOOL checkLoginSignup; 21 | @property LEANTabManager *tabManager; 22 | @property NSURL *initialUrl; 23 | @property UIView *initialWebview; 24 | @property (class, nonatomic, readonly) NSInteger currentWindows; 25 | 26 | - (IBAction) showMenu; 27 | - (void) loadUrlString:(NSString*)url; 28 | - (void) loadUrlAfterFilter:(NSURL*) url; 29 | - (void) loadUrl:(NSURL*) url; 30 | - (void) loadRequest:(NSURLRequest*) request; 31 | - (void) loadUrl:(NSURL *)url andJavascript:(NSString*)js; 32 | - (void) runJavascript:(NSString *) script; 33 | - (void) logout; 34 | - (void) showTabBarAnimated:(BOOL)animated; 35 | - (void) hideTabBarAnimated:(BOOL)animated; 36 | - (void) showToolbarAnimated:(BOOL)animated; 37 | - (void) hideToolbarAnimated:(BOOL)animated; 38 | - (void) sharePage: (id)sender; 39 | - (void) sharePageWithUrl:(NSString*)url text:(NSString*)text sender:(id)sender; 40 | - (BOOL) canGoBack; 41 | - (void) goBack; 42 | - (BOOL) canGoForward; 43 | - (void) goForward; 44 | - (void) refreshPressed:(id)sender; 45 | - (void) refreshPage; 46 | - (void) searchPressed:(id)sender; 47 | - (void) setSharePopOverRect:(CGRect)rect; 48 | - (void) handleJSBridgeFunctions:(id)data; 49 | - (void) runJavascriptWithCallback:(NSString *)callback data:(NSDictionary*)data; 50 | @end 51 | -------------------------------------------------------------------------------- /LeanIOS/LEANWebViewIntercept.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANWebViewIntercept.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 4/12/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LEANWebViewIntercept : NSURLProtocol 12 | +(void)register; 13 | @end 14 | 15 | @interface LEANWebviewInterceptTracker : NSObject 16 | @property NSURLRequest *currentRequest; 17 | + (LEANWebviewInterceptTracker*)sharedTracker; 18 | @end 19 | -------------------------------------------------------------------------------- /LeanIOS/LEANWebViewPool.h: -------------------------------------------------------------------------------- 1 | // 2 | // LEANWebViewPool.h 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 8/18/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger, LEANWebViewPoolDisownPolicy) { 12 | LEANWebViewPoolDisownPolicyAlways, 13 | LEANWebViewPoolDisownPolicyReload, 14 | LEANWebViewPoolDisownPolicyNever 15 | }; 16 | 17 | static LEANWebViewPoolDisownPolicy kLEANWebViewPoolDisownPolicyDefault = LEANWebViewPoolDisownPolicyReload; 18 | 19 | @interface LEANWebViewPool : NSObject 20 | @property NSURLRequest *currentLoadingRequest; 21 | 22 | + (LEANWebViewPool*)sharedPool; 23 | 24 | - (void)setup; 25 | - (UIView*)webviewForUrl:(NSURL *)url policy:(LEANWebViewPoolDisownPolicy*)policy; 26 | - (void)disownWebview:(UIView*)webview; 27 | - (void)flushAll; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /LeanIOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /LeanIOS/LaunchScreenNav.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /LeanIOS/LaunchScreenNoNav.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LeanIOS/MenuChildIcon.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /LeanIOS/MenuChildNoIcon.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LeanIOS/MenuGroupIcon.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /LeanIOS/MenuGroupNoIcon.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LeanIOS/NSURL+LEANUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+LEANUtilities.h 3 | // LeanIOS 4 | // 5 | // Created by Weiyin He on 3/15/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSURL (LEANUtilities) 12 | 13 | - (BOOL)matchesPathOf:(NSURL*)url2; 14 | - (BOOL)matchesIgnoreAnchor:(NSURL*)url2; 15 | @end 16 | -------------------------------------------------------------------------------- /LeanIOS/NSURL+LEANUtilities.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+LEANUtilities.m 3 | // LeanIOS 4 | // 5 | // Created by Weiyin He on 3/15/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import "NSURL+LEANUtilities.h" 10 | 11 | @implementation NSURL (LEANUtilities) 12 | 13 | // compare two URLs to see if they match. Agnostic to query strings and paths that start with "//". 14 | // Also agnostic to "www." in hostname. 15 | - (BOOL)matchesPathOf:(NSURL*)url2 16 | { 17 | NSString *path1 = [self path]; 18 | NSString *path2 = [url2 path]; 19 | if ([path1 hasPrefix:@"//"]) { 20 | path1 = [path1 stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:@""]; 21 | } 22 | if ([path2 hasPrefix:@"//"]){ 23 | path2 = [path2 stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:@""]; 24 | } 25 | 26 | NSString *host1 = [self host]; 27 | NSString *host2 = [url2 host]; 28 | if ([host1 hasPrefix:@"www."]) 29 | host1 = [host1 stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@""]; 30 | if ([host2 hasPrefix:@"www."]) 31 | host2 = [host2 stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@""]; 32 | 33 | return [host1 isEqualToString:host2] && [path1 isEqualToString:path2]; 34 | } 35 | 36 | - (BOOL)matchesIgnoreAnchor:(NSURL*)url2 37 | { 38 | // consider it a match if both fields are null 39 | if (self.scheme || url2.scheme) { 40 | if (![self.scheme isEqualToString:url2.scheme]) return NO; 41 | } 42 | if (self.host || url2.host) { 43 | if (![self.host isEqualToString:url2.host]) return NO; 44 | } 45 | if (self.path || url2.path) { 46 | if (![self.path isEqualToString:url2.path]) return NO; 47 | } 48 | if (self.query || url2.query) { 49 | if (![self.query isEqualToString:url2.query]) return NO; 50 | } 51 | 52 | return YES; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /LeanIOS/REFrostedViewController/RECommonFunctions.h: -------------------------------------------------------------------------------- 1 | // 2 | // RECommonFunctions.h 3 | // REFrostedViewController 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | #ifndef REUIKitIsFlatMode 29 | #define REUIKitIsFlatMode() REFrostedViewControllerUIKitIsFlatMode() 30 | #endif 31 | 32 | BOOL REFrostedViewControllerUIKitIsFlatMode(void); -------------------------------------------------------------------------------- /LeanIOS/REFrostedViewController/RECommonFunctions.m: -------------------------------------------------------------------------------- 1 | // 2 | // RECommonFunctions.m 3 | // REFrostedViewController 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "RECommonFunctions.h" 27 | #import 28 | 29 | BOOL REFrostedViewControllerUIKitIsFlatMode(void) 30 | { 31 | static BOOL isUIKitFlatMode = NO; 32 | static dispatch_once_t onceToken; 33 | dispatch_once(&onceToken, ^{ 34 | if (floor(NSFoundationVersionNumber) > 993.0) { 35 | // If your app is running in legacy mode, tintColor will be nil - else it must be set to some color. 36 | if (UIApplication.sharedApplication.keyWindow) { 37 | isUIKitFlatMode = [UIApplication.sharedApplication.delegate.window respondsToSelector:@selector(tintColor)]; 38 | } else { 39 | // Possible that we're called early on (e.g. when used in a Storyboard). Adapt and use a temporary window. 40 | isUIKitFlatMode = [[UIWindow new] respondsToSelector:@selector(tintColor)]; 41 | } 42 | } 43 | }); 44 | return isUIKitFlatMode; 45 | } -------------------------------------------------------------------------------- /LeanIOS/REFrostedViewController/REFrostedContainerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // REFrostedContainerViewController.h 3 | // REFrostedViewController 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @class REFrostedViewController; 29 | 30 | @interface REFrostedContainerViewController : UIViewController 31 | 32 | @property (strong, readwrite, nonatomic) UIImage *screenshotImage; 33 | @property (weak, readwrite, nonatomic) REFrostedViewController *frostedViewController; 34 | @property (assign, readwrite, nonatomic) BOOL animateApperance; 35 | @property (strong, readonly, nonatomic) UIView *containerView; 36 | 37 | - (void)panGestureRecognized:(UIPanGestureRecognizer *)recognizer; 38 | - (void)hide; 39 | - (void)resizeToSize:(CGSize)size; 40 | - (void)hideWithCompletionHandler:(void(^)(void))completionHandler; 41 | - (void)refreshBackgroundImage; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /LeanIOS/REFrostedViewController/UIView+REFrostedViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+REFrostedViewController.h 3 | // REFrostedViewController 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | #import 28 | 29 | @interface UIView (REFrostedViewController) 30 | 31 | - (UIImage *)re_screenshot; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /LeanIOS/REFrostedViewController/UIView+REFrostedViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+REFrostedPanel.m 3 | // REFrostedPanel 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "UIView+REFrostedViewController.h" 27 | 28 | @implementation UIView (REFrostedViewController) 29 | 30 | - (UIImage *)re_screenshot 31 | { 32 | UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, [UIScreen mainScreen].scale); 33 | 34 | if ([self respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { 35 | 36 | NSInvocation* invoc = [NSInvocation invocationWithMethodSignature: 37 | [self methodSignatureForSelector: 38 | @selector(drawViewHierarchyInRect:afterScreenUpdates:)]]; 39 | [invoc setTarget:self]; 40 | [invoc setSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]; 41 | CGRect arg2 = self.bounds; 42 | BOOL arg3 = YES; 43 | [invoc setArgument:&arg2 atIndex:2]; 44 | [invoc setArgument:&arg3 atIndex:3]; 45 | [invoc invoke]; 46 | } else { 47 | [self.layer renderInContext:UIGraphicsGetCurrentContext()]; 48 | } 49 | 50 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 51 | UIGraphicsEndImageContext(); 52 | return image; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /LeanIOS/REFrostedViewController/UIViewController+REFrostedViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+REFrostedViewController.h 3 | // REFrostedViewController 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | @class REFrostedViewController; 29 | 30 | @interface UIViewController (REFrostedViewController) 31 | 32 | @property (strong, readonly, nonatomic) REFrostedViewController *frostedViewController; 33 | 34 | - (void)re_displayController:(UIViewController *)controller frame:(CGRect)frame; 35 | - (void)re_hideController:(UIViewController *)controller; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LeanIOS/REFrostedViewController/UIViewController+REFrostedViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+REFrostedViewController.m 3 | // REFrostedViewController 4 | // 5 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "UIViewController+REFrostedViewController.h" 27 | #import "REFrostedViewController.h" 28 | 29 | @implementation UIViewController (REFrostedViewController) 30 | 31 | - (void)re_displayController:(UIViewController *)controller frame:(CGRect)frame 32 | { 33 | [self addChildViewController:controller]; 34 | controller.view.frame = frame; 35 | [self.view addSubview:controller.view]; 36 | [controller didMoveToParentViewController:self]; 37 | } 38 | 39 | - (void)re_hideController:(UIViewController *)controller 40 | { 41 | [controller willMoveToParentViewController:nil]; 42 | [controller.view removeFromSuperview]; 43 | [controller removeFromParentViewController]; 44 | } 45 | 46 | - (REFrostedViewController *)frostedViewController 47 | { 48 | UIViewController *iter = self.parentViewController; 49 | while (iter) { 50 | if ([iter isKindOfClass:[REFrostedViewController class]]) { 51 | return (REFrostedViewController *)iter; 52 | } else if (iter.parentViewController && iter.parentViewController != iter) { 53 | iter = iter.parentViewController; 54 | } else { 55 | iter = nil; 56 | } 57 | } 58 | return nil; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /LeanIOS/Reachability.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: Reachability.h 3 | Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. 4 | Version: 3.5 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | 48 | #import 49 | #import 50 | #import 51 | 52 | 53 | typedef enum : NSInteger { 54 | NotReachable = 0, 55 | ReachableViaWiFi, 56 | ReachableViaWWAN 57 | } NetworkStatus; 58 | 59 | 60 | extern NSString *kReachabilityChangedNotification; 61 | 62 | 63 | @interface Reachability : NSObject 64 | 65 | /*! 66 | * Use to check the reachability of a given host name. 67 | */ 68 | + (instancetype)reachabilityWithHostName:(NSString *)hostName; 69 | 70 | /*! 71 | * Use to check the reachability of a given IP address. 72 | */ 73 | + (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress; 74 | 75 | /*! 76 | * Checks whether the default route is available. Should be used by applications that do not connect to a particular host. 77 | */ 78 | + (instancetype)reachabilityForInternetConnection; 79 | 80 | /*! 81 | * Checks whether a local WiFi connection is available. 82 | */ 83 | + (instancetype)reachabilityForLocalWiFi; 84 | 85 | /*! 86 | * Start listening for reachability notifications on the current run loop. 87 | */ 88 | - (BOOL)startNotifier; 89 | - (void)stopNotifier; 90 | 91 | - (NetworkStatus)currentReachabilityStatus; 92 | 93 | /*! 94 | * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand. 95 | */ 96 | - (BOOL)connectionRequired; 97 | 98 | @end -------------------------------------------------------------------------------- /LeanIOS/Settings.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | StringsTable 6 | Root 7 | 8 | 9 | -------------------------------------------------------------------------------- /LeanIOS/Settings.bundle/en.lproj/Root.strings: -------------------------------------------------------------------------------- 1 | /* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */ 2 | 3 | "Initial Url" = "Initial Url"; 4 | -------------------------------------------------------------------------------- /LeanIOS/WindowsController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WindowsController.swift 3 | // GonativeIO 4 | // 5 | // Created by Hunaid Hassan on 14.06.21. 6 | // Copyright © 2021 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import GoNativeCore 11 | 12 | @objc class WindowsController: NSObject { 13 | @objc class public func windowCountChanged() { 14 | let appConfig = GoNativeAppConfig.shared()! 15 | guard LEANWebViewController.currentWindows > appConfig.maxWindows else { 16 | return 17 | } 18 | 19 | if let rootViewController = UIApplication.shared.windows.first?.rootViewController as? LEANRootViewController, 20 | let navigationController = rootViewController.contentViewController as? UINavigationController { 21 | var viewControllers = navigationController.viewControllers 22 | let removeTillIndex = LEANWebViewController.currentWindows - appConfig.maxWindows 23 | viewControllers.removeSubrange(1...removeTillIndex) 24 | navigationController.viewControllers = viewControllers 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LeanIOS/appbeep.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/appbeep.wav -------------------------------------------------------------------------------- /LeanIOS/ar.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "إلغاء"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "حسناً"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "عرض"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "القائمة"; 12 | -------------------------------------------------------------------------------- /LeanIOS/ca.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Cancel·lar"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Veure"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menú"; 12 | -------------------------------------------------------------------------------- /LeanIOS/cs.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Zrušení"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Pohled"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/custom-icons.json: -------------------------------------------------------------------------------- 1 | { 2 | "gonative-icon": 59392 3 | } 4 | -------------------------------------------------------------------------------- /LeanIOS/custom-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/custom-icons.ttf -------------------------------------------------------------------------------- /LeanIOS/custom_sound_1.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/custom_sound_1.aff -------------------------------------------------------------------------------- /LeanIOS/custom_sound_2.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/custom_sound_2.aff -------------------------------------------------------------------------------- /LeanIOS/custom_sound_3.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/custom_sound_3.aff -------------------------------------------------------------------------------- /LeanIOS/custom_sound_4.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/custom_sound_4.aff -------------------------------------------------------------------------------- /LeanIOS/custom_sound_5.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/custom_sound_5.aff -------------------------------------------------------------------------------- /LeanIOS/da.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Afbryd"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Vis"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/de.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* Button: Cancel */ 2 | "button-cancel" = "Abbrechen"; 3 | 4 | /* Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* Button: View */ 8 | "button-view" = "Anzeigen"; 9 | 10 | /* Button: Menu */ 11 | "button-menu" = "Menü"; 12 | -------------------------------------------------------------------------------- /LeanIOS/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LeanIOS/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* Button: Cancel */ 2 | "button-cancel" = "Cancel"; 3 | 4 | /* Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* Button: View */ 8 | "button-view" = "View"; 9 | 10 | /* Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/es-419.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* Button: Cancel */ 2 | "button-cancel" = "Cancelar"; 3 | 4 | /* Button: OK */ 5 | "button-ok" = "Aceptar"; 6 | 7 | /* Button: View */ 8 | "button-view" = "Ver"; 9 | 10 | /* Button: Menu */ 11 | "button-menu" = "Menú"; 12 | -------------------------------------------------------------------------------- /LeanIOS/es.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Cancelar"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "Aceptar"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Ver"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menú"; 12 | -------------------------------------------------------------------------------- /LeanIOS/fi.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Peruuta"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Näytä"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Valikko"; 12 | -------------------------------------------------------------------------------- /LeanIOS/fr.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* Button: Cancel */ 2 | "button-cancel" = "Annuler"; 3 | 4 | /* Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* Button: View */ 8 | "button-view" = "Afficher"; 9 | 10 | /* Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/gd.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Sguir dheth"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "CGL"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Seall"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Clàr"; 12 | -------------------------------------------------------------------------------- /LeanIOS/generate-app-icons.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Use Mac OSX's utility to create app icons of various sizes. 4 | 5 | BASEDIR=$(dirname $0) 6 | 7 | convert $BASEDIR/AppIcon -background white -flatten PNG32:$BASEDIR/AppIconFlat.png 2>&1 8 | 9 | sips -z 29 29 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-29.png $BASEDIR/AppIconFlat.png 2>&1 10 | sips -z 40 40 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-40.png $BASEDIR/AppIconFlat.png 2>&1 11 | sips -z 58 58 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-58.png $BASEDIR/AppIconFlat.png 2>&1 12 | sips -z 76 76 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-76.png $BASEDIR/AppIconFlat.png 2>&1 13 | sips -z 80 80 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-80.png $BASEDIR/AppIconFlat.png 2>&1 14 | sips -z 120 120 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-120.png $BASEDIR/AppIconFlat.png 2>&1 15 | sips -z 152 152 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-152.png $BASEDIR/AppIconFlat.png 2>&1 16 | sips -z 167 167 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-167.png $BASEDIR/AppIconFlat.png 2>&1 17 | sips -z 180 180 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-180.png $BASEDIR/AppIconFlat.png 2>&1 18 | sips -z 1024 1024 -s format png --out $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-1024.png $BASEDIR/AppIconFlat.png 2>&1 19 | 20 | rm -f $BASEDIR/AppIconFlat.png 2>&1 21 | 22 | sips -z 80 80 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/header.png $BASEDIR/AppIcon 2>&1 23 | sips -z 160 160 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/header@2x.png $BASEDIR/AppIcon 2>&1 24 | sips -z 240 240 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/header@3x.png $BASEDIR/AppIcon 2>&1 25 | 26 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-29.png 2>&1 27 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-40.png 2>&1 28 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-58.png 2>&1 29 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-76.png 2>&1 30 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-80.png 2>&1 31 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-120.png 2>&1 32 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-152.png 2>&1 33 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-167.png 2>&1 34 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-180.png 2>&1 35 | optipng $BASEDIR/Images.xcassets/AppIcon.appiconset/icon-1024.png 2>&1 36 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/header.png 2>&1 37 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/header@2x.png 2>&1 38 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/header@3x.png 2>&1 39 | -------------------------------------------------------------------------------- /LeanIOS/generate-header-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Use Mac OSX's utility to create app icons of various sizes. 4 | 5 | BASEDIR=$(dirname $0) 6 | 7 | sips -z 80 80 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/header.png $BASEDIR/iosHeaderImage 2>&1 8 | sips -z 160 160 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/header@2x.png $BASEDIR/iosHeaderImage 2>&1 9 | sips -z 240 240 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/header@3x.png $BASEDIR/iosHeaderImage 2>&1 10 | 11 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/header.png 2>&1 12 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/header@2x.png 2>&1 13 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/header@3x.png 2>&1 14 | 15 | sips -z 80 80 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/headerDark.png $BASEDIR/iosHeaderImageDark 2>&1 16 | sips -z 160 160 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/headerDark@2x.png $BASEDIR/iosHeaderImageDark 2>&1 17 | sips -z 240 240 -s format png --out $BASEDIR/Images.xcassets/HeaderImage.imageset/headerDark@3x.png $BASEDIR/iosHeaderImageDark 2>&1 18 | 19 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/headerDark.png 2>&1 20 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/headerDark@2x.png 2>&1 21 | optipng $BASEDIR/Images.xcassets/HeaderImage.imageset/headerDark@3x.png 2>&1 22 | -------------------------------------------------------------------------------- /LeanIOS/generate-navigation-title-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Use Mac OSX's utility to create app icons of various sizes. 4 | 5 | BASEDIR=$(dirname $0) 6 | 7 | sips --resampleHeight 90 -s format png --out $BASEDIR/Images.xcassets/NavBarImage.imageset/navBar.png $BASEDIR/navigationTitleImageLocation 2>&1 8 | 9 | optipng $BASEDIR/Images.xcassets/NavBarImage.imageset/navBar.png 2>&1 10 | 11 | sips --resampleHeight 90 -s format png --out $BASEDIR/Images.xcassets/NavBarImage.imageset/navBarDark.png $BASEDIR/navigationTitleImageLocationDark 2>&1 12 | 13 | optipng $BASEDIR/Images.xcassets/NavBarImage.imageset/navBarDark.png 2>&1 14 | -------------------------------------------------------------------------------- /LeanIOS/he.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* Button: Cancel */ 2 | "button-cancel" = "ביטול"; 3 | 4 | /* Button: OK */ 5 | "button-ok" = "אישור"; 6 | 7 | /* Button: View */ 8 | "button-view" = "הצג"; 9 | 10 | /* Button: Menu */ 11 | "button-menu" = "תפריט"; 12 | -------------------------------------------------------------------------------- /LeanIOS/hu.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Mégsem"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Megnéz"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menü"; 12 | -------------------------------------------------------------------------------- /LeanIOS/iosHeaderImage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/iosHeaderImage -------------------------------------------------------------------------------- /LeanIOS/it.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Annulla"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Visualizza"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/licenses/00-preamble.license: -------------------------------------------------------------------------------- 1 | Our thanks go out to the many developers who share their hard work with the open-source community. In particular, this app uses the following projects (included are their respective licenses): 2 | -------------------------------------------------------------------------------- /LeanIOS/licenses/FontAwesome.license: -------------------------------------------------------------------------------- 1 | -- Font Awesome -- 2 | by Dave Gandy - http://fontawesome.io 3 | -------------------------------------------------------------------------------- /LeanIOS/licenses/REFrostedViewController.license: -------------------------------------------------------------------------------- 1 | -- REFrostedViewController -- 2 | 3 | Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego). 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /LeanIOS/licenses/Zipzap.license: -------------------------------------------------------------------------------- 1 | -- zipzap -- 2 | 3 | Created by Glen Low on 31/10/12. 4 | Copyright (c) 2012, Pixelglow Software. All rights reserved. 5 | 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 19 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 22 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 | THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /LeanIOS/licenses/generate.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | my $out = "../Settings.bundle/en.lproj/Acknowledgements.strings"; 6 | my $plistout = "../Settings.bundle/Acknowledgements.plist"; 7 | 8 | unlink $out; 9 | 10 | open(my $outfh, '>', $out) or die $!; 11 | open(my $plistfh, '>', $plistout) or die $!; 12 | 13 | print $plistfh <<'EOD'; 14 | 15 | 16 | 17 | 18 | StringsTable 19 | Acknowledgements 20 | PreferenceSpecifiers 21 | 22 | EOD 23 | for my $i (sort glob("*.license")) 24 | { 25 | my $value=`cat $i`; 26 | $value =~ s/\r//g; 27 | $value =~ s/\n/\r/g; 28 | $value =~ s/[ \t]+\r/\r/g; 29 | $value =~ s/\"/\'/g; 30 | my $key=$i; 31 | $key =~ s/\.license$//; 32 | 33 | my $cnt = 1; 34 | my $keynum = $key; 35 | for my $str (split /\r\r/, $value) 36 | { 37 | print $plistfh <<"EOD"; 38 | 39 | Type 40 | PSGroupSpecifier 41 | Title 42 | $keynum 43 | 44 | EOD 45 | 46 | print $outfh "\"$keynum\" = \"$str\";\n"; 47 | $keynum = $key.(++$cnt); 48 | } 49 | } 50 | 51 | print $plistfh <<'EOD'; 52 | 53 | 54 | 55 | EOD 56 | close($outfh); 57 | close($plistfh); 58 | -------------------------------------------------------------------------------- /LeanIOS/licenses/ios-fontawesome.license: -------------------------------------------------------------------------------- 1 | -- ios-fontawesome -- 2 | 3 | Copyright (c) 2012 Alex Usbergo. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -------------------------------------------------------------------------------- /LeanIOS/localCache.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/localCache.zip -------------------------------------------------------------------------------- /LeanIOS/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GoNativeIOS 4 | // 5 | // Created by Weiyin He on 2/10/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "LEANAppDelegate.h" 13 | 14 | #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 15 | 16 | int main(int argc, char * argv[]) 17 | { 18 | @autoreleasepool { 19 | // Dynamically load WebKit if iOS version >= 8 20 | if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { 21 | #if TARGET_IPHONE_SIMULATOR 22 | NSString *frameworkPath = [[NSProcessInfo processInfo] environment][@"DYLD_FALLBACK_FRAMEWORK_PATH"]; 23 | if (frameworkPath) { 24 | NSString *webkitLibraryPath = [NSString pathWithComponents:@[frameworkPath, @"WebKit.framework", @"WebKit"]]; 25 | dlopen([webkitLibraryPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_LAZY); 26 | } 27 | #else 28 | dlopen("/System/Library/Frameworks/WebKit.framework/WebKit", RTLD_LAZY); 29 | #endif 30 | } 31 | 32 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([LEANAppDelegate class])); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LeanIOS/nl.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Annuleren"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Bekijken"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/nn-NO.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "Avbryt"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "OK"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Vis"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Meny"; 12 | -------------------------------------------------------------------------------- /LeanIOS/notification.aff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/LeanIOS/notification.aff -------------------------------------------------------------------------------- /LeanIOS/offline.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Device Offline 5 | 15 | 16 | 17 |
18 | 21 | 22 |

No internet connection
Check your connection and try again

23 |
24 | 25 |
26 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /LeanIOS/pt-BR.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* Button: Cancel */ 2 | "button-cancel" = "Cancelar"; 3 | 4 | /* Button: OK */ 5 | "button-ok" = "Aceitar"; 6 | 7 | /* Button: View */ 8 | "button-view" = "Assistir"; 9 | 10 | /* Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/pt-PT.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* Button: Cancel */ 2 | "button-cancel" = "Cancelar"; 3 | 4 | /* Button: OK */ 5 | "button-ok" = "Aceitar"; 6 | 7 | /* Button: View */ 8 | "button-view" = "Assistir"; 9 | 10 | /* Button: Menu */ 11 | "button-menu" = "Menu"; 12 | -------------------------------------------------------------------------------- /LeanIOS/tr.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* iOS Button: Cancel */ 2 | "button-cancel" = "İptal"; 3 | 4 | /* iOS Button: OK */ 5 | "button-ok" = "Tamam"; 6 | 7 | /* iOS Button: View */ 8 | "button-view" = "Görünüm"; 9 | 10 | /* iOS Button: Menu */ 11 | "button-menu" = "Menü"; 12 | -------------------------------------------------------------------------------- /LeanIOSTests/GoNativeIOSTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LeanIOSTests/LeanIOSTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LeanIOSTests.m 3 | // LeanIOSTests 4 | // 5 | // Created by Weiyin He on 2/10/14. 6 | // Copyright (c) 2014 GoNative.io LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LeanIOSTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LeanIOSTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTAssert(1 != 2); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /LeanIOSTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '13.0' 3 | 4 | source 'https://cdn.cocoapods.org/' 5 | source 'git@github.com:gonativeio/gonative-specs.git' 6 | 7 | require_relative './plugins.rb' 8 | 9 | target default_app_target do 10 | # Comment the next line if you don't want to use dynamic frameworks 11 | use_frameworks! 12 | 13 | # Pods for GonativeIO 14 | pod 'GoNativeCore' 15 | pod 'GonativeIcons' 16 | 17 | use_plugins! 18 | 19 | target 'GoNativeIOSTests' do 20 | inherit! :search_paths 21 | # Pods for testing 22 | end 23 | 24 | end 25 | 26 | post_install do |installer| 27 | installer.pods_project.targets.each do |target| 28 | target.build_configurations.each do |config| 29 | config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' 30 | config.build_settings.delete 'ARCHS' 31 | config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' 32 | config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' 33 | end 34 | end 35 | installer.pods_project.build_configurations.each do |config| 36 | config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - GoNativeCore (1.6.3): 3 | - GoNativeCore/Binary (= 1.6.3) 4 | - GoNativeCore/Binary (1.6.3) 5 | - GonativeIcons (1.0.5) 6 | 7 | DEPENDENCIES: 8 | - GoNativeCore 9 | - GonativeIcons 10 | 11 | SPEC REPOS: 12 | "git@github.com:gonativeio/gonative-specs.git": 13 | - GoNativeCore 14 | - GonativeIcons 15 | 16 | SPEC CHECKSUMS: 17 | GoNativeCore: 418b41004fb6005eb7c3e01a6777fedcb3f1d71e 18 | GonativeIcons: 3b0d9e25558f9b740255dedb0f218d622ff836b0 19 | 20 | PODFILE CHECKSUM: 3717c3deb5b9d35851d3944586d72e4e58ef0882 21 | 22 | COCOAPODS: 1.12.1 23 | -------------------------------------------------------------------------------- /Project.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Archive Notice 2 | 3 | This repository is archived and is no longer being maintained. You can now build an app using our online App Studio at https://median.co/app and download custom iOS source code for free. 4 | 5 | 6 | gonative-ios 7 | ============ 8 | 9 | This is the native iOS code previously used by [GoNative](https://median.co). 10 | 11 | It allows the creation of apps from existing mobile-optimized websites. 12 | 13 | How to use 14 | ------------ 15 | Open the workspace named GoNativeIOS.xcworkspace in Xcode. Edit appConfig.json as appropriate. 16 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZAESDecryptInputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZAESDecryptInputStream.h 3 | // ZipZap 4 | // 5 | // Created by Daniel Cohen Gindi on 6/1/14. 6 | // Copyright (c) 2014, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZConstants.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZAESDecryptInputStream : NSInputStream 16 | 17 | - (nullable instancetype)initWithStream:(NSInputStream*)upstream 18 | password:(NSString*)password 19 | header:(uint8_t*)header 20 | strength:(ZZAESEncryptionStrength)strength 21 | error:(out NSError**)error; 22 | 23 | - (void)open; 24 | - (void)close; 25 | 26 | - (NSStreamStatus)streamStatus; 27 | - (NSError*)streamError; 28 | 29 | - (NSInteger)read:(uint8_t*)buffer maxLength:(NSUInteger)len; 30 | - (BOOL)getBuffer:(uint8_t* _Nullable* _Nonnull)buffer length:(NSUInteger*)len; 31 | - (BOOL)hasBytesAvailable; 32 | 33 | - (void)dealloc; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZArchiveEntryWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZZipEntryWriter.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 6/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol ZZArchiveEntryWriter 16 | 17 | - (uint32_t)offsetToLocalFileEnd; 18 | - (BOOL)writeLocalFileToChannelOutput:(id)channelOutput 19 | withInitialSkip:(uint32_t)initialSkip 20 | error:(out NSError**)error; 21 | - (BOOL)writeCentralFileHeaderToChannelOutput:(id)channelOutput 22 | error:(out NSError**)error; 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZChannel.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol ZZChannel 16 | 17 | @property (readonly, nullable, nonatomic) NSURL* URL; 18 | 19 | - (nullable instancetype)temporaryChannel:(out NSError**)error; 20 | - (BOOL)replaceWithChannel:(id)channel 21 | error:(out NSError**)error; 22 | - (void)removeAsTemporary; 23 | 24 | - (nullable NSData*)newInput:(out NSError**)error; 25 | - (nullable id)newOutput:(out NSError**)error; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZChannelOutput.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZChannelOutput.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @protocol ZZChannelOutput 14 | 15 | - (uint32_t)offset; 16 | - (BOOL)seekToOffset:(uint32_t)offset 17 | error:(out NSError**)error; 18 | 19 | - (BOOL)writeData:(NSData*)data 20 | error:(out NSError**)error; 21 | - (BOOL)truncateAtOffset:(uint32_t)offset 22 | error:(out NSError**)error; 23 | - (void)close; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZConstants.h 3 | // ZipZap 4 | // 5 | // Created by Daniel Cohen Gindi on 29/12/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | // 10 | // Redistribution and use in source and binary forms, with or without modification, 11 | // are permitted provided that the following conditions are met: 12 | // 13 | // * Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // * Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 24 | // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 25 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | // THE POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | 33 | #import 34 | 35 | typedef NS_ENUM(NSInteger, ZZEncryptionMode) 36 | { 37 | /** 38 | * No encryption. 39 | */ 40 | ZZEncryptionModeNone, 41 | 42 | /** 43 | * Standard PKZIP encryption. 44 | */ 45 | ZZEncryptionModeStandard, 46 | 47 | /** 48 | * Strong PKZIP encryption. Currently not supported. 49 | */ 50 | ZZEncryptionModeStrong, 51 | 52 | /** 53 | * WinZip encryption using AES. 54 | */ 55 | ZZEncryptionModeWinZipAES 56 | }; 57 | 58 | typedef NS_ENUM(uint8_t, ZZAESEncryptionStrength) 59 | { 60 | /** 61 | * Use 128-bit AES for encryption. 62 | */ 63 | ZZAESEncryptionStrength128 = 0x01, 64 | 65 | /** 66 | * Use 192-bit AES for encryption. 67 | */ 68 | ZZAESEncryptionStrength192 = 0x02, 69 | 70 | /** 71 | * Use 256-bit AES for encryption. 72 | */ 73 | ZZAESEncryptionStrength256 = 0x03 74 | }; 75 | 76 | /** 77 | * An NSNumber object that determines whether to create the archive file if it is missing. Creation occurs during -[ZZArchive updateEntries:error:]. Default is @NO. 78 | */ 79 | extern NSString* const ZZOpenOptionsCreateIfMissingKey; 80 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZDataChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDataChannel.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannel.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZDataChannel : NSObject 16 | 17 | @property (readonly, nullable, nonatomic) NSURL* URL; 18 | 19 | - (instancetype)init NS_UNAVAILABLE; 20 | 21 | - (instancetype)initWithData:(NSData*)data NS_DESIGNATED_INITIALIZER; 22 | 23 | - (nullable instancetype)temporaryChannel:(out NSError**)error; 24 | - (BOOL)replaceWithChannel:(id)channel 25 | error:(out NSError**)error; 26 | - (void)removeAsTemporary; 27 | 28 | - (nullable NSData*)newInput:(out NSError**)error; 29 | - (nullable id)newOutput:(out NSError**)error; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZDataChannelOutput.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDataChannelOutput.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannelOutput.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZDataChannelOutput : NSObject 16 | 17 | - (instancetype)init NS_UNAVAILABLE; 18 | 19 | - (instancetype)initWithData:(NSMutableData*)data NS_DESIGNATED_INITIALIZER; 20 | 21 | - (uint32_t)offset; 22 | - (BOOL)seekToOffset:(uint32_t)offset 23 | error:(out NSError**)error; 24 | 25 | - (BOOL)writeData:(NSData*)data 26 | error:(out NSError**)error; 27 | - (BOOL)truncateAtOffset:(uint32_t)offset 28 | error:(out NSError**)error; 29 | - (void)close; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZDataProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDataProvider.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 3/01/14. 6 | // Copyright (c) 2014, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 12 | #include 13 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 14 | #include 15 | #endif 16 | 17 | #import 18 | 19 | class ZZDataProvider 20 | { 21 | public: 22 | static CGDataProviderRef create(NSInputStream*(^makeStream)()) 23 | { 24 | // create the wrapper 25 | // NOTE: no libc++ runtime, so no operator new / delete; use malloc / free instead 26 | ZZDataProvider* dataProvider = new((ZZDataProvider*)malloc(sizeof(ZZDataProvider))) ZZDataProvider(makeStream); 27 | 28 | // trampoline C callbacks to C++ wrapper member functions 29 | CGDataProviderSequentialCallbacks dataProviderCallbacks = 30 | { 31 | 0, 32 | [](void* info, void* buffer, size_t count) -> size_t 33 | { 34 | return reinterpret_cast(info)->getBytes(buffer, count); 35 | }, 36 | [](void* info, off_t count) -> off_t 37 | { 38 | return reinterpret_cast(info)->skipForwardBytes(count); 39 | }, 40 | [](void* info) 41 | { 42 | reinterpret_cast(info)->rewind(); 43 | }, 44 | [](void* info) 45 | { 46 | reinterpret_cast(info)->~ZZDataProvider(); 47 | free(info); 48 | } 49 | }; 50 | return CGDataProviderCreateSequential(dataProvider, &dataProviderCallbacks); 51 | } 52 | 53 | private: 54 | ZZDataProvider(NSInputStream*(^makeStream)()): _makeStream(makeStream), _stream(nil) 55 | { 56 | // private to force creation on heap 57 | } 58 | 59 | ~ZZDataProvider() 60 | { 61 | // private to force deallocation from heap 62 | if (_stream) 63 | [_stream close]; 64 | } 65 | 66 | size_t getBytes (void* buffer, size_t count) 67 | { 68 | if (!_stream) 69 | { 70 | _stream = _makeStream(); 71 | [_stream open]; 72 | } 73 | 74 | // CoreGraphics likes full buffers, so we aim to please... 75 | size_t totalBytesRead = 0; 76 | while (totalBytesRead < count) 77 | { 78 | NSInteger bytesRead = [_stream read:(uint8_t*)buffer + totalBytesRead 79 | maxLength:count - totalBytesRead]; 80 | if (bytesRead > 0) 81 | totalBytesRead += bytesRead; 82 | else 83 | break; 84 | } 85 | return totalBytesRead; 86 | } 87 | 88 | off_t skipForwardBytes (off_t count) 89 | { 90 | if (!_stream) 91 | { 92 | _stream = _makeStream(); 93 | [_stream open]; 94 | } 95 | if (count > 0) 96 | { 97 | uint8_t skip[1024]; 98 | 99 | // read in 1K at a time until byte count read 100 | uint64_t totalBytesRead = 0; 101 | while (totalBytesRead < count) 102 | { 103 | NSInteger bytesRead = [_stream read:skip 104 | maxLength:(NSUInteger)MIN((uint64_t)sizeof(skip), count - totalBytesRead)]; 105 | if (bytesRead > 0) 106 | totalBytesRead += bytesRead; 107 | else 108 | break; 109 | } 110 | return totalBytesRead; 111 | } 112 | else 113 | // can't skip backwards 114 | return 0; 115 | } 116 | 117 | void rewind () 118 | { 119 | // streams cannot rewind by themselves 120 | // so we close the stream and the next get/skip will re-open it 121 | [_stream close]; 122 | _stream = nil; 123 | } 124 | 125 | NSInputStream*(^_makeStream)(); 126 | NSInputStream* _stream; 127 | }; 128 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZDeflateOutputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZDeflateOutputStream.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 9/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZDeflateOutputStream : NSOutputStream 16 | 17 | @property (readonly, nonatomic) uint32_t crc32; 18 | @property (readonly, nonatomic) uint32_t compressedSize; 19 | @property (readonly, nonatomic) uint32_t uncompressedSize; 20 | 21 | - (instancetype)initWithChannelOutput:(id)channelOutput 22 | compressionLevel:(NSUInteger)compressionLevel; 23 | 24 | - (NSStreamStatus)streamStatus; 25 | - (nullable NSError*)streamError; 26 | 27 | - (void)open; 28 | - (void)close; 29 | 30 | - (NSInteger)write:(const uint8_t*)buffer maxLength:(NSUInteger)length; 31 | - (BOOL)hasSpaceAvailable; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZError.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZError.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 25/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | // 10 | // Redistribution and use in source and binary forms, with or without modification, 11 | // are permitted provided that the following conditions are met: 12 | // 13 | // * Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // * Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 24 | // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 25 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | // THE POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | 33 | #import 34 | 35 | /** 36 | * The domain of ZipZap errors. 37 | */ 38 | extern NSString* const ZZErrorDomain; 39 | 40 | /** 41 | * The index of the erroneous entry. 42 | */ 43 | extern NSString* const ZZEntryIndexKey; 44 | 45 | typedef NS_ENUM(NSInteger, ZZErrorCode) 46 | { 47 | /** 48 | * Cannot open an archive for reading. 49 | */ 50 | ZZOpenReadErrorCode, 51 | 52 | /** 53 | * Cannot read the end of central directory. 54 | */ 55 | ZZEndOfCentralDirectoryReadErrorCode, 56 | 57 | /** 58 | * Cannot read a central file header. 59 | */ 60 | ZZCentralFileHeaderReadErrorCode, 61 | 62 | /** 63 | * Cannot read a local file. 64 | */ 65 | ZZLocalFileReadErrorCode, 66 | 67 | /** 68 | * Cannot open an archive for writing. 69 | */ 70 | ZZOpenWriteErrorCode, 71 | 72 | /** 73 | * Cannot write a local file. 74 | */ 75 | ZZLocalFileWriteErrorCode, 76 | 77 | /** 78 | * Cannot write a central file header. 79 | */ 80 | ZZCentralFileHeaderWriteErrorCode, 81 | 82 | /** 83 | * Cannot write the end of central directory. 84 | */ 85 | ZZEndOfCentralDirectoryWriteErrorCode, 86 | 87 | /** 88 | * Cannot replace the zip file after writing. 89 | */ 90 | ZZReplaceWriteErrorCode, 91 | 92 | /** 93 | * The compression used is currently unsupported. 94 | */ 95 | ZZUnsupportedCompressionMethod, 96 | 97 | /** 98 | * The encryption used is currently unsupported. 99 | */ 100 | ZZUnsupportedEncryptionMethod, 101 | 102 | /** 103 | * An invalid CRC checksum has been encountered. 104 | */ 105 | ZZInvalidCRChecksum, 106 | 107 | /** 108 | * The wrong key was passed in. 109 | */ 110 | ZZWrongPassword, 111 | 112 | /** 113 | * The data, stream or data consumer block failed but did not set the error. 114 | * This will be set on the underlying error of the local file write. 115 | */ 116 | ZZBlockFailedWithoutError 117 | }; 118 | 119 | static inline BOOL ZZRaiseErrorNo(NSError** error, ZZErrorCode errorCode, NSDictionary* userInfo) 120 | { 121 | if (error) 122 | *error = [NSError errorWithDomain:ZZErrorDomain 123 | code:errorCode 124 | userInfo:userInfo]; 125 | return NO; 126 | } 127 | 128 | static inline id ZZRaiseErrorNil(NSError** error, ZZErrorCode errorCode, NSDictionary* userInfo) 129 | { 130 | if (error) 131 | *error = [NSError errorWithDomain:ZZErrorDomain 132 | code:errorCode 133 | userInfo:userInfo]; 134 | return nil; 135 | } 136 | 137 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZFileChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZFileChannel.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannel.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZFileChannel : NSObject 16 | 17 | @property (readonly, nullable, nonatomic) NSURL* URL; 18 | 19 | - (instancetype)init NS_UNAVAILABLE; 20 | 21 | - (instancetype)initWithURL:(NSURL*)URL NS_DESIGNATED_INITIALIZER; 22 | 23 | - (nullable instancetype)temporaryChannel:(out NSError**)error; 24 | - (BOOL)replaceWithChannel:(id)channel 25 | error:(out NSError**)error; 26 | - (void)removeAsTemporary; 27 | 28 | - (nullable NSData*)newInput:(out NSError**)error; 29 | - (nullable id)newOutput:(out NSError**)error; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZFileChannelOutput.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZFileChannelOutput.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 12/01/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZChannelOutput.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZFileChannelOutput : NSObject 16 | 17 | @property (nonatomic) uint32_t offset; 18 | 19 | - (instancetype)init NS_UNAVAILABLE; 20 | 21 | - (instancetype)initWithFileDescriptor:(int)fileDescriptor NS_DESIGNATED_INITIALIZER; 22 | 23 | - (uint32_t)offset; 24 | - (BOOL)seekToOffset:(uint32_t)offset 25 | error:(out NSError**)error; 26 | 27 | - (BOOL)writeData:(NSData*)data 28 | error:(out NSError**)error; 29 | - (BOOL)truncateAtOffset:(uint32_t)offset 30 | error:(out NSError**)error; 31 | 32 | - (void)close; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZInflateInputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZInflateInputStream.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 29/09/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ZZInflateInputStream : NSInputStream 14 | 15 | + (nullable NSData*)decompressData:(NSData*)data 16 | withUncompressedSize:(NSUInteger)uncompressedSize; 17 | 18 | - (instancetype)initWithStream:(NSInputStream*)upstream; 19 | 20 | - (NSStreamStatus)streamStatus; 21 | - (nullable NSError*)streamError; 22 | 23 | - (void)open; 24 | - (void)close; 25 | 26 | - (NSInteger)read:(uint8_t*)buffer maxLength:(NSUInteger)len; 27 | - (BOOL)getBuffer:(uint8_t* _Nullable* _Nonnull)buffer length:(NSUInteger*)len; 28 | - (BOOL)hasBytesAvailable; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZNewArchiveEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZNewArchiveEntry.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 8/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 10 | #include 11 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 12 | #include 13 | #endif 14 | 15 | #import 16 | 17 | #import "ZZArchiveEntry.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface ZZNewArchiveEntry : ZZArchiveEntry 22 | 23 | @property (readonly, nonatomic) BOOL compressed; 24 | @property (readonly, nonatomic) NSDate* lastModified; 25 | @property (readonly, nonatomic) mode_t fileMode; 26 | @property (readonly, nonatomic) NSData* rawFileName; 27 | @property (readonly, nonatomic) NSStringEncoding encoding; 28 | 29 | - (instancetype)init NS_UNAVAILABLE; 30 | 31 | - (instancetype)initWithFileName:(NSString*)fileName 32 | fileMode:(mode_t)fileMode 33 | lastModified:(NSDate*)lastModified 34 | compressionLevel:(NSInteger)compressionLevel 35 | dataBlock:(nullable NSData* _Nullable(^)(NSError** error))dataBlock 36 | streamBlock:(nullable BOOL(^)(NSOutputStream* stream, NSError** error))streamBlock 37 | dataConsumerBlock:(nullable BOOL(^)(CGDataConsumerRef dataConsumer, NSError** error))dataConsumerBlock NS_DESIGNATED_INITIALIZER; 38 | 39 | - (NSString*)fileNameWithEncoding:(NSStringEncoding)encoding; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZNewArchiveEntryWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZNewArchiveEntryWriter.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 9/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 10 | #include 11 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 12 | #include 13 | #endif 14 | 15 | #import 16 | 17 | #import "ZZArchiveEntryWriter.h" 18 | 19 | NS_ASSUME_NONNULL_BEGIN 20 | 21 | @interface ZZNewArchiveEntryWriter : NSObject 22 | 23 | - (instancetype)init NS_UNAVAILABLE; 24 | 25 | - (instancetype)initWithFileName:(NSString*)fileName 26 | fileMode:(mode_t)fileMode 27 | lastModified:(NSDate*)lastModified 28 | compressionLevel:(NSInteger)compressionLevel 29 | dataBlock:(nullable NSData* _Nullable(^)(NSError** error))dataBlock 30 | streamBlock:(nullable BOOL(^)(NSOutputStream* stream, NSError** error))streamBlock 31 | dataConsumerBlock:(nullable BOOL(^)(CGDataConsumerRef dataConsumer, NSError** error))dataConsumerBlock NS_DESIGNATED_INITIALIZER; 32 | 33 | - (uint32_t)offsetToLocalFileEnd; 34 | - (BOOL)writeLocalFileToChannelOutput:(id)channelOutput 35 | withInitialSkip:(uint32_t)initialSkip 36 | error:(out NSError**)error; 37 | - (BOOL)writeCentralFileHeaderToChannelOutput:(id)channelOutput 38 | error:(out NSError**)error; 39 | 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZOldArchiveEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZOldArchiveEntry.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 24/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | // 9 | 10 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 11 | #include 12 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 13 | #include 14 | #endif 15 | 16 | #import 17 | 18 | #import "ZZArchiveEntry.h" 19 | #import "ZZHeaders.h" 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface ZZOldArchiveEntry : ZZArchiveEntry 24 | 25 | @property (readonly, nonatomic) BOOL compressed; 26 | @property (readonly, nonatomic) BOOL encrypted; 27 | @property (readonly, nonatomic) NSDate* lastModified; 28 | @property (readonly, nonatomic) NSUInteger crc32; 29 | @property (readonly, nonatomic) NSUInteger compressedSize; 30 | @property (readonly, nonatomic) NSUInteger uncompressedSize; 31 | @property (readonly, nonatomic) mode_t fileMode; 32 | @property (readonly, nonatomic) NSData* rawFileName; 33 | @property (readonly, nonatomic) NSStringEncoding encoding; 34 | 35 | - (instancetype)init NS_UNAVAILABLE; 36 | 37 | - (instancetype)initWithCentralFileHeader:(struct ZZCentralFileHeader*)centralFileHeader 38 | localFileHeader:(struct ZZLocalFileHeader*)localFileHeader NS_DESIGNATED_INITIALIZER; 39 | 40 | - (NSString*)fileNameWithEncoding:(NSStringEncoding)encoding; 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZOldArchiveEntryWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZOldArchiveEntryWriter.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 9/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ZZArchiveEntryWriter.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZOldArchiveEntryWriter : NSObject 16 | 17 | - (instancetype)init NS_UNAVAILABLE; 18 | 19 | - (instancetype)initWithCentralFileHeader:(struct ZZCentralFileHeader*)centralFileHeader 20 | localFileHeader:(struct ZZLocalFileHeader*)localFileHeader 21 | shouldSkipLocalFile:(BOOL)shouldSkipLocalFile NS_DESIGNATED_INITIALIZER; 22 | 23 | - (uint32_t)offsetToLocalFileEnd; 24 | - (BOOL)writeLocalFileToChannelOutput:(id)channelOutput 25 | withInitialSkip:(uint32_t)initialSkip 26 | error:(out NSError**)error; 27 | - (BOOL)writeCentralFileHeaderToChannelOutput:(id)channelOutput 28 | error:(out NSError**)error; 29 | 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZScopeGuard.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZScopeGuard.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 30/12/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | // 9 | 10 | class ZZScopeGuard 11 | { 12 | public: 13 | ZZScopeGuard(void(^exit)()): _exit(exit) 14 | { 15 | } 16 | 17 | ~ZZScopeGuard() 18 | { 19 | _exit(); 20 | } 21 | 22 | private: 23 | void(^_exit)(); 24 | }; 25 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZStandardCryptoEngine.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZStandardCryptoEngine.h 3 | // ZipZap 4 | // 5 | // Created by Daniel Cohen Gindi on 29/12/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | class ZZStandardCryptoEngine 10 | { 11 | public: 12 | ZZStandardCryptoEngine() 13 | { 14 | } 15 | 16 | void initKeys(unsigned char *password) 17 | { 18 | keys[0] = 305419896; 19 | keys[1] = 591751049; 20 | keys[2] = 878082192; 21 | if (password) { 22 | while (*password) 23 | { 24 | updateKeys((*password) & 0xff); 25 | password++; 26 | } 27 | } 28 | } 29 | 30 | void updateKeys(unsigned char charAt) 31 | { 32 | keys[0] = crc32(keys[0], charAt); 33 | keys[1] += keys[0] & 0xff; 34 | keys[1] = keys[1] * 134775813 + 1; 35 | keys[2] = crc32(keys[2], (unsigned char) (keys[1] >> 24)); 36 | } 37 | 38 | int crc32(int oldCrc, unsigned char charAt) 39 | { 40 | return (((unsigned int)oldCrc >> 8) ^ CRC_TABLE[(oldCrc ^ charAt) & 0xff]); 41 | } 42 | 43 | unsigned char decryptByte() 44 | { 45 | int temp = keys[2] | 2; 46 | temp *= temp ^ 1; 47 | return (unsigned char) ((*((unsigned int *)&temp)) >> 8); 48 | } 49 | 50 | private: 51 | int keys[3]; 52 | static int CRC_TABLE[256]; 53 | 54 | }; 55 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZStandardDecryptInputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZStandardDecryptInputStream.h 3 | // ZipZap 4 | // 5 | // Created by Daniel Cohen Gindi on 29/12/13. 6 | // Copyright (c) 2013, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ZZStandardDecryptInputStream : NSInputStream 14 | 15 | - (nullable instancetype)initWithStream:(NSInputStream*)upstream 16 | password:(NSString*)password 17 | header:(uint8_t*)header 18 | check:(uint16_t)check 19 | version:(uint8_t)version 20 | error:(out NSError**)error; 21 | 22 | - (void)open; 23 | - (void)close; 24 | 25 | - (NSStreamStatus)streamStatus; 26 | - (NSError*)streamError; 27 | 28 | - (NSInteger)read:(uint8_t*)buffer maxLength:(NSUInteger)len; 29 | - (BOOL)getBuffer:(uint8_t* _Nullable* _Nonnull)buffer length:(NSUInteger*)len; 30 | - (BOOL)hasBytesAvailable; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /lib/include/zipzap/ZZStoreOutputStream.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZZStoreOutputStream.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 13/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZZChannelOutput; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface ZZStoreOutputStream : NSOutputStream 16 | 17 | @property (readonly, nonatomic) uint32_t crc32; 18 | @property (readonly, nonatomic) uint32_t size; 19 | 20 | - (instancetype)initWithChannelOutput:(id)channelOutput; 21 | 22 | - (NSStreamStatus)streamStatus; 23 | - (nullable NSError*)streamError; 24 | 25 | - (void)open; 26 | - (void)close; 27 | 28 | - (NSInteger)write:(const uint8_t*)buffer maxLength:(NSUInteger)length; 29 | - (BOOL)hasSpaceAvailable; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /lib/include/zipzap/zipzap.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZipZap.h 3 | // ZipZap 4 | // 5 | // Created by Glen Low on 31/10/12. 6 | // Copyright (c) 2012, Pixelglow Software. All rights reserved. 7 | // 8 | 9 | // 10 | // Redistribution and use in source and binary forms, with or without modification, 11 | // are permitted provided that the following conditions are met: 12 | // 13 | // * Redistributions of source code must retain the above copyright notice, 14 | // this list of conditions and the following disclaimer. 15 | // 16 | // * Redistributions in binary form must reproduce the above copyright notice, 17 | // this list of conditions and the following disclaimer in the documentation 18 | // and/or other materials provided with the distribution. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 24 | // BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 25 | // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 | // THE POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | 33 | #import 34 | 35 | #import "ZZArchive.h" 36 | #import "ZZArchiveEntry.h" 37 | #import "ZZConstants.h" 38 | #import "ZZError.h" 39 | 40 | //! Project version number for ZipZap. 41 | FOUNDATION_EXPORT double ZipZapVersionNumber; 42 | 43 | //! Project version string for ZipZap. 44 | FOUNDATION_EXPORT const unsigned char ZipZapVersionString[]; 45 | 46 | -------------------------------------------------------------------------------- /lib/libzipzap.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonativeio/gonative-ios/b9be52133792118a2d6c3fda0646f6704777ea19/lib/libzipzap.a -------------------------------------------------------------------------------- /plugins.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'cocoapods' 4 | require 'xcodeproj' 5 | require 'active_support/inflector' 6 | 7 | def use_plugins! 8 | app_config = JSON.parse(File.read(__dir__ + '/LeanIOS/appConfig.json')) 9 | services = app_config['services'] 10 | 11 | services = services.select do |_service_name, service| 12 | next unless service 13 | service['active'] && service['iosPluginName'] 14 | end 15 | 16 | services.each do |service_name, service| 17 | pod_name = service['iosPluginName'] 18 | variant = service['plugin']&.camelize || 'Binary' 19 | 20 | pod "#{pod_name}/#{variant}" 21 | end 22 | end 23 | 24 | def default_app_target 25 | proj_path = Dir.glob("*.xcodeproj").first 26 | proj = Xcodeproj::Project.open(proj_path) 27 | 28 | proj.targets.first.name 29 | end 30 | --------------------------------------------------------------------------------