├── .gitignore
├── HGPGY
├── ExportOptions.plist
├── HGPGY.xcodeproj
│ └── project.pbxproj
├── HGPGY
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── Podfile
└── UploadPackage2PGY.sh
├── LICENSE
├── README.md
└── signAndPackage
├── sign.py
└── signAndPackage.command
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | # CocoaPods
32 | #
33 | # We recommend against adding the Pods directory to your .gitignore. However
34 | # you should judge for yourself, the pros and cons are mentioned at:
35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36 | #
37 | # Pods/
38 |
39 | # Carthage
40 | #
41 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
42 | # Carthage/Checkouts
43 |
44 | Carthage/Build
45 |
46 | # fastlane
47 | #
48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49 | # screenshots whenever they are needed.
50 | # For more information about the recommended setup visit:
51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
52 |
53 | fastlane/report.xml
54 | fastlane/Preview.html
55 | fastlane/screenshots
56 | fastlane/test_output
57 |
58 | # Code Injection
59 | #
60 | # After new code Injection tools there's a generated folder /iOSInjectionProject
61 | # https://github.com/johnno1962/injectionforxcode
62 |
63 | iOSInjectionProject/
64 |
--------------------------------------------------------------------------------
/HGPGY/ExportOptions.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | compileBitcode
6 |
7 | method
8 | ad-hoc
9 | signingStyle
10 | automatic
11 | stripSwiftSymbols
12 |
13 | teamID
14 | D8Y5E9ZUX3
15 | thinning
16 | <none>
17 |
18 |
19 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 51BF7F7320525274006706D0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 51BF7F7220525274006706D0 /* AppDelegate.m */; };
11 | 51BF7F7620525274006706D0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 51BF7F7520525274006706D0 /* ViewController.m */; };
12 | 51BF7F7920525274006706D0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 51BF7F7720525274006706D0 /* Main.storyboard */; };
13 | 51BF7F7B20525274006706D0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 51BF7F7A20525274006706D0 /* Assets.xcassets */; };
14 | 51BF7F7E20525274006706D0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 51BF7F7C20525274006706D0 /* LaunchScreen.storyboard */; };
15 | 51BF7F8120525274006706D0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 51BF7F8020525274006706D0 /* main.m */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXFileReference section */
19 | 5187CA48211C24E700408817 /* UploadPackage2PGY.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = UploadPackage2PGY.sh; sourceTree = SOURCE_ROOT; };
20 | 51BF7F6E20525274006706D0 /* HGPGY.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HGPGY.app; sourceTree = BUILT_PRODUCTS_DIR; };
21 | 51BF7F7120525274006706D0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
22 | 51BF7F7220525274006706D0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
23 | 51BF7F7420525274006706D0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
24 | 51BF7F7520525274006706D0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
25 | 51BF7F7820525274006706D0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
26 | 51BF7F7A20525274006706D0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
27 | 51BF7F7D20525274006706D0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
28 | 51BF7F7F20525274006706D0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
29 | 51BF7F8020525274006706D0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
30 | /* End PBXFileReference section */
31 |
32 | /* Begin PBXFrameworksBuildPhase section */
33 | 51BF7F6B20525274006706D0 /* Frameworks */ = {
34 | isa = PBXFrameworksBuildPhase;
35 | buildActionMask = 2147483647;
36 | files = (
37 | );
38 | runOnlyForDeploymentPostprocessing = 0;
39 | };
40 | /* End PBXFrameworksBuildPhase section */
41 |
42 | /* Begin PBXGroup section */
43 | 51BF7F6520525274006706D0 = {
44 | isa = PBXGroup;
45 | children = (
46 | 51BF7F7020525274006706D0 /* HGPGY */,
47 | 51BF7F6F20525274006706D0 /* Products */,
48 | );
49 | sourceTree = "";
50 | };
51 | 51BF7F6F20525274006706D0 /* Products */ = {
52 | isa = PBXGroup;
53 | children = (
54 | 51BF7F6E20525274006706D0 /* HGPGY.app */,
55 | );
56 | name = Products;
57 | sourceTree = "";
58 | };
59 | 51BF7F7020525274006706D0 /* HGPGY */ = {
60 | isa = PBXGroup;
61 | children = (
62 | 5187CA48211C24E700408817 /* UploadPackage2PGY.sh */,
63 | 51BF7F7120525274006706D0 /* AppDelegate.h */,
64 | 51BF7F7220525274006706D0 /* AppDelegate.m */,
65 | 51BF7F7420525274006706D0 /* ViewController.h */,
66 | 51BF7F7520525274006706D0 /* ViewController.m */,
67 | 51BF7F7720525274006706D0 /* Main.storyboard */,
68 | 51BF7F7A20525274006706D0 /* Assets.xcassets */,
69 | 51BF7F7C20525274006706D0 /* LaunchScreen.storyboard */,
70 | 51BF7F7F20525274006706D0 /* Info.plist */,
71 | 51BF7F8020525274006706D0 /* main.m */,
72 | );
73 | path = HGPGY;
74 | sourceTree = "";
75 | };
76 | /* End PBXGroup section */
77 |
78 | /* Begin PBXNativeTarget section */
79 | 51BF7F6D20525274006706D0 /* HGPGY */ = {
80 | isa = PBXNativeTarget;
81 | buildConfigurationList = 51BF7F8420525274006706D0 /* Build configuration list for PBXNativeTarget "HGPGY" */;
82 | buildPhases = (
83 | 51BF7F6A20525274006706D0 /* Sources */,
84 | 51BF7F6B20525274006706D0 /* Frameworks */,
85 | 51BF7F6C20525274006706D0 /* Resources */,
86 | );
87 | buildRules = (
88 | );
89 | dependencies = (
90 | );
91 | name = HGPGY;
92 | productName = HGPGY;
93 | productReference = 51BF7F6E20525274006706D0 /* HGPGY.app */;
94 | productType = "com.apple.product-type.application";
95 | };
96 | /* End PBXNativeTarget section */
97 |
98 | /* Begin PBXProject section */
99 | 51BF7F6620525274006706D0 /* Project object */ = {
100 | isa = PBXProject;
101 | attributes = {
102 | LastUpgradeCheck = 0920;
103 | ORGANIZATIONNAME = CoderHG;
104 | TargetAttributes = {
105 | 51BF7F6D20525274006706D0 = {
106 | CreatedOnToolsVersion = 9.2;
107 | ProvisioningStyle = Automatic;
108 | };
109 | };
110 | };
111 | buildConfigurationList = 51BF7F6920525274006706D0 /* Build configuration list for PBXProject "HGPGY" */;
112 | compatibilityVersion = "Xcode 8.0";
113 | developmentRegion = en;
114 | hasScannedForEncodings = 0;
115 | knownRegions = (
116 | en,
117 | Base,
118 | );
119 | mainGroup = 51BF7F6520525274006706D0;
120 | productRefGroup = 51BF7F6F20525274006706D0 /* Products */;
121 | projectDirPath = "";
122 | projectRoot = "";
123 | targets = (
124 | 51BF7F6D20525274006706D0 /* HGPGY */,
125 | );
126 | };
127 | /* End PBXProject section */
128 |
129 | /* Begin PBXResourcesBuildPhase section */
130 | 51BF7F6C20525274006706D0 /* Resources */ = {
131 | isa = PBXResourcesBuildPhase;
132 | buildActionMask = 2147483647;
133 | files = (
134 | 51BF7F7E20525274006706D0 /* LaunchScreen.storyboard in Resources */,
135 | 51BF7F7B20525274006706D0 /* Assets.xcassets in Resources */,
136 | 51BF7F7920525274006706D0 /* Main.storyboard in Resources */,
137 | );
138 | runOnlyForDeploymentPostprocessing = 0;
139 | };
140 | /* End PBXResourcesBuildPhase section */
141 |
142 | /* Begin PBXSourcesBuildPhase section */
143 | 51BF7F6A20525274006706D0 /* Sources */ = {
144 | isa = PBXSourcesBuildPhase;
145 | buildActionMask = 2147483647;
146 | files = (
147 | 51BF7F7620525274006706D0 /* ViewController.m in Sources */,
148 | 51BF7F8120525274006706D0 /* main.m in Sources */,
149 | 51BF7F7320525274006706D0 /* AppDelegate.m in Sources */,
150 | );
151 | runOnlyForDeploymentPostprocessing = 0;
152 | };
153 | /* End PBXSourcesBuildPhase section */
154 |
155 | /* Begin PBXVariantGroup section */
156 | 51BF7F7720525274006706D0 /* Main.storyboard */ = {
157 | isa = PBXVariantGroup;
158 | children = (
159 | 51BF7F7820525274006706D0 /* Base */,
160 | );
161 | name = Main.storyboard;
162 | sourceTree = "";
163 | };
164 | 51BF7F7C20525274006706D0 /* LaunchScreen.storyboard */ = {
165 | isa = PBXVariantGroup;
166 | children = (
167 | 51BF7F7D20525274006706D0 /* Base */,
168 | );
169 | name = LaunchScreen.storyboard;
170 | sourceTree = "";
171 | };
172 | /* End PBXVariantGroup section */
173 |
174 | /* Begin XCBuildConfiguration section */
175 | 51BF7F8220525274006706D0 /* Debug */ = {
176 | isa = XCBuildConfiguration;
177 | buildSettings = {
178 | ALWAYS_SEARCH_USER_PATHS = NO;
179 | CLANG_ANALYZER_NONNULL = YES;
180 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
181 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
182 | CLANG_CXX_LIBRARY = "libc++";
183 | CLANG_ENABLE_MODULES = YES;
184 | CLANG_ENABLE_OBJC_ARC = YES;
185 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
186 | CLANG_WARN_BOOL_CONVERSION = YES;
187 | CLANG_WARN_COMMA = YES;
188 | CLANG_WARN_CONSTANT_CONVERSION = YES;
189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
190 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
191 | CLANG_WARN_EMPTY_BODY = YES;
192 | CLANG_WARN_ENUM_CONVERSION = YES;
193 | CLANG_WARN_INFINITE_RECURSION = YES;
194 | CLANG_WARN_INT_CONVERSION = YES;
195 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
196 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
197 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
198 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
199 | CLANG_WARN_STRICT_PROTOTYPES = YES;
200 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
201 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
202 | CLANG_WARN_UNREACHABLE_CODE = YES;
203 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
204 | CODE_SIGN_IDENTITY = "iPhone Developer";
205 | COPY_PHASE_STRIP = NO;
206 | DEBUG_INFORMATION_FORMAT = dwarf;
207 | ENABLE_STRICT_OBJC_MSGSEND = YES;
208 | ENABLE_TESTABILITY = YES;
209 | GCC_C_LANGUAGE_STANDARD = gnu11;
210 | GCC_DYNAMIC_NO_PIC = NO;
211 | GCC_NO_COMMON_BLOCKS = YES;
212 | GCC_OPTIMIZATION_LEVEL = 0;
213 | GCC_PREPROCESSOR_DEFINITIONS = (
214 | "DEBUG=1",
215 | "$(inherited)",
216 | );
217 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
218 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
219 | GCC_WARN_UNDECLARED_SELECTOR = YES;
220 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
221 | GCC_WARN_UNUSED_FUNCTION = YES;
222 | GCC_WARN_UNUSED_VARIABLE = YES;
223 | IPHONEOS_DEPLOYMENT_TARGET = 11.2;
224 | MTL_ENABLE_DEBUG_INFO = YES;
225 | ONLY_ACTIVE_ARCH = YES;
226 | SDKROOT = iphoneos;
227 | };
228 | name = Debug;
229 | };
230 | 51BF7F8320525274006706D0 /* Release */ = {
231 | isa = XCBuildConfiguration;
232 | buildSettings = {
233 | ALWAYS_SEARCH_USER_PATHS = NO;
234 | CLANG_ANALYZER_NONNULL = YES;
235 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
236 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
237 | CLANG_CXX_LIBRARY = "libc++";
238 | CLANG_ENABLE_MODULES = YES;
239 | CLANG_ENABLE_OBJC_ARC = YES;
240 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
241 | CLANG_WARN_BOOL_CONVERSION = YES;
242 | CLANG_WARN_COMMA = YES;
243 | CLANG_WARN_CONSTANT_CONVERSION = YES;
244 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
245 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
246 | CLANG_WARN_EMPTY_BODY = YES;
247 | CLANG_WARN_ENUM_CONVERSION = YES;
248 | CLANG_WARN_INFINITE_RECURSION = YES;
249 | CLANG_WARN_INT_CONVERSION = YES;
250 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
251 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
253 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
254 | CLANG_WARN_STRICT_PROTOTYPES = YES;
255 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
256 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
257 | CLANG_WARN_UNREACHABLE_CODE = YES;
258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
259 | CODE_SIGN_IDENTITY = "iPhone Developer";
260 | COPY_PHASE_STRIP = NO;
261 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
262 | ENABLE_NS_ASSERTIONS = NO;
263 | ENABLE_STRICT_OBJC_MSGSEND = YES;
264 | GCC_C_LANGUAGE_STANDARD = gnu11;
265 | GCC_NO_COMMON_BLOCKS = YES;
266 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
267 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
268 | GCC_WARN_UNDECLARED_SELECTOR = YES;
269 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
270 | GCC_WARN_UNUSED_FUNCTION = YES;
271 | GCC_WARN_UNUSED_VARIABLE = YES;
272 | IPHONEOS_DEPLOYMENT_TARGET = 11.2;
273 | MTL_ENABLE_DEBUG_INFO = NO;
274 | SDKROOT = iphoneos;
275 | VALIDATE_PRODUCT = YES;
276 | };
277 | name = Release;
278 | };
279 | 51BF7F8520525274006706D0 /* Debug */ = {
280 | isa = XCBuildConfiguration;
281 | buildSettings = {
282 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
283 | CODE_SIGN_STYLE = Automatic;
284 | DEVELOPMENT_TEAM = D8Y5E9ZUX3;
285 | INFOPLIST_FILE = HGPGY/Info.plist;
286 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
287 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
288 | PRODUCT_BUNDLE_IDENTIFIER = com.CoderHG.HGPGY;
289 | PRODUCT_NAME = "$(TARGET_NAME)";
290 | TARGETED_DEVICE_FAMILY = "1,2";
291 | };
292 | name = Debug;
293 | };
294 | 51BF7F8620525274006706D0 /* Release */ = {
295 | isa = XCBuildConfiguration;
296 | buildSettings = {
297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
298 | CODE_SIGN_STYLE = Automatic;
299 | DEVELOPMENT_TEAM = D8Y5E9ZUX3;
300 | INFOPLIST_FILE = HGPGY/Info.plist;
301 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
302 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
303 | PRODUCT_BUNDLE_IDENTIFIER = com.CoderHG.HGPGY;
304 | PRODUCT_NAME = "$(TARGET_NAME)";
305 | TARGETED_DEVICE_FAMILY = "1,2";
306 | };
307 | name = Release;
308 | };
309 | /* End XCBuildConfiguration section */
310 |
311 | /* Begin XCConfigurationList section */
312 | 51BF7F6920525274006706D0 /* Build configuration list for PBXProject "HGPGY" */ = {
313 | isa = XCConfigurationList;
314 | buildConfigurations = (
315 | 51BF7F8220525274006706D0 /* Debug */,
316 | 51BF7F8320525274006706D0 /* Release */,
317 | );
318 | defaultConfigurationIsVisible = 0;
319 | defaultConfigurationName = Release;
320 | };
321 | 51BF7F8420525274006706D0 /* Build configuration list for PBXNativeTarget "HGPGY" */ = {
322 | isa = XCConfigurationList;
323 | buildConfigurations = (
324 | 51BF7F8520525274006706D0 /* Debug */,
325 | 51BF7F8620525274006706D0 /* Release */,
326 | );
327 | defaultConfigurationIsVisible = 0;
328 | defaultConfigurationName = Release;
329 | };
330 | /* End XCConfigurationList section */
331 | };
332 | rootObject = 51BF7F6620525274006706D0 /* Project object */;
333 | }
334 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // HGPGY
4 | //
5 | // Created by ZhuHong on 2018/3/9.
6 | // Copyright © 2018年 CoderHG. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // HGPGY
4 | //
5 | // Created by ZhuHong on 2018/3/9.
6 | // Copyright © 2018年 CoderHG. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // 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.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // 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.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // 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.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // 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.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/HGPGY/HGPGY/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.2.0
19 | CFBundleVersion
20 | 20180809163743
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // HGPGY
4 | //
5 | // Created by ZhuHong on 2018/3/9.
6 | // Copyright © 2018年 CoderHG. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // HGPGY
4 | //
5 | // Created by ZhuHong on 2018/3/9.
6 | // Copyright © 2018年 CoderHG. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 |
21 | self.view.backgroundColor = [UIColor redColor];
22 | }
23 |
24 |
25 | - (void)didReceiveMemoryWarning {
26 | [super didReceiveMemoryWarning];
27 | // Dispose of any resources that can be recreated.
28 | }
29 |
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/HGPGY/HGPGY/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // HGPGY
4 | //
5 | // Created by ZhuHong on 2018/3/9.
6 | // Copyright © 2018年 CoderHG. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/HGPGY/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # 公有的 Specs 地址
5 | source 'https://github.com/CocoaPods/Specs.git'
6 | # 私有的 Specs 地址
7 | source 'https://github.com/GitHubZHH/HGSpecs.git'
8 |
9 | target 'HGPGY' do
10 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
11 | # use_frameworks!
12 |
13 | pod 'HGCategorys_Private'
14 | pod 'HGBaseClass'
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/HGPGY/UploadPackage2PGY.sh:
--------------------------------------------------------------------------------
1 |
2 |
3 | # 蒲公英账号信息 (在实际项目中, 可以换成自己的, 当然可以使用我的这个,在上传成功之后, 会有一个蒲公英的 URL)
4 | pgyuKey="8e117ad6b8f7b4dae90eaa5d83f3572b"
5 | pgy_api_key="7511c8d362ad4497eaa80179d0695a34"
6 |
7 | if [ "$#" -eq "2" ]; then
8 | # 每次打包自动修改 build , 将其设置成当前的时间, 精确到秒
9 | date2Build=`date "+%Y%m%d%H%M%S"`
10 | # 路径可根据实际项目做配置
11 | InfoPlistFile="./$1/Info.plist"
12 | /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $date2Build" $InfoPlistFile
13 |
14 | if [ -d "$1".xcworkspace ];then
15 | echo "Pod 项目打包中..."
16 | # 构建 .xcarchive 文件
17 | xcodebuild archive -workspace "$1".xcworkspace -scheme "$1" -configuration Release -archivePath "$1".xcarchive
18 | else
19 | echo "项目打包中..."
20 | # 构建 .xcarchive 文件
21 | xcodebuild archive -project "$1".xcodeproj -scheme "$1" -configuration Release -archivePath "$1".xcarchive
22 | fi
23 |
24 | # .ipa 的文件夹
25 | ipaFolder="../$1"_"$date2Build"
26 |
27 | # 通过 .xcarchive 文件 导出 .ipa 的包
28 | xcodebuild -exportArchive -archivePath "$1".xcarchive -exportPath "$ipaFolder".ipa -exportOptionsPlist ExportOptions.plist
29 |
30 | # 将 .ipa 的包上传至蒲公英平台
31 | curl -F "file=@$ipaFolder.ipa/$1.ipa" \
32 | -F "uKey=$pgyuKey" \
33 | -F "_api_key=$pgy_api_key" \
34 | -F "updateDescription=$2" \
35 | https://www.pgyer.com/apiv1/app/upload
36 |
37 | # 删除中间文件
38 | rm -r "$1".xcarchive
39 | else
40 | # 错误信息提示
41 | echo '输入正确的命令:'
42 | echo "bash $0 项目名称 更新描述"
43 | echo "sh $0 项目名称 更新描述"
44 | echo ". $0 项目名称 更新描述"
45 | fi
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 iOS2DesignPatterns
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UploadPackage2PGY
2 | 通过脚本实现自动打包到上传蒲公英。
3 |
4 | 
5 |
6 | ### 用法
7 | 在当前项目的目录中放入两个文件: UploadPackage2PGY.sh 与 ExportOptions.plist . 其中 ExportOptions.plist 是根据项目而定的, 一般可以使用Xcode打包自动生成的那个文件即可.
8 |
9 | 直接在终端输入:
10 | sh UploadPackage2PGY.sh <项目名称> <更新日志>
11 |
12 | 比如:
13 | sh UploadPackage2PGY.sh HGPGY 在使用高大上的脚本做打包上传.
14 |
15 |
16 |
17 | #### 详情请参考我的简书::[神气的 iOS 打包](https://www.jianshu.com/p/7fe1c8b44023) 与 [没有源码的签名与打包(Python+command)](https://www.jianshu.com/p/b87ca19091cc)
18 |
19 | ##### 我的更多文章,可以直接看这里[NewStart](https://www.jianshu.com/c/2d0d43c820c8)
20 |
21 |
22 |
--------------------------------------------------------------------------------
/signAndPackage/sign.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # -*- coding: UTF-8 -*-
3 |
4 | import os
5 | import sys
6 | import commands
7 |
8 | # APP 名称 比如(AppStoreDev)
9 | AppNmae = '请输入你 APP的名称, 不待.app'
10 | # 证书编号
11 | CertificateNumber = '请输入你的证书编号'
12 | # 签名文件的路径
13 | EntitlementPath = '请输入你的签名文件的路径'
14 |
15 | # 当前文件夹的绝对路径 会在第一个参数中带进来
16 | CurAbsolutePath = sys.argv[1]
17 |
18 | # 拼成 Frameworks 的路径
19 | FrameworksPath = CurAbsolutePath + '/' + AppNmae + '.app/Frameworks/'
20 |
21 | # 执行终端指令
22 | def hg_commands(cmd):
23 | lc = commands.getstatusoutput('' + cmd)
24 | print(lc)
25 |
26 | # 需要签名的文件
27 | files = []
28 | # 获取所有需要重签名的动态库文件路径
29 | for parent, dirnames, filenames in os.walk(FrameworksPath):
30 | for filename in filenames:
31 | # 模板字符串
32 | template = FrameworksPath + filename + '.framework/' + filename
33 | # 拼接成完整的路径
34 | resulteFile = parent + '/' + filename
35 | # 判断是否与模板字符一致
36 | if template == resulteFile:
37 | files.append(resulteFile)
38 |
39 | # 给动态库文件签名
40 | for file in files:
41 | hg_commands('codesign -fs ' + CertificateNumber + ' ' + file)
42 |
43 |
44 | # 签名整个 .app 文件
45 | hg_commands('/usr/bin/codesign --force --sign ' + CertificateNumber + ' --entitlements ' + EntitlementPath + ' --timestamp=none ' + CurAbsolutePath + '/' + AppNmae + '.app')
46 |
47 | # 完事!!!
48 | print('签名完毕')
49 |
--------------------------------------------------------------------------------
/signAndPackage/signAndPackage.command:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3 |
4 | # 运行终端的函数
5 | function run {
6 | echo "Executing command: $@"
7 | $@
8 | if [[ $? != "0" ]]; then
9 | echo "Executing the above command has failed!"
10 | exit 1
11 | fi
12 | }
13 |
14 | # 主要是解压的时候用到
15 | function run_at {
16 | pushd $1
17 | shift
18 | run $@
19 | popd
20 | }
21 |
22 | # 使用 python 自动签名
23 | run "python ${DIR}/sign.py ${DIR}"
24 |
25 | run "rm -rf ${DIR}/Target.ipa ${DIR}/Payload"
26 | run "mkdir ${DIR}/Payload"
27 |
28 | APP=$(find ${DIR} -type d | grep ".app$" | head -n 1)
29 |
30 | run "cp -rf ${APP} ${DIR}/Payload"
31 | run_at ${DIR} "zip -qr Target.ipa Payload"
32 | run "rm -rf ${DIR}/Payload"
33 |
34 | echo "==================CoderHG(done)=================="
35 |
36 | exit;
--------------------------------------------------------------------------------