├── .DS_Store ├── .gitattributes ├── ChatGPT.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── ChatGPT.xccheckout │ └── xcuserdata │ │ ├── methamphetamine.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ ├── tetrahydrocannabinol.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── virtuellady.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── methamphetamine.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ ├── ChatGPT.xcscheme │ │ └── xcschememanagement.plist │ ├── tetrahydrocannabinol.xcuserdatad │ └── xcschemes │ │ ├── ChatGPT.xcscheme │ │ └── xcschememanagement.plist │ └── virtuellady.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── ChatGPT.xcscheme │ └── xcschememanagement.plist ├── ChatGPT ├── .DS_Store ├── Assets │ ├── .DS_Store │ ├── Bundles │ │ ├── .DS_Store │ │ └── Settings.bundle │ │ │ ├── Root.plist │ │ │ └── en.lproj │ │ │ └── Root.strings │ ├── Catalogs │ │ ├── .DS_Store │ │ └── Images.xcassets │ │ │ ├── .DS_Store │ │ │ ├── AppIcon.appiconset │ │ │ ├── .DS_Store │ │ │ ├── Contents.json │ │ │ ├── Group 85.png │ │ │ ├── Group 86-1.png │ │ │ ├── Group 86-2.png │ │ │ ├── Group 86.png │ │ │ ├── Group 87-1.png │ │ │ ├── Group 87-2.png │ │ │ ├── Group 87.png │ │ │ ├── Group 88-1.png │ │ │ ├── Group 88-2.png │ │ │ ├── Group 88.png │ │ │ ├── Group 89-1.png │ │ │ ├── Group 89.png │ │ │ ├── Group 90-1.png │ │ │ ├── Group 90.png │ │ │ ├── Group 91.png │ │ │ └── Group 92.png │ │ │ └── LaunchImage.launchimage │ │ │ ├── .DS_Store │ │ │ ├── 3.5 inch, Legacy.png │ │ │ ├── 3.5 inch, Retina, Legacy-1-1.png │ │ │ ├── 3.5 inch, Retina, Legacy-1.png │ │ │ ├── 3.5 inch, Retina, Legacy-2.png │ │ │ ├── 3.5 inch, Retina, Legacy.png │ │ │ └── Contents.json │ ├── Images │ │ ├── .DS_Store │ │ ├── Bar Resources │ │ │ ├── .DS_Store │ │ │ ├── Bar Button │ │ │ │ ├── .DS_Store │ │ │ │ ├── BarButton.png │ │ │ │ ├── BarButton@2x.png │ │ │ │ ├── BarButtonPressed.png │ │ │ │ ├── BarButtonPressed@2x.png │ │ │ │ ├── Glyphs │ │ │ │ │ ├── IOS7HamburgerGlyph.png │ │ │ │ │ ├── Send.png │ │ │ │ │ ├── Send@2x.png │ │ │ │ │ └── iOS7SendGlyph.png │ │ │ │ ├── MoreGlyph@2x.png │ │ │ │ ├── SendBarButton@2x.png │ │ │ │ ├── SendBarButtonPressed@2x.png │ │ │ │ └── hamburgerButton@2x.png │ │ │ ├── Input Field │ │ │ │ ├── .DS_Store │ │ │ │ ├── ImageViewOL.png │ │ │ │ ├── ImageViewOL@2x.png │ │ │ │ ├── hamburgerButton.png │ │ │ │ ├── iOS7ImageViewOL.png │ │ │ │ ├── iOS7ImageViewOL@2x.png │ │ │ │ ├── iOS7InputOverlay.png │ │ │ │ ├── iOS7InputOverlay@2x.png │ │ │ │ ├── inputOverlay.png │ │ │ │ └── inputOverlay@2x.png │ │ │ ├── bar-BG.png │ │ │ ├── bar-BG@2x.png │ │ │ ├── searchbar-BG.png │ │ │ └── searchbar-BG@2x.png │ │ ├── Cosmetical Helpers │ │ │ ├── .DS_Store │ │ │ ├── Avatar.png │ │ │ ├── Avatar@2x.png │ │ │ ├── ConvHistory.png │ │ │ ├── ConvHistory@2x.png │ │ │ ├── KeyIFButton@2x.png │ │ │ ├── KeyInputField@2x.png │ │ │ ├── Keychain.png │ │ │ ├── SBSeparator.png │ │ │ ├── SBSeparator@2x.png │ │ │ ├── SCThumbnail.png │ │ │ ├── SCThumbnail@2x.png │ │ │ ├── WELInSlide.png │ │ │ ├── WELInSlide@2x.png │ │ │ ├── attachmentCellMask.png │ │ │ ├── attachmentCellMask@2x.png │ │ │ ├── avatarDepthMask.png │ │ │ ├── avatarDepthMask@2x.png │ │ │ ├── big-icon.png │ │ │ ├── iOS7AttachmentCellMask.png │ │ │ ├── iOS7KIF.png │ │ │ ├── iOS7SCT.png │ │ │ ├── iOS7Separator.png │ │ │ ├── iOS7Separator@2x.png │ │ │ ├── iOS7WEL.png │ │ │ ├── iOS7icon.png │ │ │ ├── icon.png │ │ │ ├── loadingToast.png │ │ │ ├── loadingToast@2x.png │ │ │ ├── separator.png │ │ │ ├── separator2.png │ │ │ ├── welcomeButton.png │ │ │ └── welcomeButton@2x.png │ │ ├── Default Avatars │ │ │ ├── .DS_Store │ │ │ ├── IOS7DefaultUserAvatar.png │ │ │ ├── avatarOverlay@2x.png │ │ │ ├── defaultAssistantAvatar.png │ │ │ ├── defaultAssistantAvatar@2x.png │ │ │ ├── defaultUserAvatar.png │ │ │ ├── defaultUserAvatar@2x.png │ │ │ ├── iOS7AssistantAvatar.png │ │ │ └── iOS7AvatarOverlay.png │ │ └── Sidebar Resources │ │ │ ├── headerSeparator.png │ │ │ ├── headerSeparator@2x.png │ │ │ ├── iOS7HeaderSeparator.png │ │ │ ├── iOS7SBSeparator.png │ │ │ ├── iOS7newConversationThumbnail.png │ │ │ ├── newConversationThumbnail.png │ │ │ └── newConversationThumbnail@2x.png │ └── XIBs │ │ └── .DS_Store ├── Base.lproj │ ├── .DS_Store │ └── Main.storyboard ├── Classes │ ├── .DS_Store │ ├── API │ │ ├── CGAPICommunicator.h │ │ ├── CGAPICommunicator.m │ │ ├── CGAPIHelper.h │ │ ├── CGAPIHelper.m │ │ ├── CGConversation.h │ │ ├── CGConversation.m │ │ ├── CGMessage.h │ │ └── CGMessage.m │ ├── Cells │ │ ├── .DS_Store │ │ ├── CGAImageAttachment.h │ │ ├── CGAImageAttachment.m │ │ ├── CGAImageAttachment.xib │ │ ├── CGAuthorChatTableCell.xib │ │ ├── CGAuthorTableCell.h │ │ ├── CGAuthorTableCell.m │ │ ├── CGChatTableCell.h │ │ ├── CGChatTableCell.m │ │ ├── CGChatTableCell.xib │ │ ├── CGConversationElementCell.h │ │ ├── CGConversationElementCell.m │ │ ├── CGImageAttachment.h │ │ ├── CGImageAttachment.m │ │ └── CGImageAttachment.xib │ ├── Delegate │ │ ├── .DS_Store │ │ ├── CGAppDelegate.h │ │ ├── CGAppDelegate.m │ │ └── main.m │ └── View Controllers │ │ ├── .DS_Store │ │ ├── Chat View │ │ ├── CGChatViewController.h │ │ └── CGChatViewController.m │ │ ├── Image View Controller │ │ ├── .DS_Store │ │ ├── CGImageViewController.h │ │ └── CGImageViewController.m │ │ ├── Sidebar │ │ ├── CGSidebarController.h │ │ └── CGSidebarController.m │ │ └── Welcome View │ │ ├── CGWelcomeController.h │ │ └── CGWelcomeController.m ├── Libraries │ ├── .DS_Store │ ├── APLSlideMenu │ │ ├── APLSlideMenuSegue.h │ │ ├── APLSlideMenuSegue.m │ │ ├── APLSlideMenuViewController.h │ │ └── APLSlideMenuViewController.m │ ├── Base64 │ │ ├── Base64.h │ │ └── Base64.m │ ├── NSURLConnection-Curl │ │ ├── NSURLConnection+FoundationCompletions.h │ │ └── NSURLConnection+FoundationCompletions.m │ ├── SSL │ │ ├── curl │ │ │ ├── curl.h │ │ │ ├── curlver.h │ │ │ ├── easy.h │ │ │ ├── mprintf.h │ │ │ ├── multi.h │ │ │ ├── stdcheaders.h │ │ │ ├── system.h │ │ │ ├── typecheck-gcc.h │ │ │ └── types.h │ │ ├── libcrypto.a │ │ ├── libcurl.a │ │ ├── libssl.a │ │ └── libz.a │ ├── SVProgressHUD │ │ ├── .DS_Store │ │ ├── SVProgressHUD-15e9190d.o.tmp │ │ ├── SVProgressHUD-Prefix.pch │ │ ├── SVProgressHUD.bundle │ │ │ ├── error-black.png │ │ │ ├── error-black@2x.png │ │ │ ├── error.png │ │ │ ├── error@2x.png │ │ │ ├── success-black.png │ │ │ ├── success-black@2x.png │ │ │ ├── success.png │ │ │ └── success@2x.png │ │ ├── SVProgressHUD.h │ │ └── SVProgressHUD.m │ ├── TRMalleableFrameView │ │ ├── TRMalleableFrameView.h │ │ └── TRMalleableFrameView.m │ └── TSMarkdownParser │ │ ├── TSMarkdownParser-Prefix.pch │ │ ├── TSMarkdownParser.h │ │ └── TSMarkdownParser.m ├── SupportingFiles │ ├── .DS_Store │ ├── ChatGPT-Info.plist │ └── ChatGPT-Prefix.pch └── en.lproj │ └── InfoPlist.strings ├── ChatGPTTests ├── ChatGPTTests-Info.plist ├── ChatGPTTests.m └── en.lproj │ └── InfoPlist.strings └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/project.xcworkspace/xcshareddata/ChatGPT.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | C1F4430A-E1DB-4B2F-975C-62FF1B13A5B0 9 | IDESourceControlProjectName 10 | ChatGPT 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | B690B00D-C672-475D-8EF7-EC64DBEEBE6B 14 | https://github.com/bag-xml/ChatGPT-for-Legacy-iOS.git 15 | 16 | IDESourceControlProjectPath 17 | ChatGPT.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | B690B00D-C672-475D-8EF7-EC64DBEEBE6B 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/bag-xml/ChatGPT-for-Legacy-iOS.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | B690B00D-C672-475D-8EF7-EC64DBEEBE6B 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | B690B00D-C672-475D-8EF7-EC64DBEEBE6B 36 | IDESourceControlWCCName 37 | ChatGPT-for-Legacy-iOS 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/project.xcworkspace/xcuserdata/methamphetamine.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT.xcodeproj/project.xcworkspace/xcuserdata/methamphetamine.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/project.xcworkspace/xcuserdata/tetrahydrocannabinol.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT.xcodeproj/project.xcworkspace/xcuserdata/tetrahydrocannabinol.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/project.xcworkspace/xcuserdata/virtuellady.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT.xcodeproj/project.xcworkspace/xcuserdata/virtuellady.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/methamphetamine.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/methamphetamine.xcuserdatad/xcschemes/ChatGPT.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/methamphetamine.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ChatGPT.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 49A1BBC22D351874002D9D00 16 | 17 | primary 18 | 19 | 20 | 49A1BBE32D351874002D9D00 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/tetrahydrocannabinol.xcuserdatad/xcschemes/ChatGPT.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/tetrahydrocannabinol.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ChatGPT.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 49A1BBC22D351874002D9D00 16 | 17 | primary 18 | 19 | 20 | 49A1BBE32D351874002D9D00 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/virtuellady.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 50 | 51 | 64 | 65 | 66 | 67 | 68 | 70 | 82 | 83 | 84 | 86 | 98 | 99 | 100 | 102 | 114 | 115 | 116 | 118 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/virtuellady.xcuserdatad/xcschemes/ChatGPT.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /ChatGPT.xcodeproj/xcuserdata/virtuellady.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ChatGPT.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 49A1BBC22D351874002D9D00 16 | 17 | primary 18 | 19 | 20 | 49A1BBE32D351874002D9D00 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ChatGPT/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Bundles/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Bundles/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Bundles/Settings.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | Enter an OpenAI API key here. Please make sure it's not expired or doesn't work. The application will warn you if it doesn't work. 10 | Title 11 | API Settings 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | Type 17 | PSTextFieldSpecifier 18 | Title 19 | API Secret 20 | Key 21 | apiKey 22 | 23 | 24 | FooterText 25 | Here you can choose the model you'd like to use for chat completions or image generation. I recommend not changing anything if you don't know what you're doing. 26 | Type 27 | PSGroupSpecifier 28 | Title 29 | Advanced Settings 30 | 31 | 32 | DefaultValue 33 | gpt-4o-mini 34 | Type 35 | PSTextFieldSpecifier 36 | Title 37 | Completion-Model 38 | Key 39 | c-aiModel 40 | 41 | 42 | DefaultValue 43 | dall-e-3 44 | Type 45 | PSTextFieldSpecifier 46 | Title 47 | Image-Model 48 | Key 49 | i-aiModel 50 | 51 | 52 | StringsTable 53 | Root 54 | 55 | 56 | -------------------------------------------------------------------------------- /ChatGPT/Assets/Bundles/Settings.bundle/en.lproj/Root.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Bundles/Settings.bundle/en.lproj/Root.strings -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Group 88.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Group 87.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Group 86-1.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "57x57", 23 | "idiom" : "iphone", 24 | "filename" : "Group 86.png", 25 | "scale" : "1x" 26 | }, 27 | { 28 | "size" : "57x57", 29 | "idiom" : "iphone", 30 | "filename" : "Group 85.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Group 87-2.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "Group 88-1.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "Group 87-1.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "Group 90-1.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "Group 86-2.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "50x50", 65 | "idiom" : "ipad", 66 | "filename" : "Group 89.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "50x50", 71 | "idiom" : "ipad", 72 | "filename" : "Group 90.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "72x72", 77 | "idiom" : "ipad", 78 | "filename" : "Group 91.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "72x72", 83 | "idiom" : "ipad", 84 | "filename" : "Group 92.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "Group 89-1.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Group 88-2.png", 97 | "scale" : "2x" 98 | } 99 | ], 100 | "info" : { 101 | "version" : 1, 102 | "author" : "xcode" 103 | }, 104 | "properties" : { 105 | "pre-rendered" : true 106 | } 107 | } -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 85.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 85.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 86-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 86-1.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 86-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 86-2.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 86.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 86.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 87-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 87-1.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 87-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 87-2.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 87.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 88-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 88-1.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 88-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 88-2.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 88.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 89-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 89-1.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 89.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 89.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 90-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 90-1.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 90.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 91.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 91.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 92.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/AppIcon.appiconset/Group 92.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Legacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Legacy.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy-1-1.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy-1.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy-2.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/3.5 inch, Retina, Legacy.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Catalogs/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "filename" : "3.5 inch, Retina, Legacy-2.png", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "extent" : "full-screen", 13 | "idiom" : "iphone", 14 | "subtype" : "retina4", 15 | "filename" : "3.5 inch, Retina, Legacy-1-1.png", 16 | "minimum-system-version" : "7.0", 17 | "orientation" : "portrait", 18 | "scale" : "2x" 19 | }, 20 | { 21 | "orientation" : "portrait", 22 | "idiom" : "iphone", 23 | "extent" : "full-screen", 24 | "filename" : "3.5 inch, Legacy.png", 25 | "scale" : "1x" 26 | }, 27 | { 28 | "orientation" : "portrait", 29 | "idiom" : "iphone", 30 | "extent" : "full-screen", 31 | "filename" : "3.5 inch, Retina, Legacy.png", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "orientation" : "portrait", 36 | "idiom" : "iphone", 37 | "extent" : "full-screen", 38 | "filename" : "3.5 inch, Retina, Legacy-1.png", 39 | "subtype" : "retina4", 40 | "scale" : "2x" 41 | } 42 | ], 43 | "info" : { 44 | "version" : 1, 45 | "author" : "xcode" 46 | } 47 | } -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButton.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButton@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButtonPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButtonPressed.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButtonPressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/BarButtonPressed@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/IOS7HamburgerGlyph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/IOS7HamburgerGlyph.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/Send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/Send.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/Send@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/Send@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/iOS7SendGlyph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/Glyphs/iOS7SendGlyph.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/MoreGlyph@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/MoreGlyph@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/SendBarButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/SendBarButton@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/SendBarButtonPressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/SendBarButtonPressed@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Bar Button/hamburgerButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Bar Button/hamburgerButton@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/ImageViewOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/ImageViewOL.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/ImageViewOL@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/ImageViewOL@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/hamburgerButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/hamburgerButton.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7ImageViewOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7ImageViewOL.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7ImageViewOL@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7ImageViewOL@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7InputOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7InputOverlay.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7InputOverlay@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/iOS7InputOverlay@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/inputOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/inputOverlay.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/Input Field/inputOverlay@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/Input Field/inputOverlay@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/bar-BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/bar-BG.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/bar-BG@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/bar-BG@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/searchbar-BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/searchbar-BG.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Bar Resources/searchbar-BG@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Bar Resources/searchbar-BG@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/Avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/Avatar.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/Avatar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/Avatar@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/ConvHistory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/ConvHistory.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/ConvHistory@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/ConvHistory@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/KeyIFButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/KeyIFButton@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/KeyInputField@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/KeyInputField@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/Keychain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/Keychain.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/SBSeparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/SBSeparator.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/SBSeparator@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/SBSeparator@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/SCThumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/SCThumbnail.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/SCThumbnail@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/SCThumbnail@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/WELInSlide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/WELInSlide.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/WELInSlide@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/WELInSlide@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/attachmentCellMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/attachmentCellMask.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/attachmentCellMask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/attachmentCellMask@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/avatarDepthMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/avatarDepthMask.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/avatarDepthMask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/avatarDepthMask@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/big-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/big-icon.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/iOS7AttachmentCellMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/iOS7AttachmentCellMask.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/iOS7KIF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/iOS7KIF.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/iOS7SCT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/iOS7SCT.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/iOS7Separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/iOS7Separator.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/iOS7Separator@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/iOS7Separator@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/iOS7WEL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/iOS7WEL.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/iOS7icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/iOS7icon.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/icon.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/loadingToast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/loadingToast.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/loadingToast@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/loadingToast@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/separator.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/separator2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/separator2.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/welcomeButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/welcomeButton.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Cosmetical Helpers/welcomeButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Cosmetical Helpers/welcomeButton@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/IOS7DefaultUserAvatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/IOS7DefaultUserAvatar.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/avatarOverlay@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/avatarOverlay@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/defaultAssistantAvatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/defaultAssistantAvatar.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/defaultAssistantAvatar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/defaultAssistantAvatar@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/defaultUserAvatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/defaultUserAvatar.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/defaultUserAvatar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/defaultUserAvatar@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/iOS7AssistantAvatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/iOS7AssistantAvatar.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Default Avatars/iOS7AvatarOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Default Avatars/iOS7AvatarOverlay.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Sidebar Resources/headerSeparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Sidebar Resources/headerSeparator.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Sidebar Resources/headerSeparator@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Sidebar Resources/headerSeparator@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Sidebar Resources/iOS7HeaderSeparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Sidebar Resources/iOS7HeaderSeparator.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Sidebar Resources/iOS7SBSeparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Sidebar Resources/iOS7SBSeparator.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Sidebar Resources/iOS7newConversationThumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Sidebar Resources/iOS7newConversationThumbnail.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Sidebar Resources/newConversationThumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Sidebar Resources/newConversationThumbnail.png -------------------------------------------------------------------------------- /ChatGPT/Assets/Images/Sidebar Resources/newConversationThumbnail@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/Images/Sidebar Resources/newConversationThumbnail@2x.png -------------------------------------------------------------------------------- /ChatGPT/Assets/XIBs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Assets/XIBs/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Base.lproj/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Base.lproj/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Classes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Classes/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Classes/API/CGAPICommunicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGAPICommunicator.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CGMessage.h" 11 | #import "CGAPIHelper.h" 12 | 13 | @interface CGAPICommunicator : NSObject 14 | 15 | @property (nonatomic, strong) NSMutableArray *activeConnections; 16 | 17 | + (void)createChatCompletionwithContent:(NSMutableArray *)content; 18 | + (void)createImageGenerationWithContent:(NSString *)content; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ChatGPT/Classes/API/CGAPICommunicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGAPICommunicator.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGAPICommunicator.h" 10 | 11 | @implementation CGAPICommunicator 12 | 13 | + (void)createChatCompletionwithContent:(NSMutableArray *)content { 14 | 15 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 16 | [NSNotificationCenter.defaultCenter postNotificationName:@"THINK STATUS" object:nil]; 17 | [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 18 | NSURL *chatCompletionEndpoint = [NSURL URLWithString:[NSString stringWithFormat:@"%@/v1/chat/completions", domain]]; 19 | 20 | NSURLResponse *response; 21 | NSError *error; 22 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 23 | 24 | NSMutableArray *messagesArray = [NSMutableArray array]; 25 | 26 | for (CGMessage *message in content) { 27 | if (message.type == 2 && message.imageHash != nil) { 28 | continue; 29 | } 30 | 31 | NSMutableDictionary *messageDict = [NSMutableDictionary dictionary]; 32 | 33 | // Set basic role 34 | [messageDict setObject:(message.role ?: @"user") forKey:@"role"]; 35 | 36 | NSMutableArray *contentArray = [NSMutableArray array]; 37 | if (message.content && message.content.length > 0) { 38 | NSDictionary *textContentDict = @{ 39 | @"type": @"text", 40 | @"text": message.content 41 | }; 42 | [contentArray addObject:textContentDict]; 43 | } 44 | if (message.imageHash) { 45 | NSDictionary *imageContentDict = @{ 46 | @"type": @"image_url", 47 | @"image_url": @{@"url": [NSString stringWithFormat:@"data:image/jpeg;base64,%@", message.imageHash]} 48 | }; 49 | [contentArray addObject:imageContentDict]; 50 | } 51 | 52 | [messageDict setObject:contentArray forKey:@"content"]; 53 | 54 | [messagesArray addObject:messageDict]; 55 | } 56 | 57 | NSString *model = [[NSUserDefaults standardUserDefaults] objectForKey:@"c-aiModel"]; 58 | 59 | if (!model || [model length] == 0) { 60 | [CGAPIHelper alert:@"Missing Model" withMessage:@"Please re-check your model settings. Your model was set back to 'gpt-4o-mini' for this session."]; 61 | model = @"gpt-4o-mini"; 62 | } 63 | 64 | NSDictionary *body = @{ 65 | @"model": model, 66 | @"messages": messagesArray 67 | }; 68 | 69 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:body options:0 error:nil]; 70 | 71 | [request setURL:chatCompletionEndpoint]; 72 | [request setHTTPMethod:@"POST"]; 73 | [request setHTTPBody:jsonData]; 74 | [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; 75 | [request setValue:[NSString stringWithFormat:@"Bearer %@", apiKey] forHTTPHeaderField:@"Authorization"]; 76 | 77 | 78 | 79 | NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; 80 | if(data) { 81 | 82 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 83 | NSDictionary* parsedResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; 84 | //error handling 85 | NSDictionary *errorDict = [parsedResponse objectForKey:@"error"]; 86 | if(errorDict) { 87 | CGMessage *visualEM = [CGAPIHelper loopErrorBack:[errorDict objectForKey:@"message"]]; 88 | dispatch_async(dispatch_get_main_queue(), ^{ 89 | [NSNotificationCenter.defaultCenter postNotificationName:@"AI RESPONSE" object:visualEM]; 90 | [CGAPIHelper alert:@"Warning" withMessage:[NSString stringWithFormat:@"%@", [errorDict objectForKey:@"message"]]]; 91 | }); 92 | return; 93 | } 94 | 95 | CGMessage *convertedMessage = [CGAPIHelper convertTextCompletionResponse:parsedResponse]; 96 | dispatch_async(dispatch_get_main_queue(), ^{ 97 | [NSNotificationCenter.defaultCenter postNotificationName:@"AI RESPONSE" object:convertedMessage]; 98 | }); 99 | } else { 100 | NSLog(@"%@", error); 101 | [NSNotificationCenter.defaultCenter postNotificationName:@"CANCEL LOAD" object:nil]; 102 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 103 | CGMessage *visualEM = [CGAPIHelper loopErrorBack:@"Please make sure you're **connected to a Wi-Fi network or have cellular data enabled**. ChatGPT cannot connect to OpenAI's services at the moment. **Please try again later.**"]; 104 | dispatch_async(dispatch_get_main_queue(), ^{ 105 | [NSNotificationCenter.defaultCenter postNotificationName:@"AI RESPONSE" object:visualEM]; 106 | }); 107 | return; 108 | } 109 | }); 110 | } 111 | 112 | + (void)createImageGenerationWithContent:(NSString *)content { 113 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 114 | [NSNotificationCenter.defaultCenter postNotificationName:@"THINK STATUS" object:nil]; 115 | [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 116 | 117 | NSURL *chatCompletionEndpoint = [NSURL URLWithString:[NSString stringWithFormat:@"%@/v1/images/generations", domain]]; 118 | NSURLResponse *response; 119 | NSError *error; 120 | 121 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 122 | 123 | 124 | NSString *model = [[NSUserDefaults standardUserDefaults] objectForKey:@"i-aiModel"]; 125 | 126 | if (!model || [model length] == 0) { 127 | [CGAPIHelper alert:@"Missing Model" withMessage:@"Please re-check your model settings. Your model was set back to 'dall-e-3' for this session."]; 128 | model = @"dall-e-3"; 129 | } 130 | 131 | NSDictionary *body = @{ 132 | @"model": model, 133 | @"prompt": content, 134 | @"n": @1, 135 | @"size": @"1024x1024", 136 | @"response_format": @"b64_json" 137 | }; 138 | 139 | 140 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:body options:0 error:nil]; 141 | 142 | [request setURL:chatCompletionEndpoint]; 143 | [request setHTTPMethod:@"POST"]; 144 | [request setHTTPBody:jsonData]; 145 | [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; 146 | [request setValue:[NSString stringWithFormat:@"Bearer %@", apiKey] forHTTPHeaderField:@"Authorization"]; 147 | 148 | 149 | 150 | NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; 151 | 152 | if(data) { 153 | 154 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 155 | NSDictionary* parsedResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; 156 | 157 | //error handling 158 | NSDictionary *errorDict = [parsedResponse objectForKey:@"error"]; 159 | if(errorDict) { 160 | CGMessage *visualEM = [CGAPIHelper loopErrorBack:[errorDict objectForKey:@"message"]]; 161 | dispatch_async(dispatch_get_main_queue(), ^{ 162 | [NSNotificationCenter.defaultCenter postNotificationName:@"AI RESPONSE" object:visualEM]; 163 | [CGAPIHelper alert:@"Warning" withMessage:[NSString stringWithFormat:@"%@", [errorDict objectForKey:@"message"]]]; 164 | }); 165 | return; 166 | } 167 | 168 | CGMessage *convertedMessage = [CGAPIHelper convertImageGenerationResponse:parsedResponse]; 169 | dispatch_async(dispatch_get_main_queue(), ^{ 170 | [NSNotificationCenter.defaultCenter postNotificationName:@"AI RESPONSE" object:convertedMessage]; 171 | }); 172 | 173 | } else { 174 | [NSNotificationCenter.defaultCenter postNotificationName:@"CANCEL LOAD" object:nil]; 175 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 176 | CGMessage *visualEM = [CGAPIHelper loopErrorBack:@"Please make sure you're **connected to a Wi-Fi network or have cellular data enabled**. ChatGPT cannot connect to OpenAI's services at the moment. **Please try again later.**"]; 177 | dispatch_async(dispatch_get_main_queue(), ^{ 178 | [NSNotificationCenter.defaultCenter postNotificationName:@"AI RESPONSE" object:visualEM]; 179 | }); 180 | return; 181 | } 182 | }); 183 | 184 | } 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /ChatGPT/Classes/API/CGAPIHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGAPIHelper.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Base64.h" 11 | #import "SVProgressHUD.h" 12 | 13 | #import "CGMessage.h" 14 | #import "CGConversation.h" 15 | 16 | #define domain @"https://api.openai.com" 17 | #define apiKey [[NSUserDefaults standardUserDefaults] objectForKey:@"apiKey"] 18 | 19 | //User settable params 20 | #define updateChecks YES 21 | 22 | #define UDCheckServer @"http://5.230.249.85:7530" 23 | #define appVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] 24 | 25 | #define VERSION_MIN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 26 | 27 | #define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double) 568) < DBL_EPSILON) 28 | #define IS_IPHONE_4 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double) 480) < DBL_EPSILON) 29 | #define IS_IPHONE_3GS (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double) 240) < DBL_EPSILON) 30 | 31 | @interface CGAPIHelper : NSObject 32 | 33 | @property NSDictionary *currentAccount; 34 | 35 | + (CGMessage*)convertTextCompletionResponse:(NSDictionary*)jsonMessage; 36 | + (CGMessage*)convertImageGenerationResponse:(NSDictionary*)jsonMessage; 37 | + (CGMessage*)loopErrorBack:(NSString*)errorMessage; 38 | 39 | + (NSMutableArray*)loadConversations; 40 | 41 | + (void)checkForAppUpdate; 42 | + (void)checkForAPIKeyValidity; 43 | + (void)logInUserwithKey:(NSString*)key; 44 | //Miscellaneous functions 45 | + (void)alert:(NSString*)title withMessage:(NSString*)message; 46 | 47 | //Conversation saving, updating, loading and listing logic 48 | + (void)saveConversationWithArray:(NSMutableArray *)conversationArray withID:(NSString *)uuid withTitle:(NSString *)title; 49 | + (BOOL)deleteConversationWithUUID:(NSString *)uuid; 50 | + (BOOL)deleteAllConversations; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /ChatGPT/Classes/API/CGConversation.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGConversation.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 23/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGConversation : NSObject 12 | 13 | @property NSString *uuid; 14 | @property NSString *creationDate; 15 | @property NSString *lastTimeEdited; 16 | @property NSString *title; 17 | @property int messageCount; 18 | 19 | @property NSMutableArray *messages; 20 | 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ChatGPT/Classes/API/CGConversation.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGConversation.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 23/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGConversation.h" 10 | 11 | @implementation CGConversation 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ChatGPT/Classes/API/CGMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGMessage.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGMessage : NSObject 12 | 13 | @property NSString *author; 14 | @property NSString *username; 15 | @property UIImage *avatar; 16 | @property NSString *content; 17 | @property NSString *imageHash; 18 | @property UIImage *imageAttachment; //rm -rf --no-preserve 19 | @property NSString *role; 20 | 21 | @property int type; 22 | @property bool indestructible; 23 | 24 | 25 | //a 26 | @property int contentHeight; 27 | @property int authorNameWidth; 28 | @property int indexForImageRow; 29 | 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ChatGPT/Classes/API/CGMessage.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGMessage.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGMessage.h" 10 | 11 | @implementation CGMessage 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Classes/Cells/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGAImageAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGAImageAttachment.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 18/03/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CGAPIHelper.h" 11 | 12 | @interface CGAImageAttachment : UITableViewCell 13 | 14 | @property (weak, nonatomic) IBOutlet UIImageView *thumbnail; 15 | @property (weak, nonatomic) IBOutlet UIView *totalThumbView; 16 | @property (weak, nonatomic) IBOutlet UIImageView *thumbMask; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGAImageAttachment.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGAImageAttachment.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 18/03/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGAImageAttachment.h" 10 | 11 | @implementation CGAImageAttachment 12 | 13 | - (void)awakeFromNib 14 | { 15 | // Initialization code 16 | } 17 | 18 | - (void)layoutSubviews { 19 | [super layoutSubviews]; 20 | if(VERSION_MIN(@"7.0")) { 21 | } else { 22 | CAGradientLayer *gradient = [CAGradientLayer layer]; 23 | gradient.frame = self.bounds; 24 | gradient.colors = @[(id)[UIColor colorWithRed:0.922 green:0.922 blue:0.922 alpha:1.0].CGColor, // #ebebeb 25 | (id)[UIColor colorWithRed:0.949 green:0.949 blue:0.949 alpha:1.0].CGColor]; // #f2f2f2 26 | 27 | gradient.startPoint = CGPointMake(0.5, 0.0); 28 | gradient.endPoint = CGPointMake(0.5, 1.0); 29 | 30 | [self.contentView.layer insertSublayer:gradient atIndex:0]; 31 | } 32 | } 33 | 34 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 35 | { 36 | [super setSelected:selected animated:animated]; 37 | 38 | // Configure the view for the selected state 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGAImageAttachment.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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGAuthorChatTableCell.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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGAuthorTableCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGAuthorTableCell.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 02/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGAuthorTableCell : UITableViewCell 12 | 13 | @property (weak, nonatomic) IBOutlet UIImageView *avatar; 14 | @property (weak, nonatomic) IBOutlet UILabel *authorLabel; 15 | @property (weak, nonatomic) IBOutlet UIImageView *aOverlay; 16 | @property (weak, nonatomic) IBOutlet UITextView *contentTextView; 17 | @property (weak, nonatomic) IBOutlet UIImageView *separator; 18 | @property (weak, nonatomic) IBOutlet UIImageView *iOS7Separator; 19 | @end 20 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGAuthorTableCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGAuthorTableCell.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 02/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGAuthorTableCell.h" 10 | 11 | @implementation CGAuthorTableCell 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGChatTableCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGChatTableCell.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 18/01/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TSMarkdownParser.h" 11 | 12 | @interface CGChatTableCell : UITableViewCell 13 | 14 | @property (weak, nonatomic) IBOutlet UIImageView *avatar; 15 | @property (weak, nonatomic) IBOutlet UILabel *authorLabel; 16 | @property (weak, nonatomic) IBOutlet UITextView *contentTextView; 17 | @property (weak, nonatomic) IBOutlet UIImageView *separator; 18 | @property (weak, nonatomic) IBOutlet UIImageView *iOS7Separator; 19 | 20 | - (void)configureWithMessage:(NSString *)messageText; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGChatTableCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGChatTableCell.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 18/01/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGChatTableCell.h" 10 | 11 | @implementation CGChatTableCell 12 | 13 | - (void)configureWithMessage:(NSString *)messageText { 14 | TSMarkdownParser *parser = [TSMarkdownParser standardParser]; 15 | 16 | NSAttributedString *attributedText = [parser attributedStringFromMarkdown:messageText]; 17 | if (attributedText) { 18 | } else { 19 | } 20 | 21 | self.contentTextView.attributedText = attributedText; 22 | [self adjustTextViewSize]; 23 | } 24 | 25 | 26 | - (void)adjustTextViewSize { 27 | CGSize maxSize = CGSizeMake(self.contentTextView.frame.size.width, CGFLOAT_MAX); 28 | CGSize newSize = [self.contentTextView sizeThatFits:maxSize]; 29 | 30 | CGRect newFrame = self.contentTextView.frame; 31 | newFrame.size.height = newSize.height; 32 | self.contentTextView.frame = newFrame; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGChatTableCell.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 | 29 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGConversationElementCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGConversationElementCell.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 23/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGConversationElementCell : UITableViewCell 12 | 13 | @property (weak, nonatomic) IBOutlet UILabel *conversationName; 14 | @property (weak, nonatomic) IBOutlet UIImageView *separator; 15 | @property (weak, nonatomic) IBOutlet UIImageView *iOS7Separator; 16 | 17 | @property (weak, nonatomic) IBOutlet UIImageView *thumbnail; 18 | @property (weak, nonatomic) IBOutlet UILabel *accessoryLabel; 19 | @end 20 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGConversationElementCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGConversationElementCell.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 23/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGConversationElementCell.h" 10 | 11 | @implementation CGConversationElementCell 12 | 13 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 14 | { 15 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 16 | if (self) { 17 | // Initialization code 18 | } 19 | return self; 20 | } 21 | 22 | - (void)awakeFromNib 23 | { 24 | // Initialization code 25 | } 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGImageAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGImageAttachment.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 18/03/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CGAPIHelper.h" 11 | 12 | @interface CGImageAttachment : UITableViewCell 13 | 14 | @property (weak, nonatomic) IBOutlet UIImageView *thumbnail; 15 | @property (weak, nonatomic) IBOutlet UIView *totalThumbView; 16 | @property (weak, nonatomic) IBOutlet UIImageView *thumbMask; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGImageAttachment.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGImageAttachment.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 18/03/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGImageAttachment.h" 10 | 11 | @implementation CGImageAttachment 12 | 13 | - (void)awakeFromNib 14 | { 15 | // Initialization code 16 | } 17 | 18 | - (void)layoutSubviews { 19 | [super layoutSubviews]; 20 | if(VERSION_MIN(@"7.0")) { 21 | } else { 22 | CAGradientLayer *gradient = [CAGradientLayer layer]; 23 | gradient.frame = self.bounds; 24 | gradient.colors = @[(id)[UIColor colorWithRed:0.949 green:0.949 blue:0.949 alpha:1.0].CGColor, // #f2f2f2 25 | (id)[UIColor colorWithRed:0.882 green:0.882 blue:0.882 alpha:1.0].CGColor]; // #e1e1e1 26 | 27 | gradient.startPoint = CGPointMake(0.5, 0.0); 28 | gradient.endPoint = CGPointMake(0.5, 1.0); 29 | 30 | [self.contentView.layer insertSublayer:gradient atIndex:0]; 31 | } 32 | } 33 | 34 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated 35 | { 36 | [super setSelected:selected animated:animated]; 37 | 38 | // Configure the view for the selected state 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Cells/CGImageAttachment.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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Delegate/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Classes/Delegate/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Classes/Delegate/CGAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGAppDelegate.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CGAPIHelper.h" 11 | #import "CGChatViewController.h" 12 | 13 | @interface CGAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Delegate/CGAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGAppDelegate.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGAppDelegate.h" 10 | 11 | @implementation CGAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | 16 | bool nFL = [[NSUserDefaults standardUserDefaults] boolForKey:@"nFL"]; 17 | 18 | if(nFL == NO) { 19 | [[NSUserDefaults standardUserDefaults] setObject:@"gpt-4o-mini" forKey:@"c-aiModel"]; 20 | [[NSUserDefaults standardUserDefaults] setObject:@"dall-e-3" forKey:@"i-aiModel"]; 21 | 22 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"nFL"]; 23 | } 24 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"aFL"]; 25 | return YES; 26 | } 27 | 28 | - (void)applicationWillResignActive:(UIApplication *)application 29 | { 30 | NSLog(@"Will resign active"); 31 | [[NSUserDefaults standardUserDefaults] synchronize]; 32 | bool yougetwhatimean = [[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]; 33 | if(yougetwhatimean == YES) 34 | [self checkAPICredentials]; 35 | 36 | } 37 | 38 | - (void)applicationDidEnterBackground:(UIApplication *)application 39 | { 40 | NSLog(@"Did enter background"); 41 | [NSNotificationCenter.defaultCenter postNotificationName:@"SAVE CHAT" object:nil]; 42 | [[NSUserDefaults standardUserDefaults] synchronize]; 43 | } 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application 46 | { 47 | NSLog(@"Will enter foreground"); 48 | [[NSUserDefaults standardUserDefaults] synchronize]; 49 | } 50 | 51 | - (void)applicationDidBecomeActive:(UIApplication *)application 52 | { 53 | NSLog(@"Did become active"); 54 | [NSNotificationCenter.defaultCenter postNotificationName:@"RE-CHECK CONVOS" object:nil]; 55 | [[NSUserDefaults standardUserDefaults] synchronize]; 56 | } 57 | 58 | - (void)applicationWillTerminate:(UIApplication *)application 59 | { 60 | NSLog(@"Will terminate"); 61 | //Save it HERE 62 | [NSNotificationCenter.defaultCenter postNotificationName:@"SAVE CHAT" object:nil]; 63 | [[NSUserDefaults standardUserDefaults] synchronize]; 64 | } 65 | 66 | 67 | - (void)checkAPICredentials { 68 | if(apiKey == nil) { 69 | [CGAPIHelper alert:@"Warning" withMessage:@"Your API Key is missing, please double-check the settings pane and make sure you've inputted an OpenAI API Key."]; 70 | } else if([apiKey isEqual:@""]) { 71 | [CGAPIHelper alert:@"Warning" withMessage:@"Your API Key is missing, please double-check the settings pane and make sure you've inputted an OpenAI API Key."]; 72 | } else { 73 | [CGAPIHelper checkForAPIKeyValidity]; 74 | } 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /ChatGPT/Classes/Delegate/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CGAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CGAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Classes/View Controllers/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Chat View/CGChatViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGChatViewController.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TRMalleableFrameView.h" 11 | #import "Base64.h" 12 | #import "APLSlideMenuViewController.h" 13 | 14 | #import "CGAPIHelper.h" 15 | #import "CGMessage.h" 16 | #import "CGAPICommunicator.h" 17 | 18 | #import "CGImageViewController.h" 19 | 20 | #import "CGImageAttachment.h" 21 | #import "CGAImageAttachment.h" 22 | 23 | #import "CGChatTableCell.h" 24 | #import "CGAuthorTableCell.h" 25 | 26 | 27 | @interface CGChatViewController : UIViewController 28 | 29 | @property (weak, nonatomic) IBOutlet UITableView *chatTableView; 30 | @property (weak, nonatomic) IBOutlet UIView *typeView; 31 | @property (weak, nonatomic) IBOutlet UIImageView *IVOverlayImage; 32 | @property (weak, nonatomic) IBOutlet UIToolbar *toolbar; 33 | 34 | @property (weak, nonatomic) IBOutlet UIView *welcomeView; 35 | 36 | @property (weak, nonatomic) IBOutlet UIView *inputView; 37 | @property (weak, nonatomic) IBOutlet UITextView *inputField; 38 | 39 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *sendButton; 40 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *photoButton; 41 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *topRightButton; 42 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *hamburgerButton; 43 | 44 | @property (weak, nonatomic) IBOutlet UILabel *inputFieldPlaceholder; 45 | 46 | @property (weak, nonatomic) IBOutlet UIView *attachmentView; 47 | @property (weak, nonatomic) IBOutlet UIImageView *attachmentMask; 48 | @property (weak, nonatomic) IBOutlet UIImageView *attachmentImage; 49 | 50 | @property (strong, nonatomic) NSString *currentImage; 51 | 52 | 53 | //Labels && Different things 54 | @property (weak, nonatomic) IBOutlet UILabel *WelcomeHead; 55 | @property (weak, nonatomic) IBOutlet UIImageView *WelcomeImage; 56 | 57 | @property (weak, nonatomic) IBOutlet UIImageView *LoadingToast; 58 | @property (weak, nonatomic) IBOutlet UIImageView *LAvatar; 59 | @property (weak, nonatomic) IBOutlet UILabel *LUserLabel; 60 | @property (weak, nonatomic) IBOutlet UILabel *LThinkLabel; 61 | 62 | //welcom 63 | 64 | 65 | @property UIImage *selectedImage; 66 | @property NSString *currentConversationID; 67 | //@property NSString 68 | @property NSMutableArray* messages; 69 | @property bool viewingPresentTime; 70 | @property bool done; 71 | @property bool thinkingStatus; 72 | @property bool notTheAlert; 73 | 74 | @property UIRefreshControl *reloadControl; 75 | 76 | @property (nonatomic, strong) UIPopoverController *imagePopoverController; 77 | 78 | - (void)loadChat:(NSMutableArray *)messages withUUID:(NSString *)uuid; 79 | - (void)startNewConversation; 80 | 81 | - (int)countOfMessages; 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Image View Controller/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Classes/View Controllers/Image View Controller/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Image View Controller/CGImageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGImageViewController.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 22/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CGImageViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 14 | @property (weak, nonatomic) IBOutlet UINavigationBar *navigationBar; 15 | @property (strong, nonatomic) IBOutlet UIScrollView *scrollView; 16 | @end 17 | -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Image View Controller/CGImageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGImageViewController.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 22/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGImageViewController.h" 10 | 11 | @interface CGImageViewController () 12 | 13 | @end 14 | 15 | @implementation CGImageViewController 16 | 17 | 18 | - (void)viewDidLoad{ 19 | [super viewDidLoad]; 20 | 21 | self.scrollView.delegate = self; 22 | self.scrollView.minimumZoomScale = 1.0; 23 | self.scrollView.maximumZoomScale = 4.0; 24 | self.scrollView.zoomScale = 1.0; 25 | 26 | UIImage *clearImage = [UIImage new]; // Blank image 27 | [self.navigationController.navigationBar setBackgroundImage:clearImage forBarMetrics:UIBarMetricsDefault]; 28 | 29 | 30 | } 31 | -(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { 32 | return self.imageView; 33 | } 34 | 35 | - (void)viewDidUnload { 36 | [self setImageView:nil]; 37 | [self setScrollView:nil]; 38 | [super viewDidUnload]; 39 | } 40 | 41 | - (IBAction)done:(id)sender { 42 | [self dismissModalViewControllerAnimated:YES]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Sidebar/CGSidebarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGSidebarController.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 23/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CGAPIHelper.h" 12 | #import "CGMessage.h" 13 | #import "CGConversation.h" 14 | 15 | #import "CGChatViewController.h" 16 | #import "CGConversationElementCell.h" 17 | 18 | @interface CGSidebarController : UITableViewController 19 | 20 | @property NSIndexPath *selectedIndexPath; 21 | @property NSMutableArray *allConversations; 22 | @end 23 | -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Sidebar/CGSidebarController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGSidebarController.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 23/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGSidebarController.h" 10 | 11 | @interface CGSidebarController () 12 | 13 | @end 14 | 15 | @implementation CGSidebarController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(recheckandReload:) name:@"RE-CHECK CONVOS" object:nil]; 20 | self.allConversations = [CGAPIHelper loadConversations]; 21 | 22 | if(VERSION_MIN(@"7.0")) { 23 | if ([self respondsToSelector:@selector(topLayoutGuide)]) { 24 | self.tableView.contentInset = UIEdgeInsetsMake(20., 0., 0., 0.); 25 | } 26 | } 27 | [self.tableView reloadData]; 28 | 29 | } 30 | 31 | - (void)recheckandReload:(NSNotification *)notification { 32 | self.allConversations = nil; 33 | self.allConversations = [CGAPIHelper loadConversations]; 34 | [self.tableView reloadData]; 35 | } 36 | 37 | 38 | - (IBAction)didLongPressCell:(UILongPressGestureRecognizer *)sender { 39 | if (sender.state == UIGestureRecognizerStateBegan) { 40 | CGPoint location = [sender locationInView:self.tableView]; 41 | NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location]; 42 | 43 | if (indexPath.section == 1 && self.allConversations.count > 0) { 44 | self.selectedIndexPath = indexPath; 45 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Quick action panel" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Rename", @"Share", @"Delete", nil]; 46 | //input field 47 | [alertView setTag:1]; 48 | [alertView show]; 49 | } else if(indexPath.section == 0) { 50 | UINavigationController *navigationController = (UINavigationController *)self.slideMenuController.contentViewController; 51 | CGChatViewController *contentViewController = navigationController.viewControllers.firstObject; 52 | if(self.allConversations.count < 1) { 53 | if([contentViewController countOfMessages] < 1) { 54 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Quick action panel" message:@"You don't have any conversations yet, you should chat more and save this conversation!" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; 55 | //input field 56 | [alertView setTag:3]; 57 | [alertView show]; 58 | } else { 59 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Quick action panel" message:@"Save your conversation now" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save", nil]; 60 | //input field 61 | [alertView setTag:3]; 62 | [alertView show]; 63 | } 64 | } else if(self.allConversations.count > 0) { 65 | if([contentViewController countOfMessages] < 1) { 66 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Quick action panel" message:@"You need to start sending messages in order to be able to save your conversations." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Delete all conversations", nil]; 67 | //input field 68 | [alertView setTag:4]; 69 | [alertView show]; 70 | } else { 71 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Quick action panel" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save conversation", @"Delete all conversations", nil]; 72 | //input field 73 | [alertView setTag:3]; 74 | [alertView show]; 75 | } 76 | } 77 | 78 | 79 | } 80 | } 81 | } 82 | 83 | - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { 84 | if(alertView.tag == 1) { 85 | if (buttonIndex == 1) { // "Option 1" 86 | CGConversation *currentConv = self.allConversations[self.selectedIndexPath.row]; 87 | UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Rename Conversation" message:@"Once you're done, press the 'Done' button." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Done", nil]; 88 | //input field 89 | alertView.alertViewStyle = UIAlertViewStylePlainTextInput; 90 | 91 | UITextField *textField = [alertView textFieldAtIndex:0]; 92 | textField.text = currentConv.title; 93 | 94 | [alertView setTag:2]; 95 | [alertView show]; 96 | } else if (buttonIndex == 2) { // "Option 2" 97 | [alertView dismissWithClickedButtonIndex:buttonIndex animated:YES]; 98 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 99 | CGConversation *currentConv = self.allConversations[self.selectedIndexPath.row]; 100 | NSMutableArray *dict = currentConv.messages; 101 | NSMutableArray *messages = [[NSMutableArray alloc] init]; 102 | for (CGMessage *message in dict) { 103 | NSString *messgae = [NSString stringWithFormat:@"%@: %@", message.author, message.content]; 104 | [messages addObject:messgae]; 105 | } 106 | NSString *jumbotron = [NSString stringWithFormat:@"%@, created at %@, with the following messages:\n\n %@ \n\n Made with ChatGPT for Legacy iOS", currentConv.title, currentConv.creationDate, messages]; 107 | dispatch_async(dispatch_get_main_queue(), ^{ 108 | [self.slideMenuController showShareSheet:jumbotron]; 109 | //need the message property now, ill create a text file that way. 110 | }); 111 | }); 112 | } else if (buttonIndex == 3) { // "Delete" 113 | CGConversation *selectedConv = self.allConversations[self.selectedIndexPath.row]; 114 | BOOL success = [CGAPIHelper deleteConversationWithUUID:selectedConv.uuid]; 115 | if (success) { 116 | self.selectedIndexPath = nil; 117 | [NSNotificationCenter.defaultCenter postNotificationName:@"RE-CHECK CONVOS" object:nil]; 118 | } 119 | 120 | 121 | } 122 | } else if(alertView.tag == 2) { 123 | if (buttonIndex == alertView.firstOtherButtonIndex) { 124 | NSString *enteredText = [alertView textFieldAtIndex:0].text; 125 | CGConversation *selectedConv = self.allConversations[self.selectedIndexPath.row]; 126 | UINavigationController *navigationController = (UINavigationController *)self.slideMenuController.contentViewController; 127 | CGChatViewController *contentViewController = navigationController.viewControllers.firstObject; 128 | [contentViewController setTitle:enteredText]; 129 | [CGAPIHelper saveConversationWithArray:selectedConv.messages withID:selectedConv.uuid withTitle:enteredText]; //should overwrite the other uuid post, so its always uptodate 130 | [NSNotificationCenter.defaultCenter postNotificationName:@"RE-CHECK CONVOS" object:nil]; 131 | self.selectedIndexPath = nil; 132 | } 133 | } else if(alertView.tag == 3) { 134 | if(buttonIndex == 1) { 135 | [NSNotificationCenter.defaultCenter postNotificationName:@"SAVE CHAT" object:nil]; 136 | [self recheckandReload:nil]; 137 | } else if(buttonIndex == 2) { 138 | BOOL success = [CGAPIHelper deleteAllConversations]; 139 | if(success) { 140 | [NSNotificationCenter.defaultCenter postNotificationName:@"RE-CHECK CONVOS" object:nil]; 141 | } 142 | } 143 | } else if(alertView.tag == 4) { 144 | if(buttonIndex == 1) { 145 | BOOL success = [CGAPIHelper deleteAllConversations]; 146 | if(success) { 147 | [NSNotificationCenter.defaultCenter postNotificationName:@"RE-CHECK CONVOS" object:nil]; 148 | } 149 | } 150 | } 151 | } 152 | 153 | 154 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 155 | return 2; 156 | } 157 | 158 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 159 | return (section == 0) ? 0 : 28.0; 160 | } 161 | 162 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { 163 | if (section == 0) { 164 | return nil; 165 | } 166 | 167 | UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 28)]; 168 | UIImageView *backgroundImageView = [[UIImageView alloc] initWithFrame:headerView.bounds]; 169 | backgroundImageView.contentMode = UIViewContentModeScaleToFill; 170 | 171 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, tableView.frame.size.width - 20, 18)]; 172 | label.textColor = [UIColor colorWithRed:158.0/255.0 green:159.0/255.0 blue:159.0/255.0 alpha:1.0]; 173 | 174 | if (VERSION_MIN(@"7.0")) { 175 | backgroundImageView.image = [UIImage imageNamed:@"iOS7HeaderSeparator"]; 176 | label.font = [UIFont boldSystemFontOfSize:16]; 177 | } else if (VERSION_MIN(@"5.0")) { 178 | backgroundImageView.image = [UIImage imageNamed:@"headerSeparator"]; 179 | label.layer.shadowColor = [UIColor blackColor].CGColor; 180 | label.layer.shadowOffset = CGSizeMake(0, 1); 181 | label.backgroundColor = [UIColor clearColor]; 182 | label.font = [UIFont boldSystemFontOfSize:16]; 183 | } 184 | 185 | [headerView addSubview:backgroundImageView]; 186 | if (section == 1) { 187 | label.text = @"Chats"; 188 | } 189 | 190 | [headerView addSubview:label]; 191 | return headerView; 192 | } 193 | 194 | 195 | 196 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 197 | if (section == 0) { 198 | return 1; 199 | } else if (section == 1) { 200 | if (self.allConversations.count == 0) 201 | return 1; 202 | return self.allConversations.count; 203 | } 204 | 205 | return 0; 206 | } 207 | 208 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 209 | return 57.0; 210 | } 211 | 212 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 213 | if (indexPath.section == 1) { 214 | if (self.allConversations.count == 0) { 215 | // Display "Nothing" Cell when no conversations exist 216 | CGConversationElementCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Nothing"]; 217 | if (cell == nil) { 218 | cell = [[CGConversationElementCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Nothing"]; 219 | } 220 | 221 | if(VERSION_MIN(@"7.0")) { 222 | [cell.separator setImage:nil]; 223 | cell.accessoryLabel.shadowColor = nil; 224 | cell.conversationName.shadowColor = nil; 225 | 226 | } else { 227 | [cell.iOS7Separator setHidden:YES]; // hide it only here 228 | } 229 | return cell; 230 | } else if(self.allConversations.count > 0) { 231 | // Display conversations in "ConvoCell" 232 | CGConversation *conversation = self.allConversations[indexPath.row]; 233 | CGConversationElementCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ConvoCell"]; 234 | if (cell == nil) { 235 | cell = [[CGConversationElementCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ConvoCell"]; 236 | } 237 | 238 | if(VERSION_MIN(@"7.0")) { 239 | [cell.separator setImage:nil]; 240 | cell.accessoryLabel.shadowColor = nil; 241 | cell.conversationName.shadowColor = nil; 242 | 243 | } else { 244 | [cell.iOS7Separator setHidden:YES]; // hide it only here 245 | } 246 | cell.conversationName.text = conversation.title; 247 | if (conversation.messageCount < 2) { 248 | cell.accessoryLabel.text = [NSString stringWithFormat:@"%i message, created on %@", conversation.messageCount, conversation.creationDate]; 249 | } else { 250 | cell.accessoryLabel.text = [NSString stringWithFormat:@"%i messages, created on %@", conversation.messageCount, conversation.creationDate]; 251 | } 252 | 253 | return cell; 254 | } 255 | } else if (indexPath.section == 0) { 256 | // Display "New Chat" Cell 257 | CGConversationElementCell *cell = [tableView dequeueReusableCellWithIdentifier:@"NewChat"]; 258 | if (cell == nil) { 259 | cell = [[CGConversationElementCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"NewChat"]; 260 | } 261 | 262 | if(VERSION_MIN(@"7.0")) { 263 | [cell.separator setImage:nil]; 264 | [cell.thumbnail setImage:[UIImage imageNamed:@"iOS7newConversationThumbnail"]]; 265 | cell.accessoryLabel.shadowColor = nil; 266 | cell.conversationName.shadowColor = nil; 267 | 268 | } else { 269 | [cell.iOS7Separator setHidden:YES]; // hide it only here 270 | } 271 | 272 | return cell; 273 | 274 | } 275 | 276 | return nil; 277 | } 278 | 279 | 280 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 281 | if (indexPath.section == 0 && indexPath.row == 0) { 282 | UINavigationController *navigationController = (UINavigationController *)self.slideMenuController.contentViewController; 283 | CGChatViewController *contentViewController = navigationController.viewControllers.firstObject; 284 | if ([contentViewController isKindOfClass:[CGChatViewController class]]) { 285 | 286 | [contentViewController.navigationItem setTitle:@"Chat"]; 287 | [contentViewController startNewConversation]; 288 | [contentViewController setViewingPresentTime:true]; 289 | [self.slideMenuController hideMenu:YES]; 290 | } 291 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 292 | return; 293 | } 294 | if(self.allConversations.count == 0) 295 | return; 296 | 297 | CGConversation *conversation = self.allConversations[indexPath.row]; 298 | UINavigationController *navigationController = (UINavigationController *)self.slideMenuController.contentViewController; 299 | CGChatViewController *contentViewController = navigationController.viewControllers.firstObject; 300 | if ([contentViewController isKindOfClass:[CGChatViewController class]]) { 301 | 302 | [contentViewController.navigationItem setTitle:conversation.title]; 303 | [contentViewController loadChat:conversation.messages withUUID:conversation.uuid]; 304 | [contentViewController setViewingPresentTime:true]; 305 | [self.slideMenuController hideMenu:YES]; 306 | } 307 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 308 | } 309 | 310 | @end 311 | -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Welcome View/CGWelcomeController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CGWelcomeController.h 3 | // ChatGPT 4 | // 5 | // Created by XML on 27/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CGAPIHelper.h" 11 | 12 | @interface CGWelcomeController : UIViewController 13 | 14 | @property bool authenticated; 15 | 16 | @property (weak, nonatomic) IBOutlet UIView *slideLabel; //IMPv2 17 | @property (weak, nonatomic) IBOutlet UIView *slideicon; //IMP 18 | @property (weak, nonatomic) IBOutlet UIImageView *realWELSlideIcon; 19 | @property (weak, nonatomic) IBOutlet UILabel *realWELSlideLabel; 20 | 21 | @property (weak, nonatomic) IBOutlet UIView *WLBoxView; 22 | 23 | //mvp 24 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 25 | @property (weak, nonatomic) IBOutlet UIView *mainView; 26 | @property (weak, nonatomic) IBOutlet UIView *secondaryView1; 27 | @property (weak, nonatomic) IBOutlet UIView *secondaryView2; 28 | @property (weak, nonatomic) IBOutlet UIView *secondaryView3; 29 | 30 | //Other 31 | @property (weak, nonatomic) IBOutlet UILabel *head1; 32 | @property (weak, nonatomic) IBOutlet UILabel *head2; 33 | @property (weak, nonatomic) IBOutlet UILabel *head3; 34 | @property (weak, nonatomic) IBOutlet UILabel *head4; 35 | @property (weak, nonatomic) IBOutlet UIImageView *inputFieldBackground; 36 | @property (weak, nonatomic) IBOutlet UIImageView *separator1; 37 | @property (weak, nonatomic) IBOutlet UIImageView *i7sep1; 38 | @property (weak, nonatomic) IBOutlet UIImageView *i7sep2; 39 | @property (weak, nonatomic) IBOutlet UIImageView *separator2; 40 | @property (weak, nonatomic) IBOutlet UIImageView *i7sep3; 41 | @property (weak, nonatomic) IBOutlet UIImageView *separator3; 42 | @property (weak, nonatomic) IBOutlet UIImageView *separator4; 43 | @property (weak, nonatomic) IBOutlet UIImageView *i7sep4; 44 | 45 | @property (weak, nonatomic) IBOutlet UIImageView *SCTImage; 46 | 47 | @property (weak, nonatomic) IBOutlet UIView *SCThumbnailView; 48 | @property (weak, nonatomic) IBOutlet UIView *CONVThumbnailView; 49 | @property (weak, nonatomic) IBOutlet UIView *pickThumbnailView; 50 | @property (weak, nonatomic) IBOutlet UITextField *KeyInputField; 51 | @end 52 | -------------------------------------------------------------------------------- /ChatGPT/Classes/View Controllers/Welcome View/CGWelcomeController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CGWelcomeController.m 3 | // ChatGPT 4 | // 5 | // Created by XML on 27/02/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import "CGWelcomeController.h" 10 | 11 | @interface CGWelcomeController () 12 | 13 | @end 14 | 15 | @implementation CGWelcomeController 16 | 17 | - (void)viewWillAppear:(BOOL)animated { 18 | if(VERSION_MIN(@"7.0")) { 19 | 20 | } else { 21 | NSDictionary *titleTextAttributes = @{ 22 | UITextAttributeTextColor: [UIColor colorWithRed:74/255.0 green:125/255.0 blue:112/255.0 alpha:1.0], 23 | UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, 1)], 24 | UITextAttributeTextShadowColor: [UIColor whiteColor] 25 | }; 26 | [self.navigationController.navigationBar setTitleTextAttributes:titleTextAttributes]; 27 | 28 | } 29 | } 30 | 31 | - (void)viewDidLoad 32 | { 33 | [super viewDidLoad]; 34 | 35 | if(VERSION_MIN(@"7.0")) { 36 | self.tableView.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1.0]; 37 | self.mainView.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1.0]; 38 | 39 | self.secondaryView1.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1.0]; 40 | self.secondaryView2.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1.0]; 41 | self.secondaryView3.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1.0]; 42 | 43 | self.separator1.hidden = YES; 44 | self.separator3.hidden = YES; 45 | self.separator2.hidden = YES; 46 | self.separator4.hidden = YES; 47 | 48 | self.head1.shadowColor = nil; 49 | self.head2.shadowColor = nil; 50 | self.head3.shadowColor = nil; 51 | self.head4.shadowColor = nil; 52 | self.realWELSlideLabel.shadowColor = nil; 53 | 54 | self.inputFieldBackground.image = [UIImage imageNamed:@"iOS7KIF"]; 55 | self.SCTImage.image = [UIImage imageNamed:@"iOS7SCT"]; 56 | self.realWELSlideIcon.image = [UIImage imageNamed:@"iOS7WEL"]; 57 | 58 | } else { 59 | [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bar-BG"] forBarMetrics:UIBarMetricsDefault]; 60 | self.i7sep1.hidden = YES; 61 | self.i7sep2.hidden = YES; 62 | self.i7sep3.hidden = YES; 63 | self.i7sep4.hidden = YES; 64 | } 65 | self.authenticated = NO; 66 | self.WLBoxView.alpha = 0.0; 67 | self.KeyInputField.delegate = self; 68 | 69 | [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(endOOBE:) name:@"LOG-IN VALID" object:nil]; 70 | [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(abruptFailure:) name:@"LOG-IN FAILURE" object:nil]; 71 | // Do any additional setup after loading the view. 72 | } 73 | 74 | - (void)viewDidAppear:(BOOL)animated { 75 | [super viewDidAppear:animated]; 76 | [self bringIntroductionInShape]; 77 | } 78 | - (void)bringIntroductionInShape { 79 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 80 | CGRect SiCurrentFrame = self.slideicon.frame; 81 | CGRect SiFinalFrame = CGRectOffset(SiCurrentFrame, -60, 0); 82 | 83 | CGRect SLCurrentFrame = self.slideLabel.frame; 84 | CGRect SLFinalFrame = CGRectOffset(SLCurrentFrame, 130, 0); 85 | [UIView animateWithDuration:0.75 animations:^{ 86 | self.WLBoxView.alpha = 1.0; 87 | self.slideicon.frame = SiFinalFrame; 88 | self.slideLabel.frame = SLFinalFrame; 89 | }]; 90 | }); 91 | CABasicAnimation *rocking = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; 92 | rocking.fromValue = @(-M_PI / 16); 93 | rocking.toValue = @(M_PI / 16); 94 | rocking.duration = 1.5; 95 | rocking.autoreverses = YES; 96 | rocking.repeatCount = INFINITY; 97 | rocking.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; // Smooth motion 98 | 99 | [self.SCThumbnailView.layer addAnimation:rocking forKey:@"rockingAnimation"]; 100 | [self.CONVThumbnailView.layer addAnimation:rocking forKey:@"rockingAnimation"]; 101 | [self.pickThumbnailView.layer addAnimation:rocking forKey:@"rockingAnimation"]; 102 | } 103 | 104 | //hmm 105 | 106 | - (void)endOOBE:(NSNotification *)notification { 107 | [SVProgressHUD dismiss]; 108 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstLaunch"]; 109 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 110 | [self dismissModalViewControllerAnimated:YES]; 111 | NSString *statusMessage = [NSString stringWithFormat:@"Logged in as %@.",[[NSUserDefaults standardUserDefaults] objectForKey:@"username"]]; 112 | [SVProgressHUD showSuccessWithStatus:statusMessage]; 113 | }); 114 | } 115 | 116 | - (void)abruptFailure:(NSNotification *)notification { 117 | [SVProgressHUD dismiss]; 118 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 119 | [SVProgressHUD showErrorWithStatus:@"An error occured. Please retry."]; 120 | }); 121 | } 122 | - (BOOL)textFieldShouldReturn:(UITextField *)textField { 123 | // Perform actions when the return key is pressed, like resigning the first responder status 124 | [self.KeyInputField resignFirstResponder]; // Dismiss the keyboard 125 | [SVProgressHUD showWithStatus:@"Logging in..." maskType:SVProgressHUDMaskTypeGradient]; 126 | [CGAPIHelper logInUserwithKey:self.KeyInputField.text]; 127 | return YES; 128 | } 129 | 130 | 131 | 132 | 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Libraries/APLSlideMenu/APLSlideMenuSegue.h: -------------------------------------------------------------------------------- 1 | // Created by Kay J. on 4.4.14. 2 | // Copyright (c) 2012 apploft GmbH. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface APLSlideMenuLeftMenuSegue : UIStoryboardSegue 8 | @end 9 | 10 | @interface APLSlideMenuRightMenuSegue : UIStoryboardSegue 11 | @end 12 | 13 | @interface APLSlideMenuContentSegue : UIStoryboardSegue 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/APLSlideMenu/APLSlideMenuSegue.m: -------------------------------------------------------------------------------- 1 | // Created by Kay J. on 4.4.14. 2 | // Copyright (c) 2012 apploft GmbH. All rights reserved. 3 | // 4 | 5 | #import "APLSlideMenuSegue.h" 6 | #import "APLSlideMenuViewController.h" 7 | 8 | @implementation APLSlideMenuLeftMenuSegue 9 | 10 | - (void)perform { 11 | APLSlideMenuViewController* slideMenuViewController = self.sourceViewController; 12 | UIViewController* leftMenuViewController = self.destinationViewController; 13 | 14 | slideMenuViewController.leftMenuViewController = leftMenuViewController; 15 | } 16 | 17 | @end 18 | 19 | 20 | @implementation APLSlideMenuRightMenuSegue 21 | 22 | - (void)perform { 23 | APLSlideMenuViewController* slideMenuViewController = self.sourceViewController; 24 | UIViewController* rightMenuViewController = self.destinationViewController; 25 | 26 | slideMenuViewController.rightMenuViewController = rightMenuViewController; 27 | } 28 | 29 | @end 30 | 31 | 32 | @implementation APLSlideMenuContentSegue 33 | 34 | - (void)perform { 35 | APLSlideMenuViewController* slideMenuViewController = self.sourceViewController; 36 | UIViewController* contentViewController = self.destinationViewController; 37 | 38 | slideMenuViewController.contentViewController = contentViewController; 39 | } 40 | 41 | 42 | @end -------------------------------------------------------------------------------- /ChatGPT/Libraries/APLSlideMenu/APLSlideMenuViewController.h: -------------------------------------------------------------------------------- 1 | // Created by Tobias Conradi on 18.12.12. 2 | // Copyright (c) 2012 apploft GmbH. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | 8 | 9 | typedef NS_ENUM(NSInteger,APLSlideMenuGestureSupportType) { 10 | APLSlideMenuGestureSupportNone = 0, 11 | APLSlideMenuGestureSupportBasic, 12 | APLSlideMenuGestureSupportDrag, 13 | APLSlideMenuGestureSupportDragOnlyNavigationBar, 14 | APLSlideMenuGestureSupportBasicOnlyHorizontal // Only register horizontal drags 15 | }; 16 | 17 | @class APLSlideMenuViewController; 18 | @protocol TRUMainMenuViewControllerDelegate; 19 | 20 | extern NSString *APLSlideMenuWillShowNotification; 21 | extern NSString *APLSlideMenuDidShowNotification; 22 | extern NSString *APLSlideMenuWillHideNotification; 23 | extern NSString *APLSlideMenuDidHideNotification; 24 | 25 | 26 | @protocol APLSlideMenuViewControllerDelegate 27 | @optional 28 | -(BOOL) shouldHandleSlideMenuGesture:(APLSlideMenuViewController *)aViewController startingAtPoint:(CGPoint)startPoint withEndPoint:(CGPoint)endPoint inOrderToShowMenu:(BOOL)isGoingToShowMenuWhenThisGestureSucceeds; 29 | -(void) willShowMenu:(APLSlideMenuViewController *)aViewController; 30 | -(void) didShowMenu:(APLSlideMenuViewController *)aViewController; 31 | -(void) willHideMenu:(APLSlideMenuViewController *)aViewController; 32 | -(void) didHideMenu:(APLSlideMenuViewController *)aViewController; 33 | @end 34 | 35 | 36 | /* To be implemented by any view controller who wants to influence 37 | the gesture support for the slide menu when it's visible. 38 | */ 39 | @protocol APLSlideMenuGestureSupport 40 | @optional 41 | -(APLSlideMenuGestureSupportType)gestureSupport; 42 | @end 43 | 44 | 45 | @interface APLSlideMenuViewController : UIViewController 46 | 47 | @property (nonatomic, strong) IBOutlet UIViewController *menuViewController __attribute__ ((deprecated)); 48 | @property (nonatomic, strong) IBOutlet UIViewController *leftMenuViewController; 49 | @property (nonatomic, strong) IBOutlet UIViewController *rightMenuViewController; 50 | @property (nonatomic, strong) IBOutlet UIViewController *contentViewController; 51 | 52 | /** Listen to show and hide events. */ 53 | @property (nonatomic, weak) id slideDelegate; 54 | 55 | /** Default: APLSlideMenuGestureSupportBasic */ 56 | @property (nonatomic, assign) APLSlideMenuGestureSupportType gestureSupport; 57 | 58 | /** 59 | * When set to YES the user can tap on the content view to hide the menu. 60 | * @note: default value is YES 61 | */ 62 | @property (nonatomic, assign) BOOL tapOnContentViewToHideMenu; 63 | 64 | /** Duration of all animations. */ 65 | @property (nonatomic, assign) NSTimeInterval animationDuration; 66 | 67 | /** Width of menu. 0.0 - 1.0 are interpreted as relative width, all other as absolute width. */ 68 | @property (nonatomic, assign) CGFloat menuWidth; 69 | 70 | /** Add a small bouncing animation as the slider glides into position. */ 71 | @property (nonatomic, assign, getter = isBouncing) BOOL bouncing; 72 | 73 | /** always show menu like an UISplitViewController in landscape on iPad */ 74 | @property (nonatomic, assign, getter = isShowLeftMenuInLandscape) BOOL showLeftMenuInLandscape; 75 | @property (nonatomic, assign, getter = isShowRightMenuInLandscape) BOOL showRightMenuInLandscape; 76 | 77 | /** draw a shadow above menu view controllers, default is YES */ 78 | @property (nonatomic, assign) BOOL useShadow; 79 | 80 | /** color of border between menu and content in landscape on iPad when showLeftMenuInLandscape or showRightMenuInLandscape is enabled, default is [UIColor clearColor] */ 81 | @property (nonatomic, strong) UIColor* separatorColor; 82 | 83 | /** Set content view controller animated. */ 84 | - (void) setContentViewController:(UIViewController *)contentViewController animated:(BOOL)animated; 85 | 86 | /** Readonly getter. */ 87 | - (BOOL) isMenuViewVisible; 88 | 89 | - (void) showMenu:(BOOL)animated __attribute__ ((deprecated)); 90 | - (void) showLeftMenu:(BOOL)animated; 91 | - (void) showRightMenu:(BOOL)animated; 92 | - (void) hideMenu:(BOOL)animated; 93 | 94 | - (void) switchMenu:(BOOL)animated __attribute__ ((deprecated)); 95 | - (void) switchLeftMenu:(BOOL) animated; 96 | - (void) switchRightMenu:(BOOL) animated; 97 | 98 | - (void) dismissContentViewController; 99 | 100 | - (void)showShareSheet:(NSString *)textContent; 101 | @end 102 | 103 | //---------------------------------------------- 104 | 105 | /* Convenience category on UIViewController 106 | */ 107 | @interface UIViewController (APLSlideMenuViewController) 108 | 109 | - (APLSlideMenuViewController*) slideMenuController; 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/Base64/Base64.h: -------------------------------------------------------------------------------- 1 | // 2 | // Base64.h 3 | // 4 | // Version 1.1 5 | // 6 | // Created by Nick Lockwood on 12/01/2012. 7 | // Copyright (C) 2012 Charcoal Design 8 | // 9 | // Distributed under the permissive zlib License 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/nicklockwood/Base64 13 | // 14 | // This software is provided 'as-is', without any express or implied 15 | // warranty. In no event will the authors be held liable for any damages 16 | // arising from the use of this software. 17 | // 18 | // Permission is granted to anyone to use this software for any purpose, 19 | // including commercial applications, and to alter it and redistribute it 20 | // freely, subject to the following restrictions: 21 | // 22 | // 1. The origin of this software must not be misrepresented; you must not 23 | // claim that you wrote the original software. If you use this software 24 | // in a product, an acknowledgment in the product documentation would be 25 | // appreciated but is not required. 26 | // 27 | // 2. Altered source versions must be plainly marked as such, and must not be 28 | // misrepresented as being the original software. 29 | // 30 | // 3. This notice may not be removed or altered from any source distribution. 31 | // 32 | 33 | #import 34 | 35 | 36 | @interface NSData (Base64) 37 | 38 | + (NSData *)dataWithBase64EncodedString:(NSString *)string; 39 | - (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth; 40 | - (NSString *)base64EncodedString; 41 | 42 | @end 43 | 44 | 45 | @interface NSString (Base64) 46 | 47 | + (NSString *)stringWithBase64EncodedString:(NSString *)string; 48 | - (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth; 49 | - (NSString *)base64EncodedString; 50 | - (NSString *)base64DecodedString; 51 | - (NSData *)base64DecodedData; 52 | 53 | @end -------------------------------------------------------------------------------- /ChatGPT/Libraries/Base64/Base64.m: -------------------------------------------------------------------------------- 1 | // 2 | // Base64.m 3 | // 4 | // Version 1.1 5 | // 6 | // Created by Nick Lockwood on 12/01/2012. 7 | // Copyright (C) 2012 Charcoal Design 8 | // 9 | // Distributed under the permissive zlib License 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/nicklockwood/Base64 13 | // 14 | // This software is provided 'as-is', without any express or implied 15 | // warranty. In no event will the authors be held liable for any damages 16 | // arising from the use of this software. 17 | // 18 | // Permission is granted to anyone to use this software for any purpose, 19 | // including commercial applications, and to alter it and redistribute it 20 | // freely, subject to the following restrictions: 21 | // 22 | // 1. The origin of this software must not be misrepresented; you must not 23 | // claim that you wrote the original software. If you use this software 24 | // in a product, an acknowledgment in the product documentation would be 25 | // appreciated but is not required. 26 | // 27 | // 2. Altered source versions must be plainly marked as such, and must not be 28 | // misrepresented as being the original software. 29 | // 30 | // 3. This notice may not be removed or altered from any source distribution. 31 | // 32 | 33 | #import "Base64.h" 34 | 35 | 36 | #import 37 | #if !__has_feature(objc_arc) 38 | #error This library requires automatic reference counting 39 | #endif 40 | 41 | 42 | @implementation NSData (Base64) 43 | 44 | + (NSData *)dataWithBase64EncodedString:(NSString *)string 45 | { 46 | const char lookup[] = 47 | { 48 | 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 49 | 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 50 | 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 62, 99, 99, 99, 63, 51 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 99, 99, 99, 99, 99, 99, 52 | 99, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 53 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 99, 99, 99, 99, 99, 54 | 99, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 55 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 99, 99, 99, 99, 99 56 | }; 57 | 58 | NSData *inputData = [string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; 59 | long long inputLength = [inputData length]; 60 | const unsigned char *inputBytes = [inputData bytes]; 61 | 62 | long long maxOutputLength = (inputLength / 4 + 1) * 3; 63 | NSMutableData *outputData = [NSMutableData dataWithLength:maxOutputLength]; 64 | unsigned char *outputBytes = (unsigned char *)[outputData mutableBytes]; 65 | 66 | int accumulator = 0; 67 | long long outputLength = 0; 68 | unsigned char accumulated[] = {0, 0, 0, 0}; 69 | for (long long i = 0; i < inputLength; i++) 70 | { 71 | unsigned char decoded = lookup[inputBytes[i] & 0x7F]; 72 | if (decoded != 99) 73 | { 74 | accumulated[accumulator] = decoded; 75 | if (accumulator == 3) 76 | { 77 | outputBytes[outputLength++] = (accumulated[0] << 2) | (accumulated[1] >> 4); 78 | outputBytes[outputLength++] = (accumulated[1] << 4) | (accumulated[2] >> 2); 79 | outputBytes[outputLength++] = (accumulated[2] << 6) | accumulated[3]; 80 | } 81 | accumulator = (accumulator + 1) % 4; 82 | } 83 | } 84 | 85 | //handle left-over data 86 | if (accumulator > 0) outputBytes[outputLength] = (accumulated[0] << 2) | (accumulated[1] >> 4); 87 | if (accumulator > 1) outputBytes[++outputLength] = (accumulated[1] << 4) | (accumulated[2] >> 2); 88 | if (accumulator > 2) outputLength++; 89 | 90 | //truncate data to match actual output length 91 | outputData.length = outputLength; 92 | return outputLength? outputData: nil; 93 | } 94 | 95 | - (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth 96 | { 97 | //ensure wrapWidth is a multiple of 4 98 | wrapWidth = (wrapWidth / 4) * 4; 99 | 100 | const char lookup[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 101 | 102 | long long inputLength = [self length]; 103 | const unsigned char *inputBytes = [self bytes]; 104 | 105 | long long maxOutputLength = (inputLength / 3 + 1) * 4; 106 | maxOutputLength += wrapWidth? (maxOutputLength / wrapWidth) * 2: 0; 107 | unsigned char *outputBytes = (unsigned char *)malloc(maxOutputLength); 108 | 109 | long long i; 110 | long long outputLength = 0; 111 | for (i = 0; i < inputLength - 2; i += 3) 112 | { 113 | outputBytes[outputLength++] = lookup[(inputBytes[i] & 0xFC) >> 2]; 114 | outputBytes[outputLength++] = lookup[((inputBytes[i] & 0x03) << 4) | ((inputBytes[i + 1] & 0xF0) >> 4)]; 115 | outputBytes[outputLength++] = lookup[((inputBytes[i + 1] & 0x0F) << 2) | ((inputBytes[i + 2] & 0xC0) >> 6)]; 116 | outputBytes[outputLength++] = lookup[inputBytes[i + 2] & 0x3F]; 117 | 118 | //add line break 119 | if (wrapWidth && (outputLength + 2) % (wrapWidth + 2) == 0) 120 | { 121 | outputBytes[outputLength++] = '\r'; 122 | outputBytes[outputLength++] = '\n'; 123 | } 124 | } 125 | 126 | //handle left-over data 127 | if (i == inputLength - 2) 128 | { 129 | // = terminator 130 | outputBytes[outputLength++] = lookup[(inputBytes[i] & 0xFC) >> 2]; 131 | outputBytes[outputLength++] = lookup[((inputBytes[i] & 0x03) << 4) | ((inputBytes[i + 1] & 0xF0) >> 4)]; 132 | outputBytes[outputLength++] = lookup[(inputBytes[i + 1] & 0x0F) << 2]; 133 | outputBytes[outputLength++] = '='; 134 | } 135 | else if (i == inputLength - 1) 136 | { 137 | // == terminator 138 | outputBytes[outputLength++] = lookup[(inputBytes[i] & 0xFC) >> 2]; 139 | outputBytes[outputLength++] = lookup[(inputBytes[i] & 0x03) << 4]; 140 | outputBytes[outputLength++] = '='; 141 | outputBytes[outputLength++] = '='; 142 | } 143 | 144 | if (outputLength >= 4) 145 | { 146 | //truncate data to match actual output length 147 | outputBytes = realloc(outputBytes, outputLength); 148 | return [[NSString alloc] initWithBytesNoCopy:outputBytes 149 | length:outputLength 150 | encoding:NSASCIIStringEncoding 151 | freeWhenDone:YES]; 152 | } 153 | else if (outputBytes) 154 | { 155 | free(outputBytes); 156 | } 157 | return nil; 158 | } 159 | 160 | - (NSString *)base64EncodedString 161 | { 162 | return [self base64EncodedStringWithWrapWidth:0]; 163 | } 164 | 165 | @end 166 | 167 | 168 | @implementation NSString (Base64) 169 | 170 | + (NSString *)stringWithBase64EncodedString:(NSString *)string 171 | { 172 | NSData *data = [NSData dataWithBase64EncodedString:string]; 173 | if (data) 174 | { 175 | return [[self alloc] initWithData:data encoding:NSUTF8StringEncoding]; 176 | } 177 | return nil; 178 | } 179 | 180 | - (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth 181 | { 182 | NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; 183 | return [data base64EncodedStringWithWrapWidth:wrapWidth]; 184 | } 185 | 186 | - (NSString *)base64EncodedString 187 | { 188 | NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; 189 | return [data base64EncodedString]; 190 | } 191 | 192 | - (NSString *)base64DecodedString 193 | { 194 | return [NSString stringWithBase64EncodedString:self]; 195 | } 196 | 197 | - (NSData *)base64DecodedData 198 | { 199 | return [NSData dataWithBase64EncodedString:self]; 200 | } 201 | 202 | @end 203 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/NSURLConnection-Curl/NSURLConnection+FoundationCompletions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLConnection+FoundationCompletions.h 3 | // FrothKit 4 | // 5 | // Created by Allan Phillips on 19/11/09. 6 | // 7 | // Copyright (c) 2009 Thinking Code Software Inc. http://www.thinkingcode.ca 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | 30 | #import 31 | 32 | /* 33 | Implements missing support from cocotrons foundation 34 | TEMP: To make it work, its a (extremely) basic wrapper around curl. 35 | */ 36 | @interface NSURLConnection (FoundationCompletions) 37 | + (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response error:(NSError **)anerror; 38 | @end 39 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/NSURLConnection-Curl/NSURLConnection+FoundationCompletions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLConnection+FoundationCompletions.m 3 | // FrothKit 4 | // 5 | // Created by Allan Phillips on 19/11/09. 6 | // 7 | // Copyright (c) 2009 Thinking Code Software Inc. http://www.thinkingcode.ca 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | 30 | #import "NSURLConnection+FoundationCompletions.h" 31 | 32 | #include "curl.h" 33 | #include "easy.h" 34 | 35 | struct MemoryStruct { 36 | char *memory; 37 | size_t size; 38 | }; 39 | 40 | static void *myrealloc(void *ptr, size_t size); 41 | 42 | static void *myrealloc(void *ptr, size_t size) 43 | { 44 | /* There might be a realloc() out there that doesn't like reallocing 45 | NULL pointers, so we take care of it here */ 46 | if(ptr) 47 | return realloc(ptr, size); 48 | else 49 | return malloc(size); 50 | } 51 | 52 | static size_t 53 | WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) 54 | { 55 | size_t realsize = size * nmemb; 56 | struct MemoryStruct *mem = (struct MemoryStruct *)data; 57 | 58 | mem->memory = myrealloc(mem->memory, mem->size + realsize + 1); 59 | if (mem->memory) { 60 | memcpy(&(mem->memory[mem->size]), ptr, realsize); 61 | mem->size += realsize; 62 | mem->memory[mem->size] = 0; 63 | } 64 | return realsize; 65 | } 66 | 67 | /*static size_t 68 | ReadMemoryCallback(void* ptr, size_t size, size_t nitems, void* data) { 69 | 70 | }*/ 71 | 72 | //Simple wrapper as cocotron does not implement this, this should fully support all of NSMutableURLResponse 73 | @interface NSURLResponse_Froth : NSHTTPURLResponse { 74 | int m_status; 75 | } 76 | 77 | @end 78 | 79 | @implementation NSURLResponse_Froth 80 | 81 | - (id)initWithStatusCode:(NSInteger)code { 82 | if(self = [super init]) { 83 | m_status = code; 84 | } 85 | return self; 86 | } 87 | 88 | - (NSInteger)statusCode { 89 | return m_status; 90 | } 91 | 92 | @end 93 | 94 | 95 | @implementation NSURLConnection (FoundationCompletions) 96 | 97 | + (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)responsep error:(NSError **)errorp { 98 | //NSLog(@"Starting!"); 99 | struct MemoryStruct response; 100 | response.memory = NULL; 101 | response.size = 0; 102 | //NSLog(@"called"); 103 | struct curl_slist *slist = NULL; 104 | 105 | CURL* chandle = curl_easy_init(); 106 | curl_easy_setopt(chandle, CURLOPT_URL, [[[request URL] absoluteString] UTF8String]); 107 | //NSLog(@"itadakimasu = %@", [[request URL] absoluteString]); 108 | curl_easy_setopt(chandle, CURLOPT_FOLLOWLOCATION, 1); 109 | curl_easy_setopt(chandle, CURLOPT_SSL_VERIFYPEER, 0); 110 | curl_easy_setopt(chandle, CURLOPT_NOSIGNAL, 1); 111 | 112 | FILE * uf = NULL; //FILE uploaded if any 113 | 114 | NSString* method = [request HTTPMethod]; 115 | if([method isEqualToString:@"GET"]) { 116 | curl_easy_setopt(chandle, CURLOPT_HTTPGET, 1); 117 | } else if([method isEqualToString:@"POST"]) { 118 | NSData* body = [request HTTPBody]; 119 | curl_easy_setopt(chandle, CURLOPT_POSTFIELDS, [body bytes]); 120 | curl_easy_setopt(chandle, CURLOPT_POSTFIELDSIZE, [body length]); 121 | } else if([method isEqualToString:@"PUT"]) { 122 | curl_easy_setopt(chandle, CURLOPT_PUT, 1L); 123 | NSData* body = [request HTTPBody]; 124 | int dataLength = [body length]; 125 | 126 | curl_easy_setopt(chandle, CURLOPT_UPLOAD, 1L); 127 | curl_easy_setopt(chandle, CURLOPT_INFILESIZE, dataLength); //This also sets the 'Content-Length' header...*/ 128 | 129 | if(dataLength>0) { 130 | /* Hacky, and incomplete with no error checking! */ 131 | NSString* fname = [NSString stringWithFormat:@"/tmp/%f.fputdata", [[NSDate date] timeIntervalSinceReferenceDate]]; 132 | [body writeToFile:fname atomically:YES]; 133 | uf = fopen([fname UTF8String], "r"); 134 | //curl_easy_setopt(easyhandle, CURLOPT_READFUNCTION, read_function 135 | curl_easy_setopt(chandle, CURLOPT_READDATA, uf); 136 | 137 | } 138 | } else if([method isEqualToString:@"DELETE"]) { 139 | curl_easy_setopt(chandle, CURLOPT_CUSTOMREQUEST, "DELETE"); 140 | } 141 | 142 | //TODO: Create a read function and pointer for reading post/put data 143 | NSDictionary* headers = [request allHTTPHeaderFields]; 144 | NSArray* hkeys = [headers allKeys]; 145 | if([hkeys count]) { 146 | for(NSString*headerKey in hkeys) { 147 | NSString*hvalue = [headers valueForKey:headerKey]; 148 | if((NSNull*)hvalue != [NSNull null]) { 149 | slist = curl_slist_append(slist, [[NSString stringWithFormat:@"%@: %@", headerKey, hvalue] UTF8String]); 150 | } else { 151 | slist = curl_slist_append(slist, [[NSString stringWithFormat:@"%@:", headerKey] UTF8String]); 152 | } 153 | //NSLog(@"SetReq - Header [%@:%@]", headerKey, hvalue); 154 | } 155 | curl_easy_setopt(chandle, CURLOPT_HTTPHEADER, slist); 156 | } 157 | 158 | curl_easy_setopt(chandle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); 159 | curl_easy_setopt(chandle, CURLOPT_WRITEDATA, (void *)&response); 160 | //curl_easy_setopt(chandle, CURLOPT_VERBOSE, 1); 161 | int ret = curl_easy_perform(chandle); 162 | if(ret == 0) { //Success 163 | curl_slist_free_all(slist); 164 | int code; 165 | curl_easy_getinfo(chandle, CURLINFO_RESPONSE_CODE, &code); 166 | //NSLog(@"response code:%i",code); 167 | 168 | //Simple response based on status code. 169 | ///--- Does not work... 170 | //*responsep = [[NSURLResponse_Froth alloc] initWithStatusCode:code]; 171 | 172 | //TODO add header response as well... 173 | 174 | if(uf) { 175 | NSLog(@"closing file descrp"); 176 | fclose(uf); 177 | } 178 | 179 | curl_easy_cleanup(chandle); 180 | 181 | NSData* data = [NSData dataWithBytes:(void*)response.memory length:response.size]; 182 | // 200 is successful 183 | if (code == 200) { 184 | NSLog(@"returned data"); 185 | return data; 186 | } else { 187 | return data; 188 | } 189 | } else { 190 | NSLog(@"--- NSURLConnection+LibCurl Wrapper Error --- ret = %i", ret); 191 | curl_slist_free_all(slist); 192 | curl_easy_cleanup(chandle); 193 | if(uf) { 194 | fclose(uf); 195 | } 196 | *errorp = [NSError errorWithDomain:@"FrothNSURLConnectionDomain" code:9231 userInfo:nil]; 197 | return NULL; 198 | } 199 | } 200 | 201 | @end 202 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/curl/curlver.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_CURLVER_H 2 | #define __CURL_CURLVER_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | /* This header file contains nothing but libcurl version info, generated by 26 | a script at release-time. This was made its own header file in 7.11.2 */ 27 | 28 | /* This is the global package copyright */ 29 | #define LIBCURL_COPYRIGHT "1996 - 2017 Daniel Stenberg, ." 30 | 31 | /* This is the version number of the libcurl package from which this header 32 | file origins: */ 33 | #define LIBCURL_VERSION "7.58.0" 34 | 35 | /* The numeric version number is also available "in parts" by using these 36 | defines: */ 37 | #define LIBCURL_VERSION_MAJOR 7 38 | #define LIBCURL_VERSION_MINOR 58 39 | #define LIBCURL_VERSION_PATCH 0 40 | 41 | /* This is the numeric version of the libcurl version number, meant for easier 42 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will 43 | always follow this syntax: 44 | 45 | 0xXXYYZZ 46 | 47 | Where XX, YY and ZZ are the main version, release and patch numbers in 48 | hexadecimal (using 8 bits each). All three numbers are always represented 49 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7 50 | appears as "0x090b07". 51 | 52 | This 6-digit (24 bits) hexadecimal number does not show pre-release number, 53 | and it is always a greater number in a more recent release. It makes 54 | comparisons with greater than and less than work. 55 | 56 | Note: This define is the full hex number and _does not_ use the 57 | CURL_VERSION_BITS() macro since curl's own configure script greps for it 58 | and needs it to contain the full number. 59 | */ 60 | #define LIBCURL_VERSION_NUM 0x073a00 61 | 62 | /* 63 | * This is the date and time when the full source package was created. The 64 | * timestamp is not stored in git, as the timestamp is properly set in the 65 | * tarballs by the maketgz script. 66 | * 67 | * The format of the date follows this template: 68 | * 69 | * "2007-11-23" 70 | */ 71 | #define LIBCURL_TIMESTAMP "2018-01-24" 72 | 73 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) 74 | #define CURL_AT_LEAST_VERSION(x,y,z) \ 75 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) 76 | 77 | #endif /* __CURL_CURLVER_H */ 78 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/curl/easy.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_EASY_H 2 | #define __CURL_EASY_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | CURL_EXTERN CURL *curl_easy_init(void); 29 | CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); 30 | CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); 31 | CURL_EXTERN void curl_easy_cleanup(CURL *curl); 32 | 33 | /* 34 | * NAME curl_easy_getinfo() 35 | * 36 | * DESCRIPTION 37 | * 38 | * Request internal information from the curl session with this function. The 39 | * third argument MUST be a pointer to a long, a pointer to a char * or a 40 | * pointer to a double (as the documentation describes elsewhere). The data 41 | * pointed to will be filled in accordingly and can be relied upon only if the 42 | * function returns CURLE_OK. This function is intended to get used *AFTER* a 43 | * performed transfer, all results from this function are undefined until the 44 | * transfer is completed. 45 | */ 46 | CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); 47 | 48 | 49 | /* 50 | * NAME curl_easy_duphandle() 51 | * 52 | * DESCRIPTION 53 | * 54 | * Creates a new curl session handle with the same options set for the handle 55 | * passed in. Duplicating a handle could only be a matter of cloning data and 56 | * options, internal state info and things like persistent connections cannot 57 | * be transferred. It is useful in multithreaded applications when you can run 58 | * curl_easy_duphandle() for each new thread to avoid a series of identical 59 | * curl_easy_setopt() invokes in every thread. 60 | */ 61 | CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl); 62 | 63 | /* 64 | * NAME curl_easy_reset() 65 | * 66 | * DESCRIPTION 67 | * 68 | * Re-initializes a CURL handle to the default values. This puts back the 69 | * handle to the same state as it was in when it was just created. 70 | * 71 | * It does keep: live connections, the Session ID cache, the DNS cache and the 72 | * cookies. 73 | */ 74 | CURL_EXTERN void curl_easy_reset(CURL *curl); 75 | 76 | /* 77 | * NAME curl_easy_recv() 78 | * 79 | * DESCRIPTION 80 | * 81 | * Receives data from the connected socket. Use after successful 82 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 83 | */ 84 | CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, 85 | size_t *n); 86 | 87 | /* 88 | * NAME curl_easy_send() 89 | * 90 | * DESCRIPTION 91 | * 92 | * Sends data over the connected socket. Use after successful 93 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. 94 | */ 95 | CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, 96 | size_t buflen, size_t *n); 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_MPRINTF_H 2 | #define __CURL_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | #include /* needed for FILE */ 27 | #include "curl.h" /* for CURL_EXTERN */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | CURL_EXTERN int curl_mprintf(const char *format, ...); 34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 37 | const char *format, ...); 38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 42 | const char *format, va_list args); 43 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __CURL_MPRINTF_H */ 51 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/curl/multi.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_MULTI_H 2 | #define __CURL_MULTI_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | /* 25 | This is an "external" header file. Don't give away any internals here! 26 | 27 | GOALS 28 | 29 | o Enable a "pull" interface. The application that uses libcurl decides where 30 | and when to ask libcurl to get/send data. 31 | 32 | o Enable multiple simultaneous transfers in the same thread without making it 33 | complicated for the application. 34 | 35 | o Enable the application to select() on its own file descriptors and curl's 36 | file descriptors simultaneous easily. 37 | 38 | */ 39 | 40 | /* 41 | * This header file should not really need to include "curl.h" since curl.h 42 | * itself includes this file and we expect user applications to do #include 43 | * without the need for especially including multi.h. 44 | * 45 | * For some reason we added this include here at one point, and rather than to 46 | * break existing (wrongly written) libcurl applications, we leave it as-is 47 | * but with this warning attached. 48 | */ 49 | #include "curl.h" 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | #if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) 56 | typedef struct Curl_multi CURLM; 57 | #else 58 | typedef void CURLM; 59 | #endif 60 | 61 | typedef enum { 62 | CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or 63 | curl_multi_socket*() soon */ 64 | CURLM_OK, 65 | CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ 66 | CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ 67 | CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ 68 | CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ 69 | CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ 70 | CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ 71 | CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was 72 | attempted to get added - again */ 73 | CURLM_LAST 74 | } CURLMcode; 75 | 76 | /* just to make code nicer when using curl_multi_socket() you can now check 77 | for CURLM_CALL_MULTI_SOCKET too in the same style it works for 78 | curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ 79 | #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM 80 | 81 | /* bitmask bits for CURLMOPT_PIPELINING */ 82 | #define CURLPIPE_NOTHING 0L 83 | #define CURLPIPE_HTTP1 1L 84 | #define CURLPIPE_MULTIPLEX 2L 85 | 86 | typedef enum { 87 | CURLMSG_NONE, /* first, not used */ 88 | CURLMSG_DONE, /* This easy handle has completed. 'result' contains 89 | the CURLcode of the transfer */ 90 | CURLMSG_LAST /* last, not used */ 91 | } CURLMSG; 92 | 93 | struct CURLMsg { 94 | CURLMSG msg; /* what this message means */ 95 | CURL *easy_handle; /* the handle it concerns */ 96 | union { 97 | void *whatever; /* message-specific data */ 98 | CURLcode result; /* return code for transfer */ 99 | } data; 100 | }; 101 | typedef struct CURLMsg CURLMsg; 102 | 103 | /* Based on poll(2) structure and values. 104 | * We don't use pollfd and POLL* constants explicitly 105 | * to cover platforms without poll(). */ 106 | #define CURL_WAIT_POLLIN 0x0001 107 | #define CURL_WAIT_POLLPRI 0x0002 108 | #define CURL_WAIT_POLLOUT 0x0004 109 | 110 | struct curl_waitfd { 111 | curl_socket_t fd; 112 | short events; 113 | short revents; /* not supported yet */ 114 | }; 115 | 116 | /* 117 | * Name: curl_multi_init() 118 | * 119 | * Desc: inititalize multi-style curl usage 120 | * 121 | * Returns: a new CURLM handle to use in all 'curl_multi' functions. 122 | */ 123 | CURL_EXTERN CURLM *curl_multi_init(void); 124 | 125 | /* 126 | * Name: curl_multi_add_handle() 127 | * 128 | * Desc: add a standard curl handle to the multi stack 129 | * 130 | * Returns: CURLMcode type, general multi error code. 131 | */ 132 | CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, 133 | CURL *curl_handle); 134 | 135 | /* 136 | * Name: curl_multi_remove_handle() 137 | * 138 | * Desc: removes a curl handle from the multi stack again 139 | * 140 | * Returns: CURLMcode type, general multi error code. 141 | */ 142 | CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, 143 | CURL *curl_handle); 144 | 145 | /* 146 | * Name: curl_multi_fdset() 147 | * 148 | * Desc: Ask curl for its fd_set sets. The app can use these to select() or 149 | * poll() on. We want curl_multi_perform() called as soon as one of 150 | * them are ready. 151 | * 152 | * Returns: CURLMcode type, general multi error code. 153 | */ 154 | CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, 155 | fd_set *read_fd_set, 156 | fd_set *write_fd_set, 157 | fd_set *exc_fd_set, 158 | int *max_fd); 159 | 160 | /* 161 | * Name: curl_multi_wait() 162 | * 163 | * Desc: Poll on all fds within a CURLM set as well as any 164 | * additional fds passed to the function. 165 | * 166 | * Returns: CURLMcode type, general multi error code. 167 | */ 168 | CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, 169 | struct curl_waitfd extra_fds[], 170 | unsigned int extra_nfds, 171 | int timeout_ms, 172 | int *ret); 173 | 174 | /* 175 | * Name: curl_multi_perform() 176 | * 177 | * Desc: When the app thinks there's data available for curl it calls this 178 | * function to read/write whatever there is right now. This returns 179 | * as soon as the reads and writes are done. This function does not 180 | * require that there actually is data available for reading or that 181 | * data can be written, it can be called just in case. It returns 182 | * the number of handles that still transfer data in the second 183 | * argument's integer-pointer. 184 | * 185 | * Returns: CURLMcode type, general multi error code. *NOTE* that this only 186 | * returns errors etc regarding the whole multi stack. There might 187 | * still have occurred problems on invidual transfers even when this 188 | * returns OK. 189 | */ 190 | CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, 191 | int *running_handles); 192 | 193 | /* 194 | * Name: curl_multi_cleanup() 195 | * 196 | * Desc: Cleans up and removes a whole multi stack. It does not free or 197 | * touch any individual easy handles in any way. We need to define 198 | * in what state those handles will be if this function is called 199 | * in the middle of a transfer. 200 | * 201 | * Returns: CURLMcode type, general multi error code. 202 | */ 203 | CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); 204 | 205 | /* 206 | * Name: curl_multi_info_read() 207 | * 208 | * Desc: Ask the multi handle if there's any messages/informationals from 209 | * the individual transfers. Messages include informationals such as 210 | * error code from the transfer or just the fact that a transfer is 211 | * completed. More details on these should be written down as well. 212 | * 213 | * Repeated calls to this function will return a new struct each 214 | * time, until a special "end of msgs" struct is returned as a signal 215 | * that there is no more to get at this point. 216 | * 217 | * The data the returned pointer points to will not survive calling 218 | * curl_multi_cleanup(). 219 | * 220 | * The 'CURLMsg' struct is meant to be very simple and only contain 221 | * very basic information. If more involved information is wanted, 222 | * we will provide the particular "transfer handle" in that struct 223 | * and that should/could/would be used in subsequent 224 | * curl_easy_getinfo() calls (or similar). The point being that we 225 | * must never expose complex structs to applications, as then we'll 226 | * undoubtably get backwards compatibility problems in the future. 227 | * 228 | * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out 229 | * of structs. It also writes the number of messages left in the 230 | * queue (after this read) in the integer the second argument points 231 | * to. 232 | */ 233 | CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, 234 | int *msgs_in_queue); 235 | 236 | /* 237 | * Name: curl_multi_strerror() 238 | * 239 | * Desc: The curl_multi_strerror function may be used to turn a CURLMcode 240 | * value into the equivalent human readable error string. This is 241 | * useful for printing meaningful error messages. 242 | * 243 | * Returns: A pointer to a zero-terminated error message. 244 | */ 245 | CURL_EXTERN const char *curl_multi_strerror(CURLMcode); 246 | 247 | /* 248 | * Name: curl_multi_socket() and 249 | * curl_multi_socket_all() 250 | * 251 | * Desc: An alternative version of curl_multi_perform() that allows the 252 | * application to pass in one of the file descriptors that have been 253 | * detected to have "action" on them and let libcurl perform. 254 | * See man page for details. 255 | */ 256 | #define CURL_POLL_NONE 0 257 | #define CURL_POLL_IN 1 258 | #define CURL_POLL_OUT 2 259 | #define CURL_POLL_INOUT 3 260 | #define CURL_POLL_REMOVE 4 261 | 262 | #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD 263 | 264 | #define CURL_CSELECT_IN 0x01 265 | #define CURL_CSELECT_OUT 0x02 266 | #define CURL_CSELECT_ERR 0x04 267 | 268 | typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ 269 | curl_socket_t s, /* socket */ 270 | int what, /* see above */ 271 | void *userp, /* private callback 272 | pointer */ 273 | void *socketp); /* private socket 274 | pointer */ 275 | /* 276 | * Name: curl_multi_timer_callback 277 | * 278 | * Desc: Called by libcurl whenever the library detects a change in the 279 | * maximum number of milliseconds the app is allowed to wait before 280 | * curl_multi_socket() or curl_multi_perform() must be called 281 | * (to allow libcurl's timed events to take place). 282 | * 283 | * Returns: The callback should return zero. 284 | */ 285 | typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ 286 | long timeout_ms, /* see above */ 287 | void *userp); /* private callback 288 | pointer */ 289 | 290 | CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, 291 | int *running_handles); 292 | 293 | CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, 294 | curl_socket_t s, 295 | int ev_bitmask, 296 | int *running_handles); 297 | 298 | CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, 299 | int *running_handles); 300 | 301 | #ifndef CURL_ALLOW_OLD_MULTI_SOCKET 302 | /* This macro below was added in 7.16.3 to push users who recompile to use 303 | the new curl_multi_socket_action() instead of the old curl_multi_socket() 304 | */ 305 | #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) 306 | #endif 307 | 308 | /* 309 | * Name: curl_multi_timeout() 310 | * 311 | * Desc: Returns the maximum number of milliseconds the app is allowed to 312 | * wait before curl_multi_socket() or curl_multi_perform() must be 313 | * called (to allow libcurl's timed events to take place). 314 | * 315 | * Returns: CURLM error code. 316 | */ 317 | CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, 318 | long *milliseconds); 319 | 320 | #undef CINIT /* re-using the same name as in curl.h */ 321 | 322 | #ifdef CURL_ISOCPP 323 | #define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num 324 | #else 325 | /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ 326 | #define LONG CURLOPTTYPE_LONG 327 | #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT 328 | #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT 329 | #define OFF_T CURLOPTTYPE_OFF_T 330 | #define CINIT(name,type,number) CURLMOPT_/**/name = type + number 331 | #endif 332 | 333 | typedef enum { 334 | /* This is the socket callback function pointer */ 335 | CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), 336 | 337 | /* This is the argument passed to the socket callback */ 338 | CINIT(SOCKETDATA, OBJECTPOINT, 2), 339 | 340 | /* set to 1 to enable pipelining for this multi handle */ 341 | CINIT(PIPELINING, LONG, 3), 342 | 343 | /* This is the timer callback function pointer */ 344 | CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), 345 | 346 | /* This is the argument passed to the timer callback */ 347 | CINIT(TIMERDATA, OBJECTPOINT, 5), 348 | 349 | /* maximum number of entries in the connection cache */ 350 | CINIT(MAXCONNECTS, LONG, 6), 351 | 352 | /* maximum number of (pipelining) connections to one host */ 353 | CINIT(MAX_HOST_CONNECTIONS, LONG, 7), 354 | 355 | /* maximum number of requests in a pipeline */ 356 | CINIT(MAX_PIPELINE_LENGTH, LONG, 8), 357 | 358 | /* a connection with a content-length longer than this 359 | will not be considered for pipelining */ 360 | CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), 361 | 362 | /* a connection with a chunk length longer than this 363 | will not be considered for pipelining */ 364 | CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10), 365 | 366 | /* a list of site names(+port) that are blacklisted from 367 | pipelining */ 368 | CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11), 369 | 370 | /* a list of server types that are blacklisted from 371 | pipelining */ 372 | CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12), 373 | 374 | /* maximum number of open connections in total */ 375 | CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), 376 | 377 | /* This is the server push callback function pointer */ 378 | CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14), 379 | 380 | /* This is the argument passed to the server push callback */ 381 | CINIT(PUSHDATA, OBJECTPOINT, 15), 382 | 383 | CURLMOPT_LASTENTRY /* the last unused */ 384 | } CURLMoption; 385 | 386 | 387 | /* 388 | * Name: curl_multi_setopt() 389 | * 390 | * Desc: Sets options for the multi handle. 391 | * 392 | * Returns: CURLM error code. 393 | */ 394 | CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, 395 | CURLMoption option, ...); 396 | 397 | 398 | /* 399 | * Name: curl_multi_assign() 400 | * 401 | * Desc: This function sets an association in the multi handle between the 402 | * given socket and a private pointer of the application. This is 403 | * (only) useful for curl_multi_socket uses. 404 | * 405 | * Returns: CURLM error code. 406 | */ 407 | CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, 408 | curl_socket_t sockfd, void *sockp); 409 | 410 | 411 | /* 412 | * Name: curl_push_callback 413 | * 414 | * Desc: This callback gets called when a new stream is being pushed by the 415 | * server. It approves or denies the new stream. 416 | * 417 | * Returns: CURL_PUSH_OK or CURL_PUSH_DENY. 418 | */ 419 | #define CURL_PUSH_OK 0 420 | #define CURL_PUSH_DENY 1 421 | 422 | struct curl_pushheaders; /* forward declaration only */ 423 | 424 | CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h, 425 | size_t num); 426 | CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h, 427 | const char *name); 428 | 429 | typedef int (*curl_push_callback)(CURL *parent, 430 | CURL *easy, 431 | size_t num_headers, 432 | struct curl_pushheaders *headers, 433 | void *userp); 434 | 435 | #ifdef __cplusplus 436 | } /* end of extern "C" */ 437 | #endif 438 | 439 | #endif 440 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread(void *, size_t, size_t, FILE *); 28 | size_t fwrite(const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* __STDC_HEADERS_H */ 34 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/curl/types.h: -------------------------------------------------------------------------------- 1 | /* not used */ 2 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/libcrypto.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SSL/libcrypto.a -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/libcurl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SSL/libcurl.a -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/libssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SSL/libssl.a -------------------------------------------------------------------------------- /ChatGPT/Libraries/SSL/libz.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SSL/libz.a -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD-15e9190d.o.tmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD-15e9190d.o.tmp -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'SVProgressHUD' target in the 'SVProgressHUD' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error-black.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error-black@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error-black@2x.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/error@2x.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success-black.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success-black@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success-black@2x.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.bundle/success@2x.png -------------------------------------------------------------------------------- /ChatGPT/Libraries/SVProgressHUD/SVProgressHUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVProgressHUD.h 3 | // 4 | // Created by Sam Vermette on 27.03.11. 5 | // Copyright 2011 Sam Vermette. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVProgressHUD 8 | // 9 | 10 | #import 11 | #import 12 | 13 | extern NSString * const SVProgressHUDDidReceiveTouchEventNotification; 14 | extern NSString * const SVProgressHUDWillDisappearNotification; 15 | extern NSString * const SVProgressHUDDidDisappearNotification; 16 | extern NSString * const SVProgressHUDWillAppearNotification; 17 | extern NSString * const SVProgressHUDDidAppearNotification; 18 | 19 | extern NSString * const SVProgressHUDStatusUserInfoKey; 20 | 21 | enum { 22 | SVProgressHUDMaskTypeNone = 2, // allow user interactions while HUD is displayed 23 | SVProgressHUDMaskTypeClear, // don't allow 24 | SVProgressHUDMaskTypeBlack, // don't allow and dim the UI in the back of the HUD 25 | SVProgressHUDMaskTypeGradient // don't allow and dim the UI with a a-la-alert-view bg gradient 26 | }; 27 | 28 | typedef NSUInteger SVProgressHUDMaskType; 29 | 30 | @interface SVProgressHUD : UIView 31 | 32 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000 33 | @property (readwrite, nonatomic, retain) UIColor *hudBackgroundColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 34 | @property (readwrite, nonatomic, retain) UIColor *hudForegroundColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 35 | @property (readwrite, nonatomic, retain) UIColor *hudStatusShadowColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 36 | @property (readwrite, nonatomic, retain) UIColor *hudRingBackgroundColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 37 | @property (readwrite, nonatomic, retain) UIColor *hudRingForegroundColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 38 | @property (readwrite, nonatomic, retain) UIFont *hudFont NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 39 | @property (readwrite, nonatomic, retain) UIImage *hudSuccessImage NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 40 | @property (readwrite, nonatomic, retain) UIImage *hudErrorImage NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; 41 | #endif 42 | 43 | + (void)setOffsetFromCenter:(UIOffset)offset; 44 | + (void)resetOffsetFromCenter; 45 | 46 | + (void)show; 47 | + (void)showWithMaskType:(SVProgressHUDMaskType)maskType; 48 | + (void)showWithStatus:(NSString*)status; 49 | + (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType; 50 | 51 | + (void)showProgress:(float)progress; 52 | + (void)showProgress:(float)progress status:(NSString*)status; 53 | + (void)showProgress:(float)progress status:(NSString*)status maskType:(SVProgressHUDMaskType)maskType; 54 | 55 | + (void)setStatus:(NSString*)string; // change the HUD loading status while it's showing 56 | 57 | // stops the activity indicator, shows a glyph + status, and dismisses HUD 1s later 58 | + (void)showSuccessWithStatus:(NSString*)string; 59 | + (void)showErrorWithStatus:(NSString *)string; 60 | + (void)showImage:(UIImage*)image status:(NSString*)status; // use 28x28 white pngs 61 | 62 | + (void)popActivity; 63 | + (void)dismiss; 64 | 65 | + (BOOL)isVisible; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/TRMalleableFrameView/TRMalleableFrameView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TRMalleableFrameView.h 3 | // Discord Classic 4 | // 5 | // Created by bag.xml on 3/11/18. 6 | // Copyright (c) 2018 bag.xml. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (TRMalleableFrameView) 12 | @property (nonatomic, assign) CGFloat height; 13 | @property (nonatomic, assign) CGFloat width; 14 | @property (nonatomic, assign) CGFloat x; 15 | @property (nonatomic, assign) CGFloat y; 16 | @end 17 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/TRMalleableFrameView/TRMalleableFrameView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TRMalleableFrameView.m 3 | // Discord Classic 4 | // 5 | // Created by bag.xml on 3/11/18. 6 | // Copyright (c) 2018 bag.xml. All rights reserved. 7 | // 8 | #import "TRMalleableFrameView.h" 9 | @implementation UIView (TRMalleableFrameView) 10 | 11 | - (CGFloat) height { 12 | return self.frame.size.height; 13 | } 14 | 15 | - (CGFloat) width { 16 | return self.frame.size.width; 17 | } 18 | 19 | - (CGFloat) x { 20 | return self.frame.origin.x; 21 | } 22 | 23 | - (CGFloat) y { 24 | return self.frame.origin.y; 25 | } 26 | 27 | - (CGFloat) centerY { 28 | return self.center.y; 29 | } 30 | 31 | - (CGFloat) centerX { 32 | return self.center.x; 33 | } 34 | 35 | - (void) setHeight:(CGFloat) newHeight { 36 | CGRect frame = self.frame; 37 | frame.size.height = newHeight; 38 | self.frame = frame; 39 | } 40 | 41 | - (void) setWidth:(CGFloat) newWidth { 42 | CGRect frame = self.frame; 43 | frame.size.width = newWidth; 44 | self.frame = frame; 45 | } 46 | 47 | - (void) setX:(CGFloat) newX { 48 | CGRect frame = self.frame; 49 | frame.origin.x = newX; 50 | self.frame = frame; 51 | } 52 | 53 | - (void) setY:(CGFloat) newY { 54 | CGRect frame = self.frame; 55 | frame.origin.y = newY; 56 | self.frame = frame; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /ChatGPT/Libraries/TSMarkdownParser/TSMarkdownParser-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 | #ifdef __OBJC__ 8 | #import 9 | 10 | #endif -------------------------------------------------------------------------------- /ChatGPT/Libraries/TSMarkdownParser/TSMarkdownParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSMarkdownParser.h 3 | // TSMarkdownParser 4 | // 5 | // Created by Tobias Sundstrand on 14-08-30. 6 | // Copyright (c) 2014 Computertalk Sweden. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^TSMarkdownParserMatchBlock)(NSTextCheckingResult *match, NSMutableAttributedString *attributedString); 12 | typedef void (^TSMarkdownParserFormattingBlock)(NSMutableAttributedString *attributedString, NSRange range); 13 | 14 | @interface TSMarkdownParser : NSObject 15 | 16 | @property (nonatomic, strong) UIFont *paragraphFont; 17 | @property (nonatomic, strong) UIFont *strongFont; 18 | @property (nonatomic, strong) UIFont *emphasisFont; 19 | @property (nonatomic, strong) UIFont *h1Font; 20 | @property (nonatomic, strong) UIFont *h2Font; 21 | @property (nonatomic, strong) UIFont *h3Font; 22 | @property (nonatomic, strong) UIFont *h4Font; 23 | @property (nonatomic, strong) UIFont *h5Font; 24 | @property (nonatomic, strong) UIFont *h6Font; 25 | @property (nonatomic, strong) UIFont *monospaceFont; 26 | @property (nonatomic, strong) UIColor *monospaceTextColor; 27 | @property (nonatomic, strong) UIColor *linkColor; 28 | @property (nonatomic, strong) UIColor *textColor; 29 | @property (nonatomic, copy) NSNumber *linkUnderlineStyle; 30 | @property (nonatomic, strong) NSDictionary *defaultAttributes; 31 | 32 | 33 | + (instancetype)standardParser; 34 | 35 | - (NSAttributedString *)attributedStringFromMarkdown:(NSString *)markdown; 36 | 37 | - (NSAttributedString *)attributedStringFromMarkdown:(NSString *)markdown attributes:(NSDictionary *)attributes; 38 | 39 | - (NSAttributedString *)attributedStringFromAttributedMarkdownString:(NSAttributedString *)attributedString; 40 | 41 | - (void)addParsingRuleWithRegularExpression:(NSRegularExpression *)regularExpression withBlock:(TSMarkdownParserMatchBlock)block; 42 | 43 | - (void)addParagraphParsingWithFormattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock; 44 | 45 | /* block parsing */ 46 | 47 | - (void)addHeaderParsingWithLevel:(int)header formattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock; 48 | 49 | - (void)addListParsingWithFormattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock; 50 | 51 | /* bracket parsing */ 52 | 53 | - (void)addImageParsingWithImageFormattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock alternativeTextFormattingBlock:(TSMarkdownParserFormattingBlock)alternativeFormattingBlock; 54 | 55 | - (void)addLinkParsingWithFormattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock; 56 | 57 | /* inline parsing */ 58 | 59 | - (void)addMonospacedParsingWithFormattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock; 60 | 61 | - (void)addStrongParsingWithFormattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock; 62 | 63 | - (void)addEmphasisParsingWithFormattingBlock:(TSMarkdownParserFormattingBlock)formattingBlock; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /ChatGPT/SupportingFiles/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bag-xml/ChatGPT-for-Legacy-iOS/994b9201237413556ae57997e2878bd1edc294a9/ChatGPT/SupportingFiles/.DS_Store -------------------------------------------------------------------------------- /ChatGPT/SupportingFiles/ChatGPT-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | bag.xml.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0.2-release 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarStyle 34 | UIStatusBarStyleBlackOpaque 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ChatGPT/SupportingFiles/ChatGPT-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 | -------------------------------------------------------------------------------- /ChatGPT/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ChatGPTTests/ChatGPTTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | bag.xml.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ChatGPTTests/ChatGPTTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatGPTTests.m 3 | // ChatGPTTests 4 | // 5 | // Created by XML on 1/13/25. 6 | // Copyright (c) 2025 XML. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ChatGPTTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ChatGPTTests 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 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ChatGPTTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ChatGPT for Legacy iOS 2 | ## The only ChatGPT application for old iOS that you'll need. 3 | ![siteBanner](https://chatgptlegacy.com/assets/img/banner.png) 4 | ChatGPT for Legacy iOS is a client for older versions of iOS that allow you to interact with the OpenAI API in many ways. ChatGPT for Legacy iOS supports most things that you already know from modern chatbot apps, such as thorough text conversations with context, image analysis by ChatGPT and image generation. Your conversations are also always saved automatically and can always be returned to whenever you want to. 5 | 6 | # Compatiblilty 7 | 8 | | Compatibility | iOS version | Remarks | 9 | | ------------- | ------------- | ------------- | 10 | | Incompatible | 5.x | Not at release | 11 | | Compatible | 6.x | None | 12 | | Compatible | 7.x | None | 13 | | Compatible | 8+ | Not optimized for iPhone 6 and 6+ | 14 | # How do I log in? 15 | Logging into ChatGPT for Legacy iOS is only possible via an API key. That API key can be obtained from https://platform.openai.com/ and depending on what you want to do, or if you're doing this for the first time it can cost money. Please read through OpenAI's API platform for more information. 16 | 17 | # Encountering issues, or need support? 18 | If you're encountering issues you should always take note of what happens, how you triggered it, what your iOS version is, what device type (iPads aren't supported) you're using ChatGPT for Legacy iOS on and then open a new issue on the [issues tab](https://github.com/bag-xml/ChatGPT-for-Legacy-iOS/issues). 19 | 20 | Additionally to that, you can join the bag.xml community discord on https://discord.gg/eE3XTCEMqr. This is the project server of ChatGPT for Legacy iOS, and you can get real-time help at any time if you're having issues regarding the app or more. 21 | 22 | # Support 23 | If you like the work I do you can support me on [Ko-fi](https://ko-fi.com/bagxml). It would mean the world to me and really motivate me. 24 | # Credits 25 | 26 | ### Contributors 27 | - [bag.xml](https://github.com/bag-xml) 28 | 29 | ### Libraries used 30 | 31 | - [APLSlideMenu](https://github.com/apploft/APLSlideMenu) 32 | - Base64 33 | - NSURLConnection+FoundationCompletions.m (Also Updated OpenSSL Libraries and cURL headers) 34 | - [TSMarkdownParser](https://github.com/laptobbe/TSMarkdownParser) 35 | - [SVProgressHUD](https://github.com/SVProgressHUD/SVProgressHUD) 36 | - [BButton](https://github.com/mattlawer/BButton) 37 | --------------------------------------------------------------------------------