diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dc5caf9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.afdesign filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index a6c2a92..e71b57f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,350 +1,110 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ +# Created by https://www.gitignore.io/api/swift,macos +# Edit at https://www.gitignore.io/?templates=swift,macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +# End of https://www.gitignore.io/api/swift,macos diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..812bcb8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,27 @@ +[submodule "EhautX.macOS/Carthage/Checkouts/SwiftyUserDefaults"] + path = EhautX.macOS/Carthage/Checkouts/SwiftyUserDefaults + url = https://github.com/radex/SwiftyUserDefaults.git +[submodule "EhautX.macOS/Carthage/Checkouts/Preferences"] + path = EhautX.macOS/Carthage/Checkouts/Preferences + url = https://github.com/sindresorhus/Preferences.git +[submodule "EhautX.macOS/Carthage/Checkouts/Alamofire"] + path = EhautX.macOS/Carthage/Checkouts/Alamofire + url = https://github.com/Alamofire/Alamofire.git +[submodule "Carthage/Checkouts/SwiftyUserDefaults"] + path = EhautX.macOS/Carthage/Checkouts/SwiftyUserDefaults + url = https://github.com/radex/SwiftyUserDefaults.git +[submodule "Carthage/Checkouts/Preferences"] + path = EhautX.macOS/Carthage/Checkouts/Preferences + url = https://github.com/sindresorhus/Preferences.git +[submodule "Carthage/Checkouts/Alamofire"] + path = EhautX.iOS/Carthage/Checkouts/Alamofire + url = https://github.com/Alamofire/Alamofire.git +[submodule "Carthage/Checkouts/JGProgressHUD"] + path = EhautX.iOS/Carthage/Checkouts/JGProgressHUD + url = https://github.com/JonasGessner/JGProgressHUD.git +[submodule "Carthage/Checkouts/SkyFloatingLabelTextField"] + path = EhautX.iOS/Carthage/Checkouts/SkyFloatingLabelTextField + url = https://github.com/Skyscanner/SkyFloatingLabelTextField.git +[submodule "Carthage/Checkouts/IQKeyboardManager"] + path = EhautX.iOS/Carthage/Checkouts/IQKeyboardManager + url = https://github.com/hackiftekhar/IQKeyboardManager.git diff --git a/Artwork/StatusBarIcon.afdesign b/Artwork/StatusBarIcon.afdesign new file mode 100644 index 0000000..7815861 --- /dev/null +++ b/Artwork/StatusBarIcon.afdesign @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c88c5084293d24622023dea018293dffb0d4c818e5a3c6076dbf85c29fe8978 +size 46191 diff --git a/EhautX.iOS/Cartfile b/EhautX.iOS/Cartfile new file mode 100644 index 0000000..9f2380e --- /dev/null +++ b/EhautX.iOS/Cartfile @@ -0,0 +1,5 @@ +github "Alamofire/Alamofire" ~>4.8 +github "Skyscanner/SkyFloatingLabelTextField" ~>3.0 +github "hackiftekhar/IQKeyboardManager" ~>6.4 +github "JonasGessner/JGProgressHUD" ~>2.0 + diff --git a/EhautX.iOS/Cartfile.resolved b/EhautX.iOS/Cartfile.resolved new file mode 100644 index 0000000..869d3ad --- /dev/null +++ b/EhautX.iOS/Cartfile.resolved @@ -0,0 +1,4 @@ +github "Alamofire/Alamofire" "4.8.2" +github "JonasGessner/JGProgressHUD" "v2.0.3" +github "Skyscanner/SkyFloatingLabelTextField" "v3.7.0" +github "hackiftekhar/IQKeyboardManager" "v6.4.1" diff --git a/EhautX.iOS/Carthage/Checkouts/Alamofire b/EhautX.iOS/Carthage/Checkouts/Alamofire new file mode 160000 index 0000000..75bba56 --- /dev/null +++ b/EhautX.iOS/Carthage/Checkouts/Alamofire @@ -0,0 +1 @@ +Subproject commit 75bba56748359f297a83f620d45f72cf4ebee4e7 diff --git a/EhautX.iOS/Carthage/Checkouts/IQKeyboardManager b/EhautX.iOS/Carthage/Checkouts/IQKeyboardManager new file mode 160000 index 0000000..3f31c45 --- /dev/null +++ b/EhautX.iOS/Carthage/Checkouts/IQKeyboardManager @@ -0,0 +1 @@ +Subproject commit 3f31c45feae664bcd81615796ab444e1ff450d54 diff --git a/EhautX.iOS/Carthage/Checkouts/JGProgressHUD b/EhautX.iOS/Carthage/Checkouts/JGProgressHUD new file mode 160000 index 0000000..cb523a5 --- /dev/null +++ b/EhautX.iOS/Carthage/Checkouts/JGProgressHUD @@ -0,0 +1 @@ +Subproject commit cb523a5304572387edd811e67170ebfdad174475 diff --git a/EhautX.iOS/Carthage/Checkouts/SkyFloatingLabelTextField b/EhautX.iOS/Carthage/Checkouts/SkyFloatingLabelTextField new file mode 160000 index 0000000..b398f65 --- /dev/null +++ b/EhautX.iOS/Carthage/Checkouts/SkyFloatingLabelTextField @@ -0,0 +1 @@ +Subproject commit b398f65ffffb07cd8f57af93bd76c1f681fa9100 diff --git a/EhautX.iOS/EhautX.iOS.xcodeproj/project.pbxproj b/EhautX.iOS/EhautX.iOS.xcodeproj/project.pbxproj new file mode 100644 index 0000000..aec9d1b --- /dev/null +++ b/EhautX.iOS/EhautX.iOS.xcodeproj/project.pbxproj @@ -0,0 +1,686 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + FB1E5E7C22FAC7BC00A42A92 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1E5E7B22FAC7BC00A42A92 /* AppDelegate.swift */; }; + FB1E5E7E22FAC7BC00A42A92 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1E5E7D22FAC7BC00A42A92 /* ViewController.swift */; }; + FB1E5E8122FAC7BC00A42A92 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB1E5E7F22FAC7BC00A42A92 /* Main.storyboard */; }; + FB1E5E8322FAC7BC00A42A92 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FB1E5E8222FAC7BC00A42A92 /* Assets.xcassets */; }; + FB1E5E8622FAC7BC00A42A92 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB1E5E8422FAC7BC00A42A92 /* LaunchScreen.storyboard */; }; + FB1E5E9122FAC7BD00A42A92 /* EhautXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1E5E9022FAC7BD00A42A92 /* EhautXTests.swift */; }; + FB1E5E9C22FAC7BD00A42A92 /* EhautXUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1E5E9B22FAC7BD00A42A92 /* EhautXUITests.swift */; }; + FB1E5EBE22FAD51100A42A92 /* SkyFloatingLabelTextField.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1E5EBA22FAD51100A42A92 /* SkyFloatingLabelTextField.framework */; }; + FB1E5EBF22FAD51100A42A92 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1E5EBB22FAD51100A42A92 /* Alamofire.framework */; }; + FB1E5EC022FAD51100A42A92 /* IQKeyboardManagerSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1E5EBC22FAD51100A42A92 /* IQKeyboardManagerSwift.framework */; }; + FB1E5EC122FAD51100A42A92 /* JGProgressHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1E5EBD22FAD51100A42A92 /* JGProgressHUD.framework */; }; + FBDA2467230594D30004F64E /* AppPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDA2466230594D30004F64E /* AppPreferences.swift */; }; + FBDA2469230595210004F64E /* Crypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDA2468230595210004F64E /* Crypto.swift */; }; + FBDA246B2305954F0004F64E /* Network.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDA246A2305954F0004F64E /* Network.swift */; }; + FBDA246D230595D40004F64E /* service.html in Resources */ = {isa = PBXBuildFile; fileRef = FBDA246C230595D40004F64E /* service.html */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + FB1E5E8D22FAC7BD00A42A92 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FB1E5E7022FAC7BC00A42A92 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FB1E5E7722FAC7BC00A42A92; + remoteInfo = EhautX; + }; + FB1E5E9822FAC7BD00A42A92 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FB1E5E7022FAC7BC00A42A92 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FB1E5E7722FAC7BC00A42A92; + remoteInfo = EhautX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + FB1E5E7822FAC7BC00A42A92 /* EhautX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EhautX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1E5E7B22FAC7BC00A42A92 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FB1E5E7D22FAC7BC00A42A92 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + FB1E5E8022FAC7BC00A42A92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FB1E5E8222FAC7BC00A42A92 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FB1E5E8522FAC7BC00A42A92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FB1E5E8722FAC7BC00A42A92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1E5E8C22FAC7BD00A42A92 /* EhautXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EhautXTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1E5E9022FAC7BD00A42A92 /* EhautXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhautXTests.swift; sourceTree = ""; }; + FB1E5E9222FAC7BD00A42A92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1E5E9722FAC7BD00A42A92 /* EhautXUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EhautXUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1E5E9B22FAC7BD00A42A92 /* EhautXUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhautXUITests.swift; sourceTree = ""; }; + FB1E5E9D22FAC7BD00A42A92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1E5EBA22FAD51100A42A92 /* SkyFloatingLabelTextField.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SkyFloatingLabelTextField.framework; path = Carthage/Build/iOS/SkyFloatingLabelTextField.framework; sourceTree = ""; }; + FB1E5EBB22FAD51100A42A92 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = ""; }; + FB1E5EBC22FAD51100A42A92 /* IQKeyboardManagerSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IQKeyboardManagerSwift.framework; path = Carthage/Build/iOS/IQKeyboardManagerSwift.framework; sourceTree = ""; }; + FB1E5EBD22FAD51100A42A92 /* JGProgressHUD.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JGProgressHUD.framework; path = Carthage/Build/iOS/JGProgressHUD.framework; sourceTree = ""; }; + FBDA2466230594D30004F64E /* AppPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppPreferences.swift; sourceTree = ""; }; + FBDA2468230595210004F64E /* Crypto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Crypto.swift; sourceTree = ""; }; + FBDA246A2305954F0004F64E /* Network.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Network.swift; sourceTree = ""; }; + FBDA246C230595D40004F64E /* service.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = service.html; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FB1E5E7522FAC7BC00A42A92 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1E5EBE22FAD51100A42A92 /* SkyFloatingLabelTextField.framework in Frameworks */, + FB1E5EBF22FAD51100A42A92 /* Alamofire.framework in Frameworks */, + FB1E5EC022FAD51100A42A92 /* IQKeyboardManagerSwift.framework in Frameworks */, + FB1E5EC122FAD51100A42A92 /* JGProgressHUD.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1E5E8922FAC7BD00A42A92 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1E5E9422FAC7BD00A42A92 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FB1E5E6F22FAC7BC00A42A92 = { + isa = PBXGroup; + children = ( + FB1E5E7A22FAC7BC00A42A92 /* EhautX */, + FB1E5E8F22FAC7BD00A42A92 /* EhautXTests */, + FB1E5E9A22FAC7BD00A42A92 /* EhautXUITests */, + FB1E5E7922FAC7BC00A42A92 /* Products */, + FB1E5EB922FAD51100A42A92 /* Frameworks */, + ); + sourceTree = ""; + }; + FB1E5E7922FAC7BC00A42A92 /* Products */ = { + isa = PBXGroup; + children = ( + FB1E5E7822FAC7BC00A42A92 /* EhautX.app */, + FB1E5E8C22FAC7BD00A42A92 /* EhautXTests.xctest */, + FB1E5E9722FAC7BD00A42A92 /* EhautXUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + FB1E5E7A22FAC7BC00A42A92 /* EhautX */ = { + isa = PBXGroup; + children = ( + FBDA2465230594B00004F64E /* View */, + FBDA2464230594A90004F64E /* Service */, + FBDA2463230594A10004F64E /* Model */, + FB1E5E7B22FAC7BC00A42A92 /* AppDelegate.swift */, + FB1E5E7D22FAC7BC00A42A92 /* ViewController.swift */, + FB1E5E7F22FAC7BC00A42A92 /* Main.storyboard */, + FB1E5E8222FAC7BC00A42A92 /* Assets.xcassets */, + FB1E5E8422FAC7BC00A42A92 /* LaunchScreen.storyboard */, + FB1E5E8722FAC7BC00A42A92 /* Info.plist */, + FBDA246C230595D40004F64E /* service.html */, + ); + path = EhautX; + sourceTree = ""; + }; + FB1E5E8F22FAC7BD00A42A92 /* EhautXTests */ = { + isa = PBXGroup; + children = ( + FB1E5E9022FAC7BD00A42A92 /* EhautXTests.swift */, + FB1E5E9222FAC7BD00A42A92 /* Info.plist */, + ); + path = EhautXTests; + sourceTree = ""; + }; + FB1E5E9A22FAC7BD00A42A92 /* EhautXUITests */ = { + isa = PBXGroup; + children = ( + FB1E5E9B22FAC7BD00A42A92 /* EhautXUITests.swift */, + FB1E5E9D22FAC7BD00A42A92 /* Info.plist */, + ); + path = EhautXUITests; + sourceTree = ""; + }; + FB1E5EB922FAD51100A42A92 /* Frameworks */ = { + isa = PBXGroup; + children = ( + FB1E5EBB22FAD51100A42A92 /* Alamofire.framework */, + FB1E5EBC22FAD51100A42A92 /* IQKeyboardManagerSwift.framework */, + FB1E5EBD22FAD51100A42A92 /* JGProgressHUD.framework */, + FB1E5EBA22FAD51100A42A92 /* SkyFloatingLabelTextField.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + FBDA2463230594A10004F64E /* Model */ = { + isa = PBXGroup; + children = ( + FBDA2466230594D30004F64E /* AppPreferences.swift */, + ); + path = Model; + sourceTree = ""; + }; + FBDA2464230594A90004F64E /* Service */ = { + isa = PBXGroup; + children = ( + FBDA2468230595210004F64E /* Crypto.swift */, + FBDA246A2305954F0004F64E /* Network.swift */, + ); + path = Service; + sourceTree = ""; + }; + FBDA2465230594B00004F64E /* View */ = { + isa = PBXGroup; + children = ( + ); + path = View; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FB1E5E7722FAC7BC00A42A92 /* EhautX */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1E5EA022FAC7BD00A42A92 /* Build configuration list for PBXNativeTarget "EhautX" */; + buildPhases = ( + FB1E5E7422FAC7BC00A42A92 /* Sources */, + FB1E5E7522FAC7BC00A42A92 /* Frameworks */, + FB1E5E7622FAC7BC00A42A92 /* Resources */, + FB1E5EB822FAD4A500A42A92 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = EhautX; + productName = EhautX; + productReference = FB1E5E7822FAC7BC00A42A92 /* EhautX.app */; + productType = "com.apple.product-type.application"; + }; + FB1E5E8B22FAC7BD00A42A92 /* EhautXTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1E5EA322FAC7BD00A42A92 /* Build configuration list for PBXNativeTarget "EhautXTests" */; + buildPhases = ( + FB1E5E8822FAC7BD00A42A92 /* Sources */, + FB1E5E8922FAC7BD00A42A92 /* Frameworks */, + FB1E5E8A22FAC7BD00A42A92 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FB1E5E8E22FAC7BD00A42A92 /* PBXTargetDependency */, + ); + name = EhautXTests; + productName = EhautXTests; + productReference = FB1E5E8C22FAC7BD00A42A92 /* EhautXTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + FB1E5E9622FAC7BD00A42A92 /* EhautXUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1E5EA622FAC7BD00A42A92 /* Build configuration list for PBXNativeTarget "EhautXUITests" */; + buildPhases = ( + FB1E5E9322FAC7BD00A42A92 /* Sources */, + FB1E5E9422FAC7BD00A42A92 /* Frameworks */, + FB1E5E9522FAC7BD00A42A92 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FB1E5E9922FAC7BD00A42A92 /* PBXTargetDependency */, + ); + name = EhautXUITests; + productName = EhautXUITests; + productReference = FB1E5E9722FAC7BD00A42A92 /* EhautXUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FB1E5E7022FAC7BC00A42A92 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1030; + LastUpgradeCheck = 1030; + ORGANIZATIONNAME = Ehaut; + TargetAttributes = { + FB1E5E7722FAC7BC00A42A92 = { + CreatedOnToolsVersion = 10.3; + }; + FB1E5E8B22FAC7BD00A42A92 = { + CreatedOnToolsVersion = 10.3; + TestTargetID = FB1E5E7722FAC7BC00A42A92; + }; + FB1E5E9622FAC7BD00A42A92 = { + CreatedOnToolsVersion = 10.3; + TestTargetID = FB1E5E7722FAC7BC00A42A92; + }; + }; + }; + buildConfigurationList = FB1E5E7322FAC7BC00A42A92 /* Build configuration list for PBXProject "EhautX.iOS" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FB1E5E6F22FAC7BC00A42A92; + productRefGroup = FB1E5E7922FAC7BC00A42A92 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FB1E5E7722FAC7BC00A42A92 /* EhautX */, + FB1E5E8B22FAC7BD00A42A92 /* EhautXTests */, + FB1E5E9622FAC7BD00A42A92 /* EhautXUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FB1E5E7622FAC7BC00A42A92 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FBDA246D230595D40004F64E /* service.html in Resources */, + FB1E5E8622FAC7BC00A42A92 /* LaunchScreen.storyboard in Resources */, + FB1E5E8322FAC7BC00A42A92 /* Assets.xcassets in Resources */, + FB1E5E8122FAC7BC00A42A92 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1E5E8A22FAC7BD00A42A92 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1E5E9522FAC7BD00A42A92 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + FB1E5EB822FAD4A500A42A92 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "$(SRCROOT)/input.xcfilelist", + ); + inputPaths = ( + ); + outputFileListPaths = ( + "$(SRCROOT)/output.xcfilelist", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FB1E5E7422FAC7BC00A42A92 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FBDA246B2305954F0004F64E /* Network.swift in Sources */, + FBDA2469230595210004F64E /* Crypto.swift in Sources */, + FBDA2467230594D30004F64E /* AppPreferences.swift in Sources */, + FB1E5E7E22FAC7BC00A42A92 /* ViewController.swift in Sources */, + FB1E5E7C22FAC7BC00A42A92 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1E5E8822FAC7BD00A42A92 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1E5E9122FAC7BD00A42A92 /* EhautXTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1E5E9322FAC7BD00A42A92 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1E5E9C22FAC7BD00A42A92 /* EhautXUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + FB1E5E8E22FAC7BD00A42A92 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FB1E5E7722FAC7BC00A42A92 /* EhautX */; + targetProxy = FB1E5E8D22FAC7BD00A42A92 /* PBXContainerItemProxy */; + }; + FB1E5E9922FAC7BD00A42A92 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FB1E5E7722FAC7BC00A42A92 /* EhautX */; + targetProxy = FB1E5E9822FAC7BD00A42A92 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + FB1E5E7F22FAC7BC00A42A92 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FB1E5E8022FAC7BC00A42A92 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FB1E5E8422FAC7BC00A42A92 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FB1E5E8522FAC7BC00A42A92 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FB1E5E9E22FAC7BD00A42A92 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FB1E5E9F22FAC7BD00A42A92 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FB1E5EA122FAC7BD00A42A92 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = GC96FM2SBJ; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = EhautX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautX.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FB1E5EA222FAC7BD00A42A92 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = GC96FM2SBJ; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = EhautX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautX.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + FB1E5EA422FAC7BD00A42A92 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EhautX.app/EhautX"; + }; + name = Debug; + }; + FB1E5EA522FAC7BD00A42A92 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EhautX.app/EhautX"; + }; + name = Release; + }; + FB1E5EA722FAC7BD00A42A92 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = EhautX; + }; + name = Debug; + }; + FB1E5EA822FAC7BD00A42A92 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = EhautX; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FB1E5E7322FAC7BC00A42A92 /* Build configuration list for PBXProject "EhautX.iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1E5E9E22FAC7BD00A42A92 /* Debug */, + FB1E5E9F22FAC7BD00A42A92 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1E5EA022FAC7BD00A42A92 /* Build configuration list for PBXNativeTarget "EhautX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1E5EA122FAC7BD00A42A92 /* Debug */, + FB1E5EA222FAC7BD00A42A92 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1E5EA322FAC7BD00A42A92 /* Build configuration list for PBXNativeTarget "EhautXTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1E5EA422FAC7BD00A42A92 /* Debug */, + FB1E5EA522FAC7BD00A42A92 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1E5EA622FAC7BD00A42A92 /* Build configuration list for PBXNativeTarget "EhautXUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1E5EA722FAC7BD00A42A92 /* Debug */, + FB1E5EA822FAC7BD00A42A92 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FB1E5E7022FAC7BC00A42A92 /* Project object */; +} diff --git a/EhautX.iOS/EhautX.iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/EhautX.iOS/EhautX.iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..35f01f6 --- /dev/null +++ b/EhautX.iOS/EhautX.iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/EhautX/Entitlements.plist b/EhautX.iOS/EhautX.iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 66% rename from EhautX/Entitlements.plist rename to EhautX.iOS/EhautX.iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist index ee95ab7..18d9810 100644 --- a/EhautX/Entitlements.plist +++ b/EhautX.iOS/EhautX.iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -2,9 +2,7 @@ - com.apple.security.app-sandbox - - com.apple.security.network.client + IDEDidComputeMac32BitWarning diff --git a/EhautX.iOS/EhautX/AppDelegate.swift b/EhautX.iOS/EhautX/AppDelegate.swift new file mode 100644 index 0000000..d4154f2 --- /dev/null +++ b/EhautX.iOS/EhautX/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// EhautX +// +// Created by EhautTeam on 2019/8/7. +// Copyright © 2019 Ehaut. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/EhautX.iOS/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json b/EhautX.iOS/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/EhautX.iOS/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX/Assets.xcassets/Contents.json b/EhautX.iOS/EhautX/Assets.xcassets/Contents.json similarity index 92% rename from EhautX/Assets.xcassets/Contents.json rename to EhautX.iOS/EhautX/Assets.xcassets/Contents.json index 4caf392..da4a164 100644 --- a/EhautX/Assets.xcassets/Contents.json +++ b/EhautX.iOS/EhautX/Assets.xcassets/Contents.json @@ -1,4 +1,4 @@ -{ +{ "info" : { "version" : 1, "author" : "xcode" diff --git a/EhautX.iOS/EhautX/Base.lproj/LaunchScreen.storyboard b/EhautX.iOS/EhautX/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..3e92031 --- /dev/null +++ b/EhautX.iOS/EhautX/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX.iOS/EhautX/Base.lproj/Main.storyboard b/EhautX.iOS/EhautX/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f377b7e --- /dev/null +++ b/EhautX.iOS/EhautX/Base.lproj/Main.storyboard @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX.iOS/EhautX/Info.plist b/EhautX.iOS/EhautX/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/EhautX.iOS/EhautX/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/EhautX.iOS/EhautX/Model/AppPreferences.swift b/EhautX.iOS/EhautX/Model/AppPreferences.swift new file mode 100644 index 0000000..0dccf8c --- /dev/null +++ b/EhautX.iOS/EhautX/Model/AppPreferences.swift @@ -0,0 +1,75 @@ +// +// AppPreferences.swift +// EhautTeam +// +// Created by zh on 2019/5/26. +// Copyright © 2019 ehaut. All rights reserved. +// + +import Alamofire +import Foundation + +struct OnlineInfo { + static var networkIsConnect: Bool = false + static var isOnline: Bool = false + static var onlineIp: String = "" + static var onlineUsername: String = "" + static var usedData: String = "" + static var usedTime: Int = 0 + static var serverTime: Int = 0 + static var loginTime: Int = 0 +} + +struct ServerInfo { + // 服务器地址示范http://172.16.154.130,请不要忘了http://头以及没有最后/符号 + static var authServerAddr: String = "http://172.16.154.130" + static var authServerPort: String = "69" + static var serviceServerAddr: String = "http://172.16.154.130" + static var serviceServerPort: String = "8800" + static var macAddr: String = "" + static var acid: String = "1" + static var type: String = "3" + static var drop: String = "0" + static var pop: String = "1" + static var key: String = "1234567890" +} + +struct TestServerInfo { + // fake cgi server + static var testServerAddr: String = "https://cgi.ehaut.cn" + static var testModeAddr: String = "https://cgi.ehaut.cn/testmode" + // static var environmentalFile:String = "https://cgi.ehaut.cn/env.json" + // 不要编辑以下部分 + static var testServerStatus: Int = -1 + static var authServerStatus: Int = -1 + static var isTestModeOn = true + static var isCgiBroken = false + static var isNetworkConnect = false +} + +struct networkSet { + static let Manager: Alamofire.SessionManager = { + let configuration = URLSessionConfiguration.default + configuration.timeoutIntervalForRequest = 10 // 超时设置 + return Alamofire.SessionManager(configuration: configuration) + }() + + static var testServerAddr: String = TestServerInfo.testServerAddr + // static let testNetworkManger = Alamofire.NetworkReachabilityManager(host: testServerAddr) + static var authServerAddr: String = ServerInfo.authServerAddr + // static let authNetworkManger = Alamofire.NetworkReachabilityManager(host: authServerAddr) +} + +struct UserInfo { + static var username: String = "" + static var password: String = "" +} + +struct postResult { + static var networkIsConnect: Bool = false + static var result: String = "" + static var isLoginOK: Bool = false + static var isLogoutOK: Bool = false + static var isAcidError: Bool = false + static var isNotOnline: Bool = false +} diff --git a/EhautX.iOS/EhautX/Service/Crypto.swift b/EhautX.iOS/EhautX/Service/Crypto.swift new file mode 100644 index 0000000..0331a6b --- /dev/null +++ b/EhautX.iOS/EhautX/Service/Crypto.swift @@ -0,0 +1,55 @@ +// +// Crypto.swift +// EhautTeam +// +// Created by zh on 2019/5/26. +// Copyright © 2019 ehaut. All rights reserved. +// + +import Foundation + +class Crypto { + static func usernameEncrypt(username: String) -> String { + var user: String = "{SRUN3}\r\n" + + for each in username { + let e = each.asciiValue + 4 + user += e.asciiToString + } + + return user + } + + static func passwordEncrypt(password: String, passwordKey: String) -> String { + var passwd: String = "" + let passwordKeyLength = passwordKey.count + let key = Array(passwordKey) + var i = 0 + for each in password { + let ki: Int = each.asciiValue ^ key[passwordKeyLength - i % passwordKeyLength - 1].asciiValue + let _l: Int = Int((ki & 0x0F) + 0x36) + let _h: Int = Int((ki >> 4 & 0x0F) + 0x63) + if i % 2 == 0 { + passwd += _l.asciiToString + _h.asciiToString + } else { + passwd += _h.asciiToString + _l.asciiToString + } + i += 1 + } + + return passwd + } +} + +extension Character { + var asciiValue: Int { + let s = String(self).unicodeScalars + return Int(s[s.startIndex].value) + } +} + +extension Int { + var asciiToString: String { + return String(UnicodeScalar(UInt8(self))) + } +} diff --git a/EhautX.iOS/EhautX/Service/Network.swift b/EhautX.iOS/EhautX/Service/Network.swift new file mode 100644 index 0000000..a90495a --- /dev/null +++ b/EhautX.iOS/EhautX/Service/Network.swift @@ -0,0 +1,224 @@ +// +// Network.swift +// EhautTeam +// +// Created by zh on 2019/5/26. +// Copyright © 2019 ehaut. All rights reserved. +// + +import Alamofire +import Foundation + +class Network { + static func getUserStatus(method: @escaping () -> Void) { + // var networkIsConnect = false + var serverAddress: String = "" + var url: String = "" + if TestServerInfo.isTestModeOn == false { + serverAddress = ServerInfo.authServerAddr // + ":" + ServerInfo.authServerPort + url = serverAddress + "/cgi-bin/rad_user_info" + } else { + serverAddress = TestServerInfo.testServerAddr + url = serverAddress + "/cgi-bin/rad_user_info" + } + let queue = DispatchQueue(label: "cn.ehut.response-queue", qos: .default, attributes: [.concurrent]) + networkSet.Manager.request(url).responseString( + queue: queue, + completionHandler: { response in + switch response.result { + case let .success(get): + print(get) + OnlineInfo.networkIsConnect = true + if get.contains("502 Bad Gateway") { + print("cgi is broken") + TestServerInfo.isCgiBroken = true + } else if get.contains("not_online") || get.contains("not_online_error") { + TestServerInfo.isCgiBroken = false + OnlineInfo.isOnline = false + } else { + TestServerInfo.isCgiBroken = false + OnlineInfo.isOnline = true + let list = get.components(separatedBy: ",") + OnlineInfo.loginTime = Int(list[1])! + OnlineInfo.onlineIp = list[8] + OnlineInfo.onlineUsername = list[0] + let d = Double(list[6])! + if d > (1024 * 1024) { + let data: Double = d / (1024 * 1024) + OnlineInfo.usedData = data.format(".4") + " MB" + } else if d > 1024 { + let data: Double = d / 1024 + OnlineInfo.usedData = data.format(".4") + " KB" + } else { + OnlineInfo.usedData = String(d) + " B" + } + OnlineInfo.serverTime = Int(list[2])! + let t = Int(list[7])! + OnlineInfo.usedTime = (t + OnlineInfo.serverTime - OnlineInfo.loginTime) + } + case let .failure(error): + OnlineInfo.networkIsConnect = false + print(error) + } + DispatchQueue.main.async { + method() + } + } + ) + } + + static func getTestMode(method: @escaping () -> Void) { + let url = TestServerInfo.testModeAddr + let queue = DispatchQueue(label: "cn.ehut.response-queue", qos: .default, attributes: [.concurrent]) + networkSet.Manager.request(url).responseString( + queue: queue, + completionHandler: { response in + switch response.result { + case let .success(get): + print(get) + TestServerInfo.isNetworkConnect = true + OnlineInfo.networkIsConnect = true + if get.contains("off") || get.contains("502 Bad Gateway") { + print("测试模式关闭") + TestServerInfo.isTestModeOn = false + } else { + print("测试模式开启") + TestServerInfo.isTestModeOn = true + } + case let .failure(error): + TestServerInfo.isNetworkConnect = false + TestServerInfo.isTestModeOn = false + print(error) + } + DispatchQueue.main.async { + method() + } + } + ) + } + + static func login(method: @escaping () -> Void) { + var serverAddress: String = "" + var url: String = "" + if TestServerInfo.isTestModeOn == false { + serverAddress = ServerInfo.authServerAddr // + ":" + ServerInfo.authServerPort + url = serverAddress + "/cgi-bin/srun_portal" + } else { + serverAddress = TestServerInfo.testServerAddr + url = serverAddress + "/cgi-bin/srun_portal" + } + let queue = DispatchQueue(label: "cn.ehut.response-queue", qos: .default, attributes: [.concurrent]) + var username: String = "" + if TestServerInfo.isTestModeOn == true { + username = UserInfo.username + } else { + username = Crypto.usernameEncrypt(username: UserInfo.username) + } + let parameters: Parameters = [ + "action": "login", + "username": username, + "password": Crypto.passwordEncrypt(password: UserInfo.password, passwordKey: ServerInfo.key), + "mac": ServerInfo.macAddr, + "ac_id": ServerInfo.acid, + "type": ServerInfo.type, + "n": "117", + "pop": ServerInfo.pop, + "drop": ServerInfo.drop, + "mbytes": "0", + "minutes": "0", + ] + print("url", url) + networkSet.Manager.request(url, method: .post, parameters: parameters, encoding: URLEncoding.queryString).responseString( + queue: queue, + completionHandler: { response in + switch response.result { + case let .success(get): + print(get) + postResult.result = get + postResult.networkIsConnect = true + if get.contains("502 Bad Gateway") { + print("cgi is broken") + TestServerInfo.isCgiBroken = true + } else if get.contains("login_ok") { + TestServerInfo.isCgiBroken = false + postResult.isLoginOK = true + } else { + TestServerInfo.isCgiBroken = false + postResult.isLoginOK = false + if get.contains("login_error#INFO failed, BAS respond timeout.") { + postResult.isAcidError = true + } + } + case let .failure(error): + postResult.networkIsConnect = false + print(error) + } + DispatchQueue.main.async { + method() + } + } + ) + } + + static func logout(method: @escaping () -> Void) { + var serverAddress: String = "" + var url: String = "" + if TestServerInfo.isTestModeOn == false { + serverAddress = ServerInfo.authServerAddr // + ":" + ServerInfo.authServerPort + url = serverAddress + "/cgi-bin/srun_portal" + } else { + serverAddress = TestServerInfo.testServerAddr + url = serverAddress + "/cgi-bin/srun_portal" + } + let queue = DispatchQueue(label: "cn.ehut.response-queue", qos: .default, attributes: [.concurrent]) + let parameters: Parameters = [ + "action": "logout", + "username": Crypto.usernameEncrypt(username: OnlineInfo.onlineUsername), + "mac": ServerInfo.macAddr, + "ac_id": ServerInfo.acid, + "type": ServerInfo.type, + "n": "117", + "pop": ServerInfo.pop, + "drop": ServerInfo.drop, + "mbytes": "0", + "minutes": "0", + ] + networkSet.Manager.request(url, method: .post, parameters: parameters, encoding: URLEncoding.queryString).responseString( + queue: queue, + completionHandler: { response in + switch response.result { + case let .success(get): + print(get) + postResult.result = get + postResult.networkIsConnect = true + if get.contains("502 Bad Gateway") { + print("cgi is broken") + TestServerInfo.isCgiBroken = true + } else if get.contains("logout_ok") { + TestServerInfo.isCgiBroken = false + postResult.isLogoutOK = true + } else { + TestServerInfo.isCgiBroken = false + postResult.isLogoutOK = false + if get.contains("You are not online.") { + postResult.isNotOnline = true + } + } + case let .failure(error): + postResult.networkIsConnect = false + print(error) + } + DispatchQueue.main.async { + method() + } + } + ) + } +} + +extension Double { + // 取小数点后几位 + public func format(_ f: String) -> String { + return String(format: "%\(f)f", self) + } +} diff --git a/EhautX.iOS/EhautX/ViewController.swift b/EhautX.iOS/EhautX/ViewController.swift new file mode 100644 index 0000000..04e32dd --- /dev/null +++ b/EhautX.iOS/EhautX/ViewController.swift @@ -0,0 +1,20 @@ +// +// ViewController.swift +// EhautX +// +// Created by EhautTeam on 2019/8/7. +// Copyright © 2019 Ehaut. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + +} + diff --git a/EhautX.iOS/EhautX/service.html b/EhautX.iOS/EhautX/service.html new file mode 100644 index 0000000..b8fedb6 --- /dev/null +++ b/EhautX.iOS/EhautX/service.html @@ -0,0 +1,257 @@ + + + + + + + + + + 移动端校园网客户端自服务系统 + + + + + + + +
+
+

移动端校园网客户端自服务系统

+

+

+ 学号:
+
+
+ 密码:
+
+
+ +
+

声明:本第三方网页仅用于解决移动端无法登录官方自服务情况。
网页不会储存您的个人信息,仅调用接口帮您跳转登录。


+ +
+ +
+ +

+

© Powered By E-HAUT Team

+ + + + + diff --git a/EhautX.iOS/EhautXTests/EhautXTests.swift b/EhautX.iOS/EhautXTests/EhautXTests.swift new file mode 100644 index 0000000..d4bd1ec --- /dev/null +++ b/EhautX.iOS/EhautXTests/EhautXTests.swift @@ -0,0 +1,34 @@ +// +// EhautXTests.swift +// EhautXTests +// +// Created by EhautTeam on 2019/8/7. +// Copyright © 2019 Ehaut. All rights reserved. +// + +import XCTest +@testable import EhautX + +class EhautXTests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/EhautX.iOS/EhautXTests/Info.plist b/EhautX.iOS/EhautXTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/EhautX.iOS/EhautXTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/EhautX.iOS/EhautXUITests/EhautXUITests.swift b/EhautX.iOS/EhautXUITests/EhautXUITests.swift new file mode 100644 index 0000000..4e6823a --- /dev/null +++ b/EhautX.iOS/EhautXUITests/EhautXUITests.swift @@ -0,0 +1,34 @@ +// +// EhautXUITests.swift +// EhautXUITests +// +// Created by EhautTeam on 2019/8/7. +// Copyright © 2019 Ehaut. All rights reserved. +// + +import XCTest + +class EhautXUITests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/EhautX.iOS/EhautXUITests/Info.plist b/EhautX.iOS/EhautXUITests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/EhautX.iOS/EhautXUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/EhautX.iOS/input.xcfilelist b/EhautX.iOS/input.xcfilelist new file mode 100644 index 0000000..dbd22f4 --- /dev/null +++ b/EhautX.iOS/input.xcfilelist @@ -0,0 +1,4 @@ +$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework +$(SRCROOT)/Carthage/Build/iOS/IQKeyboardManagerSwift.framework +$(SRCROOT)/Carthage/Build/iOS/JGProgressHUD.framework +$(SRCROOT)/Carthage/Build/iOS/SkyFloatingLabelTextField.framework diff --git a/EhautX.iOS/output.xcfilelist b/EhautX.iOS/output.xcfilelist new file mode 100644 index 0000000..f9eeb61 --- /dev/null +++ b/EhautX.iOS/output.xcfilelist @@ -0,0 +1,4 @@ +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Alamofire.framework +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/IQKeyboardManagerSwift.framework +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/JGProgressHUD.framework +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SkyFloatingLabelTextField.framework diff --git a/EhautX.macOS/Cartfile b/EhautX.macOS/Cartfile new file mode 100644 index 0000000..cb8fafc --- /dev/null +++ b/EhautX.macOS/Cartfile @@ -0,0 +1,4 @@ +github "Alamofire/Alamofire" ~>4.8 +github "radex/SwiftyUserDefaults" ~>4.0 +github "sindresorhus/Preferences" ~>0.4 + diff --git a/EhautX.macOS/Cartfile.resolved b/EhautX.macOS/Cartfile.resolved new file mode 100644 index 0000000..4cc87d0 --- /dev/null +++ b/EhautX.macOS/Cartfile.resolved @@ -0,0 +1,3 @@ +github "Alamofire/Alamofire" "4.8.2" +github "radex/SwiftyUserDefaults" "4.0.0" +github "sindresorhus/Preferences" "v0.4.0" diff --git a/EhautX.macOS/Carthage/Checkouts/Alamofire b/EhautX.macOS/Carthage/Checkouts/Alamofire new file mode 160000 index 0000000..75bba56 --- /dev/null +++ b/EhautX.macOS/Carthage/Checkouts/Alamofire @@ -0,0 +1 @@ +Subproject commit 75bba56748359f297a83f620d45f72cf4ebee4e7 diff --git a/EhautX.macOS/Carthage/Checkouts/Preferences b/EhautX.macOS/Carthage/Checkouts/Preferences new file mode 160000 index 0000000..0feb15b --- /dev/null +++ b/EhautX.macOS/Carthage/Checkouts/Preferences @@ -0,0 +1 @@ +Subproject commit 0feb15b0e1293d6aa6b8721bc6468139b66b6094 diff --git a/EhautX.macOS/Carthage/Checkouts/SwiftyUserDefaults b/EhautX.macOS/Carthage/Checkouts/SwiftyUserDefaults new file mode 160000 index 0000000..566ace1 --- /dev/null +++ b/EhautX.macOS/Carthage/Checkouts/SwiftyUserDefaults @@ -0,0 +1 @@ +Subproject commit 566ace16ee91242b61e2e9da6cdbe7dfdadd926c diff --git a/EhautX.macOS/EhautX.macOS.xcodeproj/project.pbxproj b/EhautX.macOS/EhautX.macOS.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2800baf --- /dev/null +++ b/EhautX.macOS/EhautX.macOS.xcodeproj/project.pbxproj @@ -0,0 +1,654 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + FB1483A422CB898300449969 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483A322CB898300449969 /* AppDelegate.swift */; }; + FB1483A622CB898300449969 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FB1483A522CB898300449969 /* Assets.xcassets */; }; + FB1483A922CB898300449969 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = FB1483A722CB898300449969 /* MainMenu.xib */; }; + FB1483B522CB898300449969 /* EhautXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483B422CB898300449969 /* EhautXTests.swift */; }; + FB1483C022CB898300449969 /* EhautXUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483BF22CB898300449969 /* EhautXUITests.swift */; }; + FB1483D122CB8B9800449969 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1483CE22CB8B9800449969 /* Alamofire.framework */; }; + FB1483D222CB8B9800449969 /* Preferences.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1483CF22CB8B9800449969 /* Preferences.framework */; }; + FB1483D322CB8B9800449969 /* SwiftyUserDefaults.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1483D022CB8B9800449969 /* SwiftyUserDefaults.framework */; }; + FB1483D822CBA20200449969 /* GeneralPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483D622CBA20200449969 /* GeneralPrefsViewController.swift */; }; + FB1483D922CBA20200449969 /* GeneralPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FB1483D722CBA20200449969 /* GeneralPrefsViewController.xib */; }; + FB1483E022CBA82200449969 /* AdvancedPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483DE22CBA82200449969 /* AdvancedPrefsViewController.swift */; }; + FB1483E122CBA82200449969 /* AdvancedPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FB1483DF22CBA82200449969 /* AdvancedPrefsViewController.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + FB1483B122CB898300449969 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FB14839822CB898300449969 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FB14839F22CB898300449969; + remoteInfo = EhautX; + }; + FB1483BC22CB898300449969 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FB14839822CB898300449969 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FB14839F22CB898300449969; + remoteInfo = EhautX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + FB1483A022CB898300449969 /* EhautX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EhautX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1483A322CB898300449969 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FB1483A522CB898300449969 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FB1483A822CB898300449969 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + FB1483AA22CB898300449969 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1483AB22CB898300449969 /* EhautX.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = EhautX.entitlements; sourceTree = ""; }; + FB1483B022CB898300449969 /* EhautXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EhautXTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1483B422CB898300449969 /* EhautXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhautXTests.swift; sourceTree = ""; }; + FB1483B622CB898300449969 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1483BB22CB898300449969 /* EhautXUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EhautXUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1483BF22CB898300449969 /* EhautXUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhautXUITests.swift; sourceTree = ""; }; + FB1483C122CB898300449969 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1483CE22CB8B9800449969 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/Mac/Alamofire.framework; sourceTree = ""; }; + FB1483CF22CB8B9800449969 /* Preferences.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Preferences.framework; path = Carthage/Build/Mac/Preferences.framework; sourceTree = ""; }; + FB1483D022CB8B9800449969 /* SwiftyUserDefaults.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyUserDefaults.framework; path = Carthage/Build/Mac/SwiftyUserDefaults.framework; sourceTree = ""; }; + FB1483D622CBA20200449969 /* GeneralPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralPrefsViewController.swift; sourceTree = ""; }; + FB1483D722CBA20200449969 /* GeneralPrefsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GeneralPrefsViewController.xib; sourceTree = ""; }; + FB1483DE22CBA82200449969 /* AdvancedPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedPrefsViewController.swift; sourceTree = ""; }; + FB1483DF22CBA82200449969 /* AdvancedPrefsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AdvancedPrefsViewController.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FB14839D22CB898300449969 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483D122CB8B9800449969 /* Alamofire.framework in Frameworks */, + FB1483D222CB8B9800449969 /* Preferences.framework in Frameworks */, + FB1483D322CB8B9800449969 /* SwiftyUserDefaults.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483AD22CB898300449969 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483B822CB898300449969 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FB14839722CB898300449969 = { + isa = PBXGroup; + children = ( + FB1483A222CB898300449969 /* EhautX */, + FB1483B322CB898300449969 /* EhautXTests */, + FB1483BE22CB898300449969 /* EhautXUITests */, + FB1483A122CB898300449969 /* Products */, + FB1483CD22CB8B9800449969 /* Frameworks */, + ); + sourceTree = ""; + }; + FB1483A122CB898300449969 /* Products */ = { + isa = PBXGroup; + children = ( + FB1483A022CB898300449969 /* EhautX.app */, + FB1483B022CB898300449969 /* EhautXTests.xctest */, + FB1483BB22CB898300449969 /* EhautXUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + FB1483A222CB898300449969 /* EhautX */ = { + isa = PBXGroup; + children = ( + FB1483D522CBA1D800449969 /* Views */, + FB1483A322CB898300449969 /* AppDelegate.swift */, + FB1483A522CB898300449969 /* Assets.xcassets */, + FB1483A722CB898300449969 /* MainMenu.xib */, + FB1483AA22CB898300449969 /* Info.plist */, + FB1483AB22CB898300449969 /* EhautX.entitlements */, + ); + path = EhautX; + sourceTree = ""; + }; + FB1483B322CB898300449969 /* EhautXTests */ = { + isa = PBXGroup; + children = ( + FB1483B422CB898300449969 /* EhautXTests.swift */, + FB1483B622CB898300449969 /* Info.plist */, + ); + path = EhautXTests; + sourceTree = ""; + }; + FB1483BE22CB898300449969 /* EhautXUITests */ = { + isa = PBXGroup; + children = ( + FB1483BF22CB898300449969 /* EhautXUITests.swift */, + FB1483C122CB898300449969 /* Info.plist */, + ); + path = EhautXUITests; + sourceTree = ""; + }; + FB1483CD22CB8B9800449969 /* Frameworks */ = { + isa = PBXGroup; + children = ( + FB1483CE22CB8B9800449969 /* Alamofire.framework */, + FB1483CF22CB8B9800449969 /* Preferences.framework */, + FB1483D022CB8B9800449969 /* SwiftyUserDefaults.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + FB1483D522CBA1D800449969 /* Views */ = { + isa = PBXGroup; + children = ( + FB1483D622CBA20200449969 /* GeneralPrefsViewController.swift */, + FB1483D722CBA20200449969 /* GeneralPrefsViewController.xib */, + FB1483DE22CBA82200449969 /* AdvancedPrefsViewController.swift */, + FB1483DF22CBA82200449969 /* AdvancedPrefsViewController.xib */, + ); + path = Views; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FB14839F22CB898300449969 /* EhautX */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1483C422CB898300449969 /* Build configuration list for PBXNativeTarget "EhautX" */; + buildPhases = ( + FB14839C22CB898300449969 /* Sources */, + FB14839D22CB898300449969 /* Frameworks */, + FB14839E22CB898300449969 /* Resources */, + FB1483D422CB8BA000449969 /* Run Script */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = EhautX; + productName = EhautX; + productReference = FB1483A022CB898300449969 /* EhautX.app */; + productType = "com.apple.product-type.application"; + }; + FB1483AF22CB898300449969 /* EhautXTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1483C722CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXTests" */; + buildPhases = ( + FB1483AC22CB898300449969 /* Sources */, + FB1483AD22CB898300449969 /* Frameworks */, + FB1483AE22CB898300449969 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FB1483B222CB898300449969 /* PBXTargetDependency */, + ); + name = EhautXTests; + productName = EhautXTests; + productReference = FB1483B022CB898300449969 /* EhautXTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + FB1483BA22CB898300449969 /* EhautXUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1483CA22CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXUITests" */; + buildPhases = ( + FB1483B722CB898300449969 /* Sources */, + FB1483B822CB898300449969 /* Frameworks */, + FB1483B922CB898300449969 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FB1483BD22CB898300449969 /* PBXTargetDependency */, + ); + name = EhautXUITests; + productName = EhautXUITests; + productReference = FB1483BB22CB898300449969 /* EhautXUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FB14839822CB898300449969 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1020; + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = "Ehaut Team"; + TargetAttributes = { + FB14839F22CB898300449969 = { + CreatedOnToolsVersion = 10.2.1; + }; + FB1483AF22CB898300449969 = { + CreatedOnToolsVersion = 10.2.1; + TestTargetID = FB14839F22CB898300449969; + }; + FB1483BA22CB898300449969 = { + CreatedOnToolsVersion = 10.2.1; + TestTargetID = FB14839F22CB898300449969; + }; + }; + }; + buildConfigurationList = FB14839B22CB898300449969 /* Build configuration list for PBXProject "EhautX" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FB14839722CB898300449969; + productRefGroup = FB1483A122CB898300449969 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FB14839F22CB898300449969 /* EhautX */, + FB1483AF22CB898300449969 /* EhautXTests */, + FB1483BA22CB898300449969 /* EhautXUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FB14839E22CB898300449969 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483D922CBA20200449969 /* GeneralPrefsViewController.xib in Resources */, + FB1483E122CBA82200449969 /* AdvancedPrefsViewController.xib in Resources */, + FB1483A622CB898300449969 /* Assets.xcassets in Resources */, + FB1483A922CB898300449969 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483AE22CB898300449969 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483B922CB898300449969 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + FB1483D422CB8BA000449969 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "$(SRCROOT)/input.xcfilelist", + ); + inputPaths = ( + ); + name = "Run Script"; + outputFileListPaths = ( + "$(SRCROOT)/output.xcfilelist", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FB14839C22CB898300449969 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483D822CBA20200449969 /* GeneralPrefsViewController.swift in Sources */, + FB1483E022CBA82200449969 /* AdvancedPrefsViewController.swift in Sources */, + FB1483A422CB898300449969 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483AC22CB898300449969 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483B522CB898300449969 /* EhautXTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483B722CB898300449969 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483C022CB898300449969 /* EhautXUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + FB1483B222CB898300449969 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FB14839F22CB898300449969 /* EhautX */; + targetProxy = FB1483B122CB898300449969 /* PBXContainerItemProxy */; + }; + FB1483BD22CB898300449969 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FB14839F22CB898300449969 /* EhautX */; + targetProxy = FB1483BC22CB898300449969 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + FB1483A722CB898300449969 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + FB1483A822CB898300449969 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FB1483C222CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FB1483C322CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + FB1483C522CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = EhautX; + CODE_SIGN_ENTITLEMENTS = EhautX/EhautX.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = EhautX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautX.macOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + FB1483C622CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = EhautX; + CODE_SIGN_ENTITLEMENTS = EhautX/EhautX.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = EhautX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautX.macOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + FB1483C822CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EhautX.app/Contents/MacOS/EhautX"; + }; + name = Debug; + }; + FB1483C922CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EhautX.app/Contents/MacOS/EhautX"; + }; + name = Release; + }; + FB1483CB22CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_TARGET_NAME = EhautX; + }; + name = Debug; + }; + FB1483CC22CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_TARGET_NAME = EhautX; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FB14839B22CB898300449969 /* Build configuration list for PBXProject "EhautX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483C222CB898300449969 /* Debug */, + FB1483C322CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1483C422CB898300449969 /* Build configuration list for PBXNativeTarget "EhautX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483C522CB898300449969 /* Debug */, + FB1483C622CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1483C722CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483C822CB898300449969 /* Debug */, + FB1483C922CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1483CA22CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483CB22CB898300449969 /* Debug */, + FB1483CC22CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FB14839822CB898300449969 /* Project object */; +} diff --git a/EhautX.macOS/EhautX.macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/EhautX.macOS/EhautX.macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..35f01f6 --- /dev/null +++ b/EhautX.macOS/EhautX.macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/EhautX.macOS/EhautX.macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/EhautX.macOS/EhautX.macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/EhautX.macOS/EhautX.macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/EhautX.macOS/EhautX/AppDelegate.swift b/EhautX.macOS/EhautX/AppDelegate.swift new file mode 100644 index 0000000..7df90f8 --- /dev/null +++ b/EhautX.macOS/EhautX/AppDelegate.swift @@ -0,0 +1,90 @@ +// +// AppDelegate.swift +// EhautX +// +// Created by EhautTeam on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import Cocoa +import Preferences +import SwiftyUserDefaults + +extension PreferencePane.Identifier { + static let general = Identifier("general") + static let advanced = Identifier("advanced") +} + +extension DefaultsKeys { + static let authServer = DefaultsKey("authServer", defaultValue: "http://172.16.154.130/cgi-bin/srun_portal") + static let msgServer = DefaultsKey("msgServer", defaultValue: "http://172.16.154.130/get_msg.php") + static let infoServer = DefaultsKey("infoServer", defaultValue: "http://172.16.154.130/cgi-bin/rad_user_info") + static let username = DefaultsKey("username") + static let password = DefaultsKey("password") + static let passwordKey = DefaultsKey("passwordKey", defaultValue: "1234567890") + + static let acid = DefaultsKey("acid", defaultValue: "1") + static let type = DefaultsKey("type", defaultValue: "10") + static let n = DefaultsKey("n", defaultValue: "117") + static let drop = DefaultsKey("drop", defaultValue: "0") + static let pop = DefaultsKey("pop", defaultValue: "1") + static let mbytes = DefaultsKey("mbytes", defaultValue: "0") + static let minutes = DefaultsKey("minutes", defaultValue: "0") + + static let only_acid = DefaultsKey("only_acid", defaultValue: false) + + static let timeout = DefaultsKey("timeout", defaultValue: 3) +} + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + @IBOutlet weak var window: NSWindow! + + let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength); + + let preferencesWindowController = PreferencesWindowController( + preferencePanes: [ + GeneralPrefsViewController(), + AdvancedPrefsViewController(), + ] + ) + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + + // Show the status icon + let button = statusItem.button + button?.image = NSImage(named: "NetworkDisconnect") + + // Build statusbar menu + let menu = NSMenu() + menu.addItem(NSMenuItem( + title: "About", + action: #selector(NSApplication.shared.orderFrontStandardAboutPanel(_:)), + keyEquivalent: "" + )) + menu.addItem(NSMenuItem.separator()) + menu.addItem(NSMenuItem( + title: "Preferences…", + action: #selector(self.preferencesMenuItemActionHandler(_:)), + keyEquivalent: "," + )) + menu.addItem(NSMenuItem.separator()) + menu.addItem(NSMenuItem( + title: "Quit", + action: #selector(NSApplication.shared.terminate(_:)), + keyEquivalent: "q" + )) + + statusItem.menu = menu + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + @IBAction func preferencesMenuItemActionHandler(_ sender: NSMenuItem) { + preferencesWindowController.show() + } +} diff --git a/EhautX.macOS/EhautX/Assets.xcassets/Contents.json b/EhautX.macOS/EhautX/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/EhautX.macOS/EhautX/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX.macOS/EhautX/Assets.xcassets/EhautX.appiconset/Contents.json b/EhautX.macOS/EhautX/Assets.xcassets/EhautX.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/EhautX.macOS/EhautX/Assets.xcassets/EhautX.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/Contents.json b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/Contents.json new file mode 100644 index 0000000..175894d --- /dev/null +++ b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/Contents.json @@ -0,0 +1,43 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "1x", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ] + }, + { + "idiom" : "universal", + "filename" : "NetworkConnect@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkConnect@dark@2x.png", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkConnect@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@2x.png b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@2x.png new file mode 100644 index 0000000..f2d4c54 Binary files /dev/null and b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@2x.png differ diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@3x.png b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@3x.png new file mode 100644 index 0000000..e4708d0 Binary files /dev/null and b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@3x.png differ diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@dark@2x.png b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@dark@2x.png new file mode 100644 index 0000000..474b93e Binary files /dev/null and b/EhautX.macOS/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@dark@2x.png differ diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/Contents.json b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/Contents.json new file mode 100644 index 0000000..2539480 --- /dev/null +++ b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/Contents.json @@ -0,0 +1,43 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "1x", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ] + }, + { + "idiom" : "universal", + "filename" : "NetworkDisconnect@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkDisconnect@dark@2x.png", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkDisconnect@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@2x.png b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@2x.png new file mode 100644 index 0000000..c702f16 Binary files /dev/null and b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@2x.png differ diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@3x.png b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@3x.png new file mode 100644 index 0000000..552cb74 Binary files /dev/null and b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@3x.png differ diff --git a/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@dark@2x.png b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@dark@2x.png new file mode 100644 index 0000000..84765fe Binary files /dev/null and b/EhautX.macOS/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@dark@2x.png differ diff --git a/EhautX.macOS/EhautX/Base.lproj/MainMenu.xib b/EhautX.macOS/EhautX/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..b3545e0 --- /dev/null +++ b/EhautX.macOS/EhautX/Base.lproj/MainMenu.xib @@ -0,0 +1,699 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX.macOS/EhautX/EhautX.entitlements b/EhautX.macOS/EhautX/EhautX.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/EhautX.macOS/EhautX/EhautX.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/EhautX/Info.plist b/EhautX.macOS/EhautX/Info.plist similarity index 60% rename from EhautX/Info.plist rename to EhautX.macOS/EhautX/Info.plist index 79b0531..86db7eb 100644 --- a/EhautX/Info.plist +++ b/EhautX.macOS/EhautX/Info.plist @@ -2,33 +2,35 @@ - CFBundleName - EhautX - CFBundleIdentifier - com.zengxs.EhautX - CFBundleVersion - 1 - LSMinimumSystemVersion - 10.12 CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + $(PRODUCT_NAME) CFBundlePackageType APPL - CFBundleSignature - ???? - NSHumanReadableCopyright - ${AuthorCopyright:HtmlEncode} - NSPrincipalClass - NSApplication - NSMainStoryboardFile - Main - XSAppIconAssets - Assets.xcassets/AppIcon.appiconset CFBundleShortVersionString - 0.2.1 + 1.0 + CFBundleVersion + 1 LSApplicationCategoryType public.app-category.utilities + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + LSUIElement + + NSHumanReadableCopyright + Copyright © 2019 Ehaut Team. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication diff --git a/EhautX.macOS/EhautX/Views/AdvancedPrefsViewController.swift b/EhautX.macOS/EhautX/Views/AdvancedPrefsViewController.swift new file mode 100644 index 0000000..52fe977 --- /dev/null +++ b/EhautX.macOS/EhautX/Views/AdvancedPrefsViewController.swift @@ -0,0 +1,83 @@ +// +// AdvancedPrefsViewController.swift +// EhautX +// +// Created by EhautTeam on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import Cocoa +import Preferences +import SwiftyUserDefaults + +class AdvancedPrefsViewController: NSViewController, PreferencePane { + let preferencePaneIdentifier = PreferencePane.Identifier.advanced + let preferencePaneTitle = "Advanced" + let toolbarItemIcon = NSImage(named: NSImage.advancedName)! + + @objc dynamic var authServer: String { + get { return Defaults[.authServer] } + set { Defaults[.authServer] = newValue } + } + + @objc dynamic var msgServer: String { + get { return Defaults[.msgServer] } + set { Defaults[.msgServer] = newValue } + } + + @objc dynamic var infoServer: String { + get { return Defaults[.infoServer] } + set { Defaults[.infoServer] = newValue } + } + + @objc dynamic var passwordKey: String { + get { return Defaults[.passwordKey] } + set { Defaults[.passwordKey] = newValue } + } + + @objc dynamic var acid: String { + get { return Defaults[.acid] } + set { Defaults[.acid] = newValue } + } + + @objc dynamic var only_acid: Bool { + get { return Defaults[.only_acid] } + set { Defaults[.only_acid] = newValue } + } + + @objc dynamic var type: String { + get { return Defaults[.type] } + set { Defaults[.type] = newValue } + } + + @objc dynamic var n: String { + get { return Defaults[.n] } + set { Defaults[.n] = newValue } + } + + @objc dynamic var drop: String { + get { return Defaults[.drop] } + set { Defaults[.drop] = newValue } + } + + @objc dynamic var pop: String { + get { return Defaults[.pop] } + set { Defaults[.pop] = newValue } + } + + @objc dynamic var mbytes: String { + get { return Defaults[.mbytes] } + set { Defaults[.mbytes] = newValue } + } + + @objc dynamic var minutes: String { + get { return Defaults[.minutes] } + set { Defaults[.minutes] = newValue } + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do view setup here. + } + +} diff --git a/EhautX.macOS/EhautX/Views/AdvancedPrefsViewController.xib b/EhautX.macOS/EhautX/Views/AdvancedPrefsViewController.xib new file mode 100644 index 0000000..11dafe6 --- /dev/null +++ b/EhautX.macOS/EhautX/Views/AdvancedPrefsViewController.xib @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX.macOS/EhautX/Views/GeneralPrefsViewController.swift b/EhautX.macOS/EhautX/Views/GeneralPrefsViewController.swift new file mode 100644 index 0000000..bd673bd --- /dev/null +++ b/EhautX.macOS/EhautX/Views/GeneralPrefsViewController.swift @@ -0,0 +1,38 @@ +// +// GeneralPrefsViewController.swift +// EhautX +// +// Created by EhautTeam on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import Cocoa +import Preferences +import SwiftyUserDefaults + +class GeneralPrefsViewController: NSViewController, PreferencePane { + let preferencePaneIdentifier = PreferencePane.Identifier.general + let preferencePaneTitle = "General" + let toolbarItemIcon = NSImage(named: NSImage.preferencesGeneralName)! + + @objc dynamic var username: String? { + get { return Defaults[.username] } + set { Defaults[.username] = newValue } + } + + @objc dynamic var password: String? { + get { return Defaults[.password] } + set { Defaults[.password] = newValue } + } + + @objc dynamic var timeout: Int { + get { return Defaults[.timeout] } + set { Defaults[.timeout] = newValue } + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do view setup here. + } + +} diff --git a/EhautX.macOS/EhautX/Views/GeneralPrefsViewController.xib b/EhautX.macOS/EhautX/Views/GeneralPrefsViewController.xib new file mode 100644 index 0000000..b0e2c3c --- /dev/null +++ b/EhautX.macOS/EhautX/Views/GeneralPrefsViewController.xib @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX.macOS/EhautXTests/EhautXTests.swift b/EhautX.macOS/EhautXTests/EhautXTests.swift new file mode 100644 index 0000000..741b546 --- /dev/null +++ b/EhautX.macOS/EhautXTests/EhautXTests.swift @@ -0,0 +1,34 @@ +// +// EhautXTests.swift +// EhautXTests +// +// Created by EhautTeam on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import XCTest +@testable import EhautX + +class EhautXTests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/EhautX.macOS/EhautXTests/Info.plist b/EhautX.macOS/EhautXTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/EhautX.macOS/EhautXTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/EhautX.macOS/EhautXUITests/EhautXUITests.swift b/EhautX.macOS/EhautXUITests/EhautXUITests.swift new file mode 100644 index 0000000..12c379c --- /dev/null +++ b/EhautX.macOS/EhautXUITests/EhautXUITests.swift @@ -0,0 +1,34 @@ +// +// EhautXUITests.swift +// EhautXUITests +// +// Created by EhautTeam on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import XCTest + +class EhautXUITests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/EhautX.macOS/EhautXUITests/Info.plist b/EhautX.macOS/EhautXUITests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/EhautX.macOS/EhautXUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/EhautX.macOS/input.xcfilelist b/EhautX.macOS/input.xcfilelist new file mode 100644 index 0000000..c8aac9f --- /dev/null +++ b/EhautX.macOS/input.xcfilelist @@ -0,0 +1,3 @@ +$(SRCROOT)/Carthage/Build/Mac/Alamofire.framework +$(SRCROOT)/Carthage/Build/Mac/Preferences.framework +$(SRCROOT)/Carthage/Build/Mac/SwiftyUserDefaults.framework diff --git a/EhautX.macOS/output.xcfilelist b/EhautX.macOS/output.xcfilelist new file mode 100644 index 0000000..e24d020 --- /dev/null +++ b/EhautX.macOS/output.xcfilelist @@ -0,0 +1,3 @@ +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Alamofire.framework +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Preferences.framework +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SwiftyUserDefaults.framework diff --git a/EhautX.sln b/EhautX.sln deleted file mode 100644 index 8822dc2..0000000 --- a/EhautX.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EhautX", "EhautX\EhautX.csproj", "{75BF3CFF-AC12-49FA-88A7-AFD4889FA758}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/EhautX.xcworkspace/contents.xcworkspacedata b/EhautX.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1737db7 --- /dev/null +++ b/EhautX.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/EhautX.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/EhautX.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/EhautX.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/EhautX/AppDelegate.cs b/EhautX/AppDelegate.cs deleted file mode 100644 index 8a42727..0000000 --- a/EhautX/AppDelegate.cs +++ /dev/null @@ -1,26 +0,0 @@ -using AppKit; -using EhautX.Model; -using Foundation; - -namespace EhautX -{ - [Register("AppDelegate")] - public class AppDelegate : NSApplicationDelegate - { - public AppPreferences Preferences { get; set; } = new AppPreferences(); - - public AppDelegate() - { - } - - public override void DidFinishLaunching(NSNotification notification) - { - // Insert code here to initialize your application - } - - public override void WillTerminate(NSNotification notification) - { - // Insert code here to tear down your application - } - } -} diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png deleted file mode 100644 index d0b5a80..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png deleted file mode 100644 index f4c8d29..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png deleted file mode 100644 index ebb5a0f..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png deleted file mode 100644 index 0986d31..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png deleted file mode 100644 index f4c8d29..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png deleted file mode 100644 index a142c83..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png deleted file mode 100644 index 0986d31..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png deleted file mode 100644 index 412d6ca..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png deleted file mode 100644 index a142c83..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png deleted file mode 100644 index e99022a..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json b/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 6b28545..0000000 --- a/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images": [ - { - "filename": "AppIcon-16.png", - "size": "16x16", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-16@2x.png", - "size": "16x16", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-32.png", - "size": "32x32", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-32@2x.png", - "size": "32x32", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-128.png", - "size": "128x128", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-128@2x.png", - "size": "128x128", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-256.png", - "size": "256x256", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-256@2x.png", - "size": "256x256", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-512.png", - "size": "512x512", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-512@2x.png", - "size": "512x512", - "scale": "2x", - "idiom": "mac" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} \ No newline at end of file diff --git a/EhautX/EhautX.csproj b/EhautX/EhautX.csproj deleted file mode 100644 index 4b7a4a9..0000000 --- a/EhautX/EhautX.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758} - {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - EhautX - EhautX - v2.0 - Xamarin.Mac - Resources - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - Mac Developer - false - false - false - true - true - - - pdbonly - true - bin\Release - prompt - 4 - false - true - false - true - true - true - SdkOnly - - - - - - - ..\packages\RestSharp.106.6.9\lib\netstandard2.0\RestSharp.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ViewController.cs - - - - - GeneralPrefsController.cs - - - - NetworkPrefsController.cs - - - - AdvancedPrefsController.cs - - - - - - - - \ No newline at end of file diff --git a/EhautX/Main.cs b/EhautX/Main.cs deleted file mode 100644 index 244b781..0000000 --- a/EhautX/Main.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AppKit; - -namespace EhautX -{ - static class MainClass - { - static void Main(string[] args) - { - NSApplication.Init(); - NSApplication.Main(args); - } - } -} diff --git a/EhautX/Main.storyboard b/EhautX/Main.storyboard deleted file mode 100644 index b4cbb5c..0000000 --- a/EhautX/Main.storyboard +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NSAllRomanInputSourcesLocaleIdentifier - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/EhautX/Model/AppPreferences.cs b/EhautX/Model/AppPreferences.cs deleted file mode 100644 index cf63b89..0000000 --- a/EhautX/Model/AppPreferences.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using Foundation; - -namespace EhautX.Model -{ - [Register("AppPreferences")] - public class AppPreferences : NSObject - { - #region Computed Properties - [Export("ServerURL")] - public string ServerURL - { - get => LoadUrl("ServerURL", "http://172.16.154.130:69/cgi-bin/srun_portal"); - set => SaveUrl("ServerURL", value, true); - } - - [Export("ACID")] - public string ACID - { - get => LoadString("ACID", "1"); - set => SaveString("ACID", value, true); - } - - [Export("Username")] - public string Username - { - get => LoadString("Username", ""); - set => SaveString("Username", value, true); - } - - [Export("Password")] - public string Password - { - get => LoadString("Password", ""); - set => SaveString("Password", value, true); - } - - [Export("PasswordKey")] - public string PasswordKey - { - get => LoadString("PasswordKey", "1234567890"); - set => SaveString("PasswordKey", value, true); - } - - [Export("Timeout")] - public int Timeout - { - get => LoadInt("Timeout", 3); - set => SaveInt("Timeout", value, true); - } - - [Export("Type")] - public string Type - { - get => LoadString("Type", "10"); - set => SaveString("Type", value, true); - } - - [Export("N")] - public string N - { - get => LoadString("N", "117"); - set => SaveString("N", value, true); - } - - [Export("Drop")] - public string Drop - { - get => LoadString("Drop", "0"); - set => SaveString("Drop", value, true); - } - - [Export("Pop")] - public string Pop - { - get => LoadString("Pop", "1"); - set => SaveString("Pop", value, true); - } - - [Export("MBytes")] - public string MBytes - { - get => LoadString("MBytes", "0"); - set => SaveString("MBytes", value, true); - } - - [Export("Minutes")] - public string Minutes - { - get => LoadString("Minutes", "0"); - set => SaveString("Minutes", value, true); - } - #endregion - - private bool ExistKey(string key) - { - var dict = NSUserDefaults.StandardUserDefaults.ToDictionary(); - return dict.ContainsKey(new NSString(key)); - } - - #region Load & Save preference - private int LoadInt(string key, int defaultValue) - { - if (!ExistKey(key)) return defaultValue; - return (int)NSUserDefaults.StandardUserDefaults.IntForKey(key); - } - - private void SaveInt(string key, int value, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetInt(value, key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - - private bool LoadBool(string key, bool defaultValue) - { - if (!ExistKey(key)) return defaultValue; - return NSUserDefaults.StandardUserDefaults.BoolForKey(key); - } - - private void SaveBool(string key, bool value, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetBool(value, key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - - private string LoadUrl(string key, string defaultUrl) - { - NSUrl url = NSUserDefaults.StandardUserDefaults.URLForKey(key); - if (!ExistKey(key) || url == null) return defaultUrl; - return url.ToString(); - } - - private void SaveUrl(string key, string urlString, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetURL(new NSUrl(urlString), key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - - private string LoadString(string key, string defaultString) - { - if (!ExistKey(key)) return defaultString; - return NSUserDefaults.StandardUserDefaults.StringForKey(key); - } - - private void SaveString(string key, string value, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetString(value, key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - #endregion - } -} diff --git a/EhautX/Resources/.gitkeep b/EhautX/Resources/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/EhautX/Service/Crypto.cs b/EhautX/Service/Crypto.cs deleted file mode 100644 index b6c3318..0000000 --- a/EhautX/Service/Crypto.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Text; - -namespace EhautX.Service -{ - public static class Crypto - { - public static string UsernameEncrypt(string username) - { - var sb = new StringBuilder(); - sb.Append("{SRUN3}\r\n"); - - for (int i = 0; i < username.Length; ++i) - sb.Append((char)(username[i] + 4)); - - return sb.ToString(); - } - - public static string PasswordEncrypt(string password, string passwordKey) - { - var sb = new StringBuilder(); - - for (int i = 0; i < password.Length; ++i) - { - char ki = (char)(password[i] ^ passwordKey[passwordKey.Length - i % passwordKey.Length - 1]); - char _l = (char)((ki & 0x0f) + 0x36); - char _h = (char)((ki >> 4 & 0x0f) + 0x63); - if (i % 2 == 0) - sb.Append($"{_l}{_h}"); - else - sb.Append($"{_h}{_l}"); - } - - return sb.ToString(); - } - } -} diff --git a/EhautX/Service/Notify.cs b/EhautX/Service/Notify.cs deleted file mode 100644 index dd03203..0000000 --- a/EhautX/Service/Notify.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using Foundation; - -namespace EhautX.Service -{ - public static class Notify - { - public static void Send(string title, string content) - { - var notification = new NSUserNotification(); - notification.Title = title; - notification.InformativeText = content; - NSUserNotificationCenter.DefaultUserNotificationCenter.ShouldPresentNotification = (center, notify) => true; - NSUserNotificationCenter.DefaultUserNotificationCenter.ScheduleNotification(notification); - } - } -} diff --git a/EhautX/View/AdvancedPrefsController.cs b/EhautX/View/AdvancedPrefsController.cs deleted file mode 100644 index 53943a6..0000000 --- a/EhautX/View/AdvancedPrefsController.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been autogenerated from a class added in the UI designer. - -using System; - -using Foundation; -using AppKit; -using EhautX.Model; - -namespace EhautX.View -{ - public partial class AdvancedPrefsController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - public AdvancedPrefsController(IntPtr handle) : base(handle) - { - } - } -} diff --git a/EhautX/View/AdvancedPrefsController.designer.cs b/EhautX/View/AdvancedPrefsController.designer.cs deleted file mode 100644 index de14095..0000000 --- a/EhautX/View/AdvancedPrefsController.designer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("AdvancedPrefsController")] - partial class AdvancedPrefsController - { - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/View/GeneralPrefsController.cs b/EhautX/View/GeneralPrefsController.cs deleted file mode 100644 index a0d9ace..0000000 --- a/EhautX/View/GeneralPrefsController.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been autogenerated from a class added in the UI designer. - -using System; - -using Foundation; -using AppKit; -using EhautX.Model; - -namespace EhautX.View -{ - public partial class GeneralPrefsController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - public GeneralPrefsController(IntPtr handle) : base(handle) - { - } - } -} diff --git a/EhautX/View/GeneralPrefsController.designer.cs b/EhautX/View/GeneralPrefsController.designer.cs deleted file mode 100644 index 4aecd0e..0000000 --- a/EhautX/View/GeneralPrefsController.designer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("GeneralPrefsController")] - partial class GeneralPrefsController - { - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/View/NetworkPrefsController.cs b/EhautX/View/NetworkPrefsController.cs deleted file mode 100644 index a1d7510..0000000 --- a/EhautX/View/NetworkPrefsController.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been autogenerated from a class added in the UI designer. - -using System; -using AppKit; -using EhautX.Model; -using Foundation; - -namespace EhautX.View -{ - public partial class NetworkPrefsController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - public NetworkPrefsController (IntPtr handle) : base (handle) - { - } - } -} diff --git a/EhautX/View/NetworkPrefsController.designer.cs b/EhautX/View/NetworkPrefsController.designer.cs deleted file mode 100644 index dcc6e71..0000000 --- a/EhautX/View/NetworkPrefsController.designer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("NetworkPrefsController")] - partial class NetworkPrefsController - { - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/View/ViewController.cs b/EhautX/View/ViewController.cs deleted file mode 100644 index 89f8c2c..0000000 --- a/EhautX/View/ViewController.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; - -using AppKit; -using CoreFoundation; -using EhautX.Model; -using EhautX.Service; -using Foundation; - -namespace EhautX.View -{ - public partial class ViewController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - #region Consturctors - public ViewController(IntPtr handle) : base(handle) - { - } - #endregion - - #region Override Methods - public override void ViewDidLoad() - { - base.ViewDidLoad(); - - // Do any additional setup after loading the view. - } - - public override NSObject RepresentedObject - { - get - { - return base.RepresentedObject; - } - set - { - base.RepresentedObject = value; - // Update the view, if already loaded. - } - } - #endregion - - #region Button clicked action - partial void loginButton(NSObject sender) - { - DispatchQueue.MainQueue.DispatchAsync(() => - { - var username = Crypto.UsernameEncrypt(Preferences.Username); - var password = Crypto.PasswordEncrypt(Preferences.Password, Preferences.PasswordKey); - - var client = new RestSharp.RestClient(); - var request = new RestSharp.RestRequest(Preferences.ServerURL, RestSharp.Method.POST); - request.AddParameter("action", "login"); - request.AddParameter("username", username); - request.AddParameter("password", password); - request.AddParameter("drop", Preferences.Drop); - request.AddParameter("pop", Preferences.Pop); - request.AddParameter("type", Preferences.Type); - request.AddParameter("n", Preferences.N); - request.AddParameter("mbytes", Preferences.MBytes); - request.AddParameter("ac_id", Preferences.ACID); - request.AddParameter("mac", "02:00:00:00:00:00"); - request.Timeout = Preferences.Timeout * 1000; - - var response = client.Execute(request); - switch (response.ResponseStatus) - { - case RestSharp.ResponseStatus.TimedOut: - Notify.Send("连接错误", "连接超时"); - break; - case RestSharp.ResponseStatus.Error: - Notify.Send("连接错误", "连接错误"); - break; - default: - Notify.Send("登录状态", response.Content); - break; - } - }); - } - - partial void logoutButton(NSObject sender) - { - DispatchQueue.MainQueue.DispatchAsync(() => - { - var username = Crypto.UsernameEncrypt(Preferences.Username); - - var client = new RestSharp.RestClient(); - var request = new RestSharp.RestRequest(Preferences.ServerURL, RestSharp.Method.POST); - request.AddParameter("action", "logout"); - request.AddParameter("username", username); - request.AddParameter("type", Preferences.Type); - request.AddParameter("ac_id", Preferences.ACID); - request.AddParameter("mac", "02:00:00:00:00:00"); - request.Timeout = Preferences.Timeout * 1000; - - var response = client.Execute(request); - - switch (response.ResponseStatus) - { - case RestSharp.ResponseStatus.TimedOut: - Notify.Send("连接错误", "连接超时"); - break; - case RestSharp.ResponseStatus.Error: - Notify.Send("连接错误", "连接错误"); - break; - default: - Notify.Send("登出状态", response.Content); - break; - } - }); - } - #endregion - } -} diff --git a/EhautX/View/ViewController.designer.cs b/EhautX/View/ViewController.designer.cs deleted file mode 100644 index 3fd1daf..0000000 --- a/EhautX/View/ViewController.designer.cs +++ /dev/null @@ -1,25 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("ViewController")] - partial class ViewController - { - [Action ("loginButton:")] - partial void loginButton (Foundation.NSObject sender); - - [Action ("logoutButton:")] - partial void logoutButton (Foundation.NSObject sender); - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/packages.config b/EhautX/packages.config deleted file mode 100644 index e61aa0f..0000000 --- a/EhautX/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/README.md b/README.md index 6088d47..1eb6cce 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,30 @@ A easy client for haut campus network. ## Screenshot -![screenshot1](https://i.imgur.com/C49BUtI.png) + +## Developing +### Install Carthage +```sh +brew install carthage +``` + +### Checkout dependencies +```sh +git submodule update --init --recursive +``` + +### Build dependencies +#### For iOS +```sh +cd EhautX.iOS +carthage build --platform iOS +``` + +#### For macOS +```sh +cd EhautX.macOS +carthage build --platform macOS +``` ## Contributing PR are welcome.