Explorar el Código

RA Image

基本框架
Ray Zhang hace 9 años
padre
commit
78ee66fd7b

BIN
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 16 - 0
Ants Contract/AntsContract.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -355,5 +355,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/AppDelegate.h"
+            timestampString = "514966913.673937"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "21"
+            endingLineNumber = "21"
+            landmarkName = "bEnable_Cache"
+            landmarkType = "24">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 124 - 0
RA Image/RA Image.xcodeproj/project.pbxproj

@@ -8,6 +8,21 @@
 
 /* Begin PBXBuildFile section */
 		71114A9D1EB1BCB400D2200C /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114A9C1EB1BCB400D2200C /* LoginViewController.m */; };
+		71114AA01EB1C3DE00D2200C /* NetworkUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114A9F1EB1C3DE00D2200C /* NetworkUtils.m */; };
+		71114AA31EB1C40900D2200C /* RAINetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AA21EB1C40900D2200C /* RAINetwork.m */; };
+		71114AA61EB1C50D00D2200C /* RAUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AA51EB1C50D00D2200C /* RAUtils.m */; };
+		71114AB21EB1C5C800D2200C /* AESCrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AAA1EB1C5C800D2200C /* AESCrypt.m */; };
+		71114AB31EB1C5C800D2200C /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 71114AAB1EB1C5C800D2200C /* LICENSE */; };
+		71114AB41EB1C5C800D2200C /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AAD1EB1C5C800D2200C /* NSData+Base64.m */; };
+		71114AB51EB1C5C800D2200C /* NSData+CommonCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AAF1EB1C5C800D2200C /* NSData+CommonCrypto.m */; };
+		71114AB61EB1C5C800D2200C /* NSString+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AB11EB1C5C800D2200C /* NSString+Base64.m */; };
+		71114ABC1EB1C73400D2200C /* ZipArchive.mm in Sources */ = {isa = PBXBuildFile; fileRef = 71114ABB1EB1C73400D2200C /* ZipArchive.mm */; };
+		71114AC61EB1C73B00D2200C /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 71114ABE1EB1C73B00D2200C /* ioapi.c */; };
+		71114AC71EB1C73B00D2200C /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = 71114AC01EB1C73B00D2200C /* mztools.c */; };
+		71114AC81EB1C73B00D2200C /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 71114AC21EB1C73B00D2200C /* unzip.c */; };
+		71114AC91EB1C73B00D2200C /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 71114AC41EB1C73B00D2200C /* zip.c */; };
+		71114ACC1EB1C76E00D2200C /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 71114ACB1EB1C76E00D2200C /* libz.tbd */; };
+		71114ACF1EB1C79300D2200C /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114ACE1EB1C79300D2200C /* Reachability.m */; };
 		71DCDC391EAF234E00BA045A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 71DCDC381EAF234E00BA045A /* main.m */; };
 		71DCDC3C1EAF234E00BA045A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71DCDC3B1EAF234E00BA045A /* AppDelegate.m */; };
 		71DCDC3F1EAF234E00BA045A /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71DCDC3E1EAF234E00BA045A /* RootViewController.m */; };
@@ -20,6 +35,37 @@
 /* Begin PBXFileReference section */
 		71114A9B1EB1BCB400D2200C /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
 		71114A9C1EB1BCB400D2200C /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
+		71114A9E1EB1C3DE00D2200C /* NetworkUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkUtils.h; path = "../../RedAnt ERP Mobile/common/NetworkUtils.h"; sourceTree = "<group>"; };
+		71114A9F1EB1C3DE00D2200C /* NetworkUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NetworkUtils.m; path = "../../RedAnt ERP Mobile/common/NetworkUtils.m"; sourceTree = "<group>"; };
+		71114AA11EB1C40900D2200C /* RAINetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAINetwork.h; sourceTree = "<group>"; };
+		71114AA21EB1C40900D2200C /* RAINetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAINetwork.m; sourceTree = "<group>"; };
+		71114AA41EB1C50D00D2200C /* RAUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUtils.h; path = "../../RedAnt ERP Mobile/common/RAUtils.h"; sourceTree = "<group>"; };
+		71114AA51EB1C50D00D2200C /* RAUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAUtils.m; path = "../../RedAnt ERP Mobile/common/RAUtils.m"; sourceTree = "<group>"; };
+		71114AA91EB1C5C800D2200C /* AESCrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AESCrypt.h; path = "../../RedAnt ERP Mobile/common/AES/AESCrypt.h"; sourceTree = "<group>"; };
+		71114AAA1EB1C5C800D2200C /* AESCrypt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AESCrypt.m; path = "../../RedAnt ERP Mobile/common/AES/AESCrypt.m"; sourceTree = "<group>"; };
+		71114AAB1EB1C5C800D2200C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = "../../RedAnt ERP Mobile/common/AES/LICENSE"; sourceTree = "<group>"; };
+		71114AAC1EB1C5C800D2200C /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+Base64.h"; path = "../../RedAnt ERP Mobile/common/AES/NSData+Base64.h"; sourceTree = "<group>"; };
+		71114AAD1EB1C5C800D2200C /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSData+Base64.m"; path = "../../RedAnt ERP Mobile/common/AES/NSData+Base64.m"; sourceTree = "<group>"; };
+		71114AAE1EB1C5C800D2200C /* NSData+CommonCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+CommonCrypto.h"; path = "../../RedAnt ERP Mobile/common/AES/NSData+CommonCrypto.h"; sourceTree = "<group>"; };
+		71114AAF1EB1C5C800D2200C /* NSData+CommonCrypto.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSData+CommonCrypto.m"; path = "../../RedAnt ERP Mobile/common/AES/NSData+CommonCrypto.m"; sourceTree = "<group>"; };
+		71114AB01EB1C5C800D2200C /* NSString+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+Base64.h"; path = "../../RedAnt ERP Mobile/common/AES/NSString+Base64.h"; sourceTree = "<group>"; };
+		71114AB11EB1C5C800D2200C /* NSString+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+Base64.m"; path = "../../RedAnt ERP Mobile/common/AES/NSString+Base64.m"; sourceTree = "<group>"; };
+		71114AB71EB1C68B00D2200C /* const.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = const.h; sourceTree = "<group>"; };
+		71114AB81EB1C6B700D2200C /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
+		71114ABA1EB1C73400D2200C /* ZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZipArchive.h; path = "../../RedAnt ERP Mobile/common/zip/ZipArchive.h"; sourceTree = "<group>"; };
+		71114ABB1EB1C73400D2200C /* ZipArchive.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ZipArchive.mm; path = "../../RedAnt ERP Mobile/common/zip/ZipArchive.mm"; sourceTree = "<group>"; };
+		71114ABD1EB1C73B00D2200C /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = "../../RedAnt ERP Mobile/common/zip/minizip/crypt.h"; sourceTree = "<group>"; };
+		71114ABE1EB1C73B00D2200C /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = "../../RedAnt ERP Mobile/common/zip/minizip/ioapi.c"; sourceTree = "<group>"; };
+		71114ABF1EB1C73B00D2200C /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ioapi.h; path = "../../RedAnt ERP Mobile/common/zip/minizip/ioapi.h"; sourceTree = "<group>"; };
+		71114AC01EB1C73B00D2200C /* mztools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mztools.c; path = "../../RedAnt ERP Mobile/common/zip/minizip/mztools.c"; sourceTree = "<group>"; };
+		71114AC11EB1C73B00D2200C /* mztools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mztools.h; path = "../../RedAnt ERP Mobile/common/zip/minizip/mztools.h"; sourceTree = "<group>"; };
+		71114AC21EB1C73B00D2200C /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unzip.c; path = "../../RedAnt ERP Mobile/common/zip/minizip/unzip.c"; sourceTree = "<group>"; };
+		71114AC31EB1C73B00D2200C /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unzip.h; path = "../../RedAnt ERP Mobile/common/zip/minizip/unzip.h"; sourceTree = "<group>"; };
+		71114AC41EB1C73B00D2200C /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip.c; path = "../../RedAnt ERP Mobile/common/zip/minizip/zip.c"; sourceTree = "<group>"; };
+		71114AC51EB1C73B00D2200C /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zip.h; path = "../../RedAnt ERP Mobile/common/zip/minizip/zip.h"; sourceTree = "<group>"; };
+		71114ACB1EB1C76E00D2200C /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
+		71114ACD1EB1C79300D2200C /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Reachability.h; path = "../../RedAnt ERP Mobile/common/Reachability.h"; sourceTree = "<group>"; };
+		71114ACE1EB1C79300D2200C /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Reachability.m; path = "../../RedAnt ERP Mobile/common/Reachability.m"; sourceTree = "<group>"; };
 		71DCDC341EAF234E00BA045A /* RA Image.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RA Image.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		71DCDC381EAF234E00BA045A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		71DCDC3A1EAF234E00BA045A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -38,17 +84,74 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				71114ACC1EB1C76E00D2200C /* libz.tbd in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		71114AA71EB1C51200D2200C /* util */ = {
+			isa = PBXGroup;
+			children = (
+				71114AB91EB1C71E00D2200C /* zip */,
+				71114AA81EB1C5C000D2200C /* aes */,
+				71114AA41EB1C50D00D2200C /* RAUtils.h */,
+				71114AA51EB1C50D00D2200C /* RAUtils.m */,
+				71114ACD1EB1C79300D2200C /* Reachability.h */,
+				71114ACE1EB1C79300D2200C /* Reachability.m */,
+			);
+			name = util;
+			sourceTree = "<group>";
+		};
+		71114AA81EB1C5C000D2200C /* aes */ = {
+			isa = PBXGroup;
+			children = (
+				71114AA91EB1C5C800D2200C /* AESCrypt.h */,
+				71114AAA1EB1C5C800D2200C /* AESCrypt.m */,
+				71114AAB1EB1C5C800D2200C /* LICENSE */,
+				71114AAC1EB1C5C800D2200C /* NSData+Base64.h */,
+				71114AAD1EB1C5C800D2200C /* NSData+Base64.m */,
+				71114AAE1EB1C5C800D2200C /* NSData+CommonCrypto.h */,
+				71114AAF1EB1C5C800D2200C /* NSData+CommonCrypto.m */,
+				71114AB01EB1C5C800D2200C /* NSString+Base64.h */,
+				71114AB11EB1C5C800D2200C /* NSString+Base64.m */,
+			);
+			name = aes;
+			sourceTree = "<group>";
+		};
+		71114AB91EB1C71E00D2200C /* zip */ = {
+			isa = PBXGroup;
+			children = (
+				71114ABD1EB1C73B00D2200C /* crypt.h */,
+				71114ABE1EB1C73B00D2200C /* ioapi.c */,
+				71114ABF1EB1C73B00D2200C /* ioapi.h */,
+				71114AC01EB1C73B00D2200C /* mztools.c */,
+				71114AC11EB1C73B00D2200C /* mztools.h */,
+				71114AC21EB1C73B00D2200C /* unzip.c */,
+				71114AC31EB1C73B00D2200C /* unzip.h */,
+				71114AC41EB1C73B00D2200C /* zip.c */,
+				71114AC51EB1C73B00D2200C /* zip.h */,
+				71114ABA1EB1C73400D2200C /* ZipArchive.h */,
+				71114ABB1EB1C73400D2200C /* ZipArchive.mm */,
+			);
+			name = zip;
+			sourceTree = "<group>";
+		};
+		71114ACA1EB1C76E00D2200C /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				71114ACB1EB1C76E00D2200C /* libz.tbd */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 		71DCDC2B1EAF234E00BA045A = {
 			isa = PBXGroup;
 			children = (
 				71DCDC361EAF234E00BA045A /* RA Image */,
 				71DCDC351EAF234E00BA045A /* Products */,
+				71114ACA1EB1C76E00D2200C /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -63,6 +166,9 @@
 		71DCDC361EAF234E00BA045A /* RA Image */ = {
 			isa = PBXGroup;
 			children = (
+				71114AB71EB1C68B00D2200C /* const.h */,
+				71114AB81EB1C6B700D2200C /* config.h */,
+				71114AA71EB1C51200D2200C /* util */,
 				71DCDC4E1EAF34F800BA045A /* modes */,
 				71DCDC3A1EAF234E00BA045A /* AppDelegate.h */,
 				71DCDC3B1EAF234E00BA045A /* AppDelegate.m */,
@@ -71,6 +177,10 @@
 				71114A9B1EB1BCB400D2200C /* LoginViewController.h */,
 				71114A9C1EB1BCB400D2200C /* LoginViewController.m */,
 				71DCDC401EAF234E00BA045A /* Main.storyboard */,
+				71114A9E1EB1C3DE00D2200C /* NetworkUtils.h */,
+				71114A9F1EB1C3DE00D2200C /* NetworkUtils.m */,
+				71114AA11EB1C40900D2200C /* RAINetwork.h */,
+				71114AA21EB1C40900D2200C /* RAINetwork.m */,
 				71DCDC431EAF234E00BA045A /* Assets.xcassets */,
 				71DCDC451EAF234E00BA045A /* LaunchScreen.storyboard */,
 				71DCDC481EAF234E00BA045A /* Info.plist */,
@@ -158,6 +268,7 @@
 				71DCDC441EAF234E00BA045A /* Assets.xcassets in Resources */,
 				71DCDC501EAF353000BA045A /* modelist.json in Resources */,
 				71DCDC421EAF234E00BA045A /* Main.storyboard in Resources */,
+				71114AB31EB1C5C800D2200C /* LICENSE in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -168,10 +279,23 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				71114AB21EB1C5C800D2200C /* AESCrypt.m in Sources */,
+				71114AC61EB1C73B00D2200C /* ioapi.c in Sources */,
 				71114A9D1EB1BCB400D2200C /* LoginViewController.m in Sources */,
+				71114AB51EB1C5C800D2200C /* NSData+CommonCrypto.m in Sources */,
+				71114AC71EB1C73B00D2200C /* mztools.c in Sources */,
 				71DCDC3F1EAF234E00BA045A /* RootViewController.m in Sources */,
+				71114AC81EB1C73B00D2200C /* unzip.c in Sources */,
+				71114AA01EB1C3DE00D2200C /* NetworkUtils.m in Sources */,
+				71114AA31EB1C40900D2200C /* RAINetwork.m in Sources */,
+				71114AC91EB1C73B00D2200C /* zip.c in Sources */,
+				71114AB61EB1C5C800D2200C /* NSString+Base64.m in Sources */,
+				71114AA61EB1C50D00D2200C /* RAUtils.m in Sources */,
 				71DCDC3C1EAF234E00BA045A /* AppDelegate.m in Sources */,
 				71DCDC391EAF234E00BA045A /* main.m in Sources */,
+				71114ABC1EB1C73400D2200C /* ZipArchive.mm in Sources */,
+				71114AB41EB1C5C800D2200C /* NSData+Base64.m in Sources */,
+				71114ACF1EB1C79300D2200C /* Reachability.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

BIN
RA Image/RA Image.xcodeproj/project.xcworkspace/xcuserdata/ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 4 - 1
RA Image/RA Image/AppDelegate.h

@@ -12,6 +12,9 @@
 
 @property (strong, nonatomic) UIWindow *window;
 
-
+@property (strong,nonatomic) NSString* user;
+@property (strong,nonatomic) NSString * password;
+@property (strong,nonatomic) NSString* build;
+@property bool bLogin;
 @end
 

+ 4 - 0
RA Image/RA Image/AppDelegate.m

@@ -17,6 +17,10 @@
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     // Override point for customization after application launch.
+    
+    
+    NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
+    self.build =[infoDict objectForKey:@"CFBundleVersion"];
     return YES;
 }
 

+ 16 - 0
RA Image/RA Image/RAINetwork.h

@@ -0,0 +1,16 @@
+//
+//  RAINetwork.h
+//  RA Image
+//
+//  Created by Ray on 27/04/2017.
+//  Copyright © 2017 USAI. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "NetworkUtils.h"
+
+@interface RAINetwork : NetworkUtils
++(NSDictionary*)Login : (NSString*) user password:(NSString*) password;
++(NSDictionary*)logout;
+
+@end

+ 107 - 0
RA Image/RA Image/RAINetwork.m

@@ -0,0 +1,107 @@
+//
+//  RAINetwork.m
+//  RA Image
+//
+//  Created by Ray on 27/04/2017.
+//  Copyright © 2017 USAI. All rights reserved.
+//
+#import "config.h"
+#import "RAINetwork.h"
+#import "AppDelegate.h"
+#import "AESCrypt.h"
+#import "RAUtils.h"
+
+@implementation RAINetwork
+
++(NSMutableDictionary*) prepare_addtional_params:(NSMutableDictionary* ) params
+{
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.user!=nil)
+        [params setValue:[AESCrypt AES128Encrypt:appDelegate.user key:@"usai2010"] forKey:@"user"];
+    if(appDelegate.password!=nil)
+        [params setValue:[AESCrypt AES128Encrypt:appDelegate.password key:@"usai2010"] forKey:@"password"];
+    
+    
+    
+    [params setValue:appDelegate.build forKey:@"app_ver"];
+    
+    NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
+    NSString* short_version =[infoDict objectForKey:@"CFBundleShortVersionString"];
+    [params setValue:short_version forKey:@"app_short_ver"];
+    
+    
+    
+#if TARGET_IPHONE_SIMULATOR//模拟器
+    [params setValue:@"simulator_uuid" forKey:@"deviceid"];
+#elif TARGET_OS_IPHONE//真机
+    UIDevice * dev = [UIDevice currentDevice];
+    NSUUID* uuid =dev.identifierForVendor;
+    [params setValue:uuid.UUIDString forKey:@"deviceid"];
+#endif
+    
+    return params;
+}
++(NSData*)get_json : (NSString*) url parameters:(NSMutableDictionary *) params file:(NSString *) file //delegate:(id < NSURLConnectionDelegate >)delegate
+{
+    
+    
+    
+    
+    //    NSString* e=[AESCrypt AES128Encrypt:@"密码学中的高级加密标准(Advanced Encryption Standard,AES),又称 高级加密标准Rijndael加密法,是美国联邦政府采用的一种区块加密标准。这个标准用来替代原先的DES,已经被多方分析且广为全世界所使用。经过五年的甄选流程,高级加密标准由美国国家标准与技术研究院 (NIST)于2001年11月26日发布于FIPS PUB 197,并在2002年5月26日成为有效的标准。2006年,高级加密标准已然成为对称密钥加密中最流行的算法之一。 " key:@"usai2010"];
+    //    DebugLog(e);
+    //    NSString* d=[AESCrypt decrypt:@"VzB4+lENfbzWX7ggHh2Os1P69l5YBzKmM51yqA37AfoKgPY8bJgdK8M4WvF+wDyOsLWP\/o8H5+bHMivQp1u8wM2QV7SYzgzPwV85QKtYWIzEgLe9T0HO69EdutWz7k1rdAT\/mftsRin0Hy5SHk7txTZT\/zPH5X+FQiExCTFm5Zus39HYvp+VxCX4+kYeymn8B63AUd3mRQyscUvDjfgU2olKR\/TP8PV3g+VQMZxpKfol3P1iOtz3XQlHZV0pM6SAf+SwT0sPfrdn6CZFfNQlrKA9QjMrnBdMeSCquSIWXnmLv6okzvnlJnT0SjvJuUeqNdBC5EZ0ACnhI0MrXVZEsq1EuM9al7oPzvU5EZbjZpmx+fSFIkMzTT8bYClTnG1bsL1MCcU4pSODDorUj8zalA==" password:@"usai2010"];
+    params = [self prepare_addtional_params:params];
+    
+    return [super get_json:url parameters:params file:(NSString*)file err_recorder:URL_ERR_LOG result_handler:^NSMutableDictionary *(NSMutableDictionary *jsobj) {
+        int result=[[jsobj valueForKey:@"result"] intValue];
+        //        UIApplication * app = [UIApplication sharedApplication];
+        //        AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+        
+        switch (result) {
+            case 0:
+                [jsobj setValue:MSG_USERAUTH_ERROR forKey:@"err_msg"];
+                break;
+            case 1:
+                [jsobj setValue:MSG_ERROR forKey:@"err_msg"];
+                break;
+            case 2:
+                [jsobj setValue:MSG_SUCCESS forKey:@"err_msg"];
+                break;
+            case 8:
+                [jsobj setValue:[jsobj valueForKey:@"msg"] forKey:@"err_msg"];
+                break;
+            case 9:
+                [jsobj setValue:[jsobj valueForKey:@"msg"] forKey:@"err_msg"];
+                break;
+            case 99:
+                [jsobj setValue:MSG_TIMEOUT forKey:@"err_msg"];
+                break;
+            default:
+                [jsobj setValue:MSG_ERROR forKey:@"err_msg"];
+                break;
+        }
+        
+        
+        //        if([appDelegate.build intValue]< [[jsobj valueForKey:@"min_ver"]intValue])
+        //        {
+        //            [jsobj setValue:@"9" forKey:@"result"];
+        //            [jsobj setValue:MSG_VER_LOW forKey:@"err_msg"];
+        //        }
+        return jsobj;
+    } decrypt_handler:^NSMutableDictionary *(NSMutableDictionary *jsobj) {
+        
+        NSString* base64str = jsobj[@"str"];
+        NSString* decryptstr=[AESCrypt AES128Decrypt:base64str key:@"usai2010"];
+        jsobj=[[RAUtils string2dict:decryptstr] mutableCopy];
+        return jsobj;
+    }];
+    
+    
+    /*
+     
+     
+     
+     */
+    return nil;
+}
+@end

+ 60 - 0
RA Image/RA Image/config.h

@@ -0,0 +1,60 @@
+//
+//  config.h
+//  RA Image
+//
+//  Created by Ray on 27/04/2017.
+//  Copyright © 2017 USAI. All rights reserved.
+//
+
+#ifndef config_h
+#define config_h
+
+
+
+
+
+
+
+//#define ENCRYPT_OFF
+# ifdef DEBUG
+#define NO_SAVE_VERIFY true
+//    #define test_server
+# else
+#define NO_SAVE_VERIFY false
+# endif
+
+#define DEBUG_PDFSIG false
+
+#define PDF_DEBUG false
+
+
+
+#ifdef test_server
+//    #define  URL_ERR_LOG  @""
+//    #define  URL_UPDATE_AUTH  @"http://192.168.0.177/esign/admin.php"
+//    #define  URL_UPLOAD_PDF  @"http://192.168.0.177/esign/admin.php"
+//    #define  URL_LOGOUT  @"http://192.168.0.177/esign/admin.php"
+//    #define  URL_NEW_DOCUMENT  @"http://192.168.0.177/esign/admin.php"
+//    #define  URL_REQUEST_DOC  @"http://192.168.0.177/esign/admin.php"
+
+
+#define  URL_ERR_LOG  @""
+#define  URL_UPDATE_AUTH  @"http://192.168.0.155/cms/phpcms/admin_new.php"
+#define  URL_UPLOAD_PDF  @"http://192.168.0.155/cms/phpcms/admin_new.php"
+#define  URL_LOGOUT  @"http://192.168.0.155/cms/phpcms/admin_new.php"
+#define  URL_NEW_DOCUMENT  @"http://192.168.0.155/cms/phpcms/admin_new.php"
+#define  URL_UPDATE_NOTES  @"http://192.168.0.155/cms/phpcms/admin_new.php"
+#define  URL_REQUEST_DOC  @"http://192.168.0.155/cms/phpcms/admin_new.php"
+#define URL_HEART_BEAT @"http://192.168.0.155/cms/phpcms/admin_new.php"
+#else
+#define  URL_ERR_LOG  @""
+#define  URL_UPDATE_AUTH  @"https://www.thegraniteexpo.com/admin_new.php"
+#define  URL_UPLOAD_PDF  @"https://www.thegraniteexpo.com/admin_new.php"
+#define  URL_LOGOUT  @"https://www.thegraniteexpo.com/admin_new.php"
+#define  URL_REQUEST_DOC  @"https://www.thegraniteexpo.com/admin_new.php"
+#define  URL_NEW_DOCUMENT  @"https://www.thegraniteexpo.com/admin_new.php"
+#define  URL_UPDATE_NOTES  @"https://www.thegraniteexpo.com/admin_new.php"
+#define URL_HEART_BEAT @"https://www.thegraniteexpo.com/admin_new.php"
+#endif
+
+#endif /* config_h */

+ 49 - 0
RA Image/RA Image/const.h

@@ -0,0 +1,49 @@
+//
+//  const.h
+//  RA Image
+//
+//  Created by Ray on 27/04/2017.
+//  Copyright © 2017 USAI. All rights reserved.
+//
+
+
+
+#ifndef const_h
+#define const_h
+
+
+#define CONTROL_BASE 19871
+#define CHECK_BASE 29871
+#define DEBUGLOG 1
+#ifdef DEBUGLOG
+#ifdef DEBUG
+//     #define DebugLog( s, ... ) fprintf(stderr,"%s\n",[[NSString stringWithFormat:s, ##__VA_ARGS__] UTF8String])//
+#define DebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
+#else
+#define DebugLog( s, ... )
+#endif
+#else
+#define DebugLog( s, ... )
+#endif
+
+
+#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
+//#define UIColorFromRGBA(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF000000) >> 32))/255.0 green:((float)((rgbValue & 0xFF0000) >> 16))/255.0 blue:((float)((rgbValue & 0xFF00) >> 8))/255.0 alpha:((float)(rgbValue & 0xFF))/255.0]
+
+
+
+
+
+#define TV_BG 0xccffff
+
+#define CK_BG 0xccffff
+#define CK_MK 0x000000
+
+#define SIG_BG 0xFFFFCC
+
+#define BT_BG 0xccffff
+
+#define JSON_TIMEOUT 30
+
+
+#endif /* const_h */