Skip to content

Commit 1aaa6fd

Browse files
author
Arror
committed
Init project
1 parent 9b7e18b commit 1aaa6fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2583
-2
lines changed

.gitignore

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/swift,xcode,swiftpackagemanager
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=swift,xcode,swiftpackagemanager
4+
5+
### Swift ###
6+
# Xcode
7+
#
8+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
9+
10+
## User settings
11+
xcuserdata/
12+
13+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
14+
*.xcscmblueprint
15+
*.xccheckout
16+
17+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
18+
build/
19+
DerivedData/
20+
*.moved-aside
21+
*.pbxuser
22+
!default.pbxuser
23+
*.mode1v3
24+
!default.mode1v3
25+
*.mode2v3
26+
!default.mode2v3
27+
*.perspectivev3
28+
!default.perspectivev3
29+
30+
## Obj-C/Swift specific
31+
*.hmap
32+
33+
## App packaging
34+
*.ipa
35+
*.dSYM.zip
36+
*.dSYM
37+
38+
## Playgrounds
39+
timeline.xctimeline
40+
playground.xcworkspace
41+
42+
# Swift Package Manager
43+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
44+
# Packages/
45+
# Package.pins
46+
# Package.resolved
47+
# *.xcodeproj
48+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
49+
# hence it is not needed unless you have added a package configuration file to your project
50+
# .swiftpm
51+
52+
.build/
53+
54+
# CocoaPods
55+
# We recommend against adding the Pods directory to your .gitignore. However
56+
# you should judge for yourself, the pros and cons are mentioned at:
57+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
58+
# Pods/
59+
# Add this line if you want to avoid checking in source code from the Xcode workspace
60+
# *.xcworkspace
61+
62+
# Carthage
63+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
64+
# Carthage/Checkouts
65+
66+
Carthage/Build/
67+
68+
# Accio dependency management
69+
Dependencies/
70+
.accio/
71+
72+
# fastlane
73+
# It is recommended to not store the screenshots in the git repo.
74+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
75+
# For more information about the recommended setup visit:
76+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
77+
78+
fastlane/report.xml
79+
fastlane/Preview.html
80+
fastlane/screenshots/**/*.png
81+
fastlane/test_output
82+
83+
# Code Injection
84+
# After new code Injection tools there's a generated folder /iOSInjectionProject
85+
# https://github.com/johnno1962/injectionforxcode
86+
87+
iOSInjectionProject/
88+
89+
90+
### Xcode ###
91+
92+
## Xcode 8 and earlier
93+
94+
### Xcode Patch ###
95+
*.xcodeproj/*
96+
!*.xcodeproj/project.pbxproj
97+
!*.xcodeproj/xcshareddata/
98+
!*.xcworkspace/contents.xcworkspacedata
99+
/*.gcno
100+
**/xcshareddata/WorkspaceSettings.xcsettings
101+
102+
**/ClashKit.xcframework
103+
104+
# End of https://www.toptal.com/developers/gitignore/api/swift,xcode,swiftpackagemanager

Clash.xcodeproj/project.pbxproj

+886
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1320"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "D9ACEEFA2797F45F0004E32D"
18+
BuildableName = "Clash.app"
19+
BlueprintName = "Clash"
20+
ReferencedContainer = "container:Clash.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "D9ACEEFA2797F45F0004E32D"
48+
BuildableName = "Clash.app"
49+
BlueprintName = "Clash"
50+
ReferencedContainer = "container:Clash.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "D9ACEEFA2797F45F0004E32D"
65+
BuildableName = "Clash.app"
66+
BlueprintName = "Clash"
67+
ReferencedContainer = "container:Clash.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</ProfileAction>
71+
<AnalyzeAction
72+
buildConfiguration = "Debug">
73+
</AnalyzeAction>
74+
<ArchiveAction
75+
buildConfiguration = "Release"
76+
revealArchiveInOrganizer = "YES">
77+
</ArchiveAction>
78+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1320"
4+
wasCreatedForAppExtension = "YES"
5+
version = "2.0">
6+
<BuildAction
7+
parallelizeBuildables = "YES"
8+
buildImplicitDependencies = "YES">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "D9ACEF1A2797FD4B0004E32D"
19+
BuildableName = "PacketTunnel.appex"
20+
BlueprintName = "PacketTunnel"
21+
ReferencedContainer = "container:Clash.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
<BuildActionEntry
25+
buildForTesting = "YES"
26+
buildForRunning = "YES"
27+
buildForProfiling = "YES"
28+
buildForArchiving = "YES"
29+
buildForAnalyzing = "YES">
30+
<BuildableReference
31+
BuildableIdentifier = "primary"
32+
BlueprintIdentifier = "D9ACEEFA2797F45F0004E32D"
33+
BuildableName = "Clash.app"
34+
BlueprintName = "Clash"
35+
ReferencedContainer = "container:Clash.xcodeproj">
36+
</BuildableReference>
37+
</BuildActionEntry>
38+
</BuildActionEntries>
39+
</BuildAction>
40+
<TestAction
41+
buildConfiguration = "Debug"
42+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
43+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
44+
shouldUseLaunchSchemeArgsEnv = "YES">
45+
<Testables>
46+
</Testables>
47+
</TestAction>
48+
<LaunchAction
49+
buildConfiguration = "Debug"
50+
selectedDebuggerIdentifier = ""
51+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
52+
launchStyle = "0"
53+
askForAppToLaunch = "Yes"
54+
useCustomWorkingDirectory = "NO"
55+
ignoresPersistentStateOnLaunch = "NO"
56+
debugDocumentVersioning = "YES"
57+
debugServiceExtension = "internal"
58+
allowLocationSimulation = "YES"
59+
launchAutomaticallySubstyle = "2">
60+
<BuildableProductRunnable
61+
runnableDebuggingMode = "0">
62+
<BuildableReference
63+
BuildableIdentifier = "primary"
64+
BlueprintIdentifier = "D9ACEEFA2797F45F0004E32D"
65+
BuildableName = "Clash.app"
66+
BlueprintName = "Clash"
67+
ReferencedContainer = "container:Clash.xcodeproj">
68+
</BuildableReference>
69+
</BuildableProductRunnable>
70+
</LaunchAction>
71+
<ProfileAction
72+
buildConfiguration = "Release"
73+
shouldUseLaunchSchemeArgsEnv = "YES"
74+
savedToolIdentifier = ""
75+
useCustomWorkingDirectory = "NO"
76+
debugDocumentVersioning = "YES"
77+
askForAppToLaunch = "Yes"
78+
launchAutomaticallySubstyle = "2">
79+
<BuildableProductRunnable
80+
runnableDebuggingMode = "0">
81+
<BuildableReference
82+
BuildableIdentifier = "primary"
83+
BlueprintIdentifier = "D9ACEEFA2797F45F0004E32D"
84+
BuildableName = "Clash.app"
85+
BlueprintName = "Clash"
86+
ReferencedContainer = "container:Clash.xcodeproj">
87+
</BuildableReference>
88+
</BuildableProductRunnable>
89+
</ProfileAction>
90+
<AnalyzeAction
91+
buildConfiguration = "Debug">
92+
</AnalyzeAction>
93+
<ArchiveAction
94+
buildConfiguration = "Release"
95+
revealArchiveInOrganizer = "YES">
96+
</ArchiveAction>
97+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1320"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "D9ACEF2D2797FDBA0004E32D"
18+
BuildableName = "ShareLib.framework"
19+
BlueprintName = "ShareLib"
20+
ReferencedContainer = "container:Clash.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
</LaunchAction>
44+
<ProfileAction
45+
buildConfiguration = "Release"
46+
shouldUseLaunchSchemeArgsEnv = "YES"
47+
savedToolIdentifier = ""
48+
useCustomWorkingDirectory = "NO"
49+
debugDocumentVersioning = "YES">
50+
<MacroExpansion>
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "D9ACEF2D2797FDBA0004E32D"
54+
BuildableName = "ShareLib.framework"
55+
BlueprintName = "ShareLib"
56+
ReferencedContainer = "container:Clash.xcodeproj">
57+
</BuildableReference>
58+
</MacroExpansion>
59+
</ProfileAction>
60+
<AnalyzeAction
61+
buildConfiguration = "Debug">
62+
</AnalyzeAction>
63+
<ArchiveAction
64+
buildConfiguration = "Release"
65+
revealArchiveInOrganizer = "YES">
66+
</ArchiveAction>
67+
</Scheme>

Clash/AppDelegate.swift

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import UIKit
2+
import CommonKit
3+
4+
public final class AppDelegate: NSObject, UIApplicationDelegate {
5+
6+
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
7+
8+
self.copyCountryDB()
9+
10+
return true
11+
}
12+
13+
private func copyCountryDB() {
14+
let dbFileName = "Country"
15+
let dbFileExtension = "mmdb"
16+
let dbURL = Constant.homeDirectoryURL.appendingPathComponent("\(dbFileName).\(dbFileExtension)")
17+
guard !FileManager.default.fileExists(atPath: dbURL.path) else {
18+
return
19+
}
20+
guard let local = Bundle.main.url(forResource: dbFileName, withExtension: dbFileExtension) else {
21+
return
22+
}
23+
do {
24+
try FileManager.default.copyItem(at: local, to: dbURL)
25+
} catch {
26+
debugPrint(error.localizedDescription)
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)