├── android
├── .gitignore
├── libs
│ └── axis.jar
├── src
│ ├── main
│ │ ├── res
│ │ │ └── values
│ │ │ │ └── strings.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── chinaztt
│ │ │ ├── encapsulation
│ │ │ ├── EncryptionReactPackager.java
│ │ │ └── EncryptionModule.java
│ │ │ └── utils
│ │ │ ├── MD5Tools.java
│ │ │ └── AESTools.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── react_native_encryption_library
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── react_native_encryption_library
│ │ └── ApplicationTest.java
├── build.gradle
├── proguard-rules.pro
└── react-native-encryption-library.iml
├── entryption_ios.gif
├── entryption_android.gif
├── EncryptionDemo
├── StringEncryptioned.m
├── EncryptionLibrary.h
├── Tools.h
├── StringEncryptioned.h
├── AppDelegate.h
├── main.m
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── StringEncryption.h
├── Tools.m
├── NSData+Base64.h
├── Info.plist
├── AppDelegate.m
├── EncryptionLibrary.m
├── Base.lproj
│ └── LaunchScreen.xib
├── NSData+Base64.m
└── StringEncryption.m
├── package.json
├── EncryptionDemo.xcodeproj
├── xcuserdata
│ └── jiangqq.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
├── xcshareddata
│ └── xcschemes
│ │ └── EncryptionDemo.xcscheme
└── project.pbxproj
├── EncryptionDemoTests
├── Info.plist
└── EncryptionDemoTests.m
├── LICENSE
├── index.android.js
└── README.md
/android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/entryption_ios.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiangqqlmj/react-native-encryption-library/HEAD/entryption_ios.gif
--------------------------------------------------------------------------------
/android/libs/axis.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiangqqlmj/react-native-encryption-library/HEAD/android/libs/axis.jar
--------------------------------------------------------------------------------
/entryption_android.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jiangqqlmj/react-native-encryption-library/HEAD/entryption_android.gif
--------------------------------------------------------------------------------
/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Encryption_Library
3 |
4 |
--------------------------------------------------------------------------------
/EncryptionDemo/StringEncryptioned.m:
--------------------------------------------------------------------------------
1 | //
2 | // StringEncryptioned.m
3 | // GSM
4 | //
5 | // Created by ztt on 16/3/8.
6 | // Copyright © 2016年 QYF. All rights reserved.
7 | //
8 |
9 | #import "StringEncryptioned.h"
10 |
11 | @implementation StringEncryptioned
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/EncryptionDemo/EncryptionLibrary.h:
--------------------------------------------------------------------------------
1 | //
2 | // EncryptionLibrary.h
3 | // EncryptionDemo
4 | //
5 | // Created by 江清清 on 16/5/27.
6 | // Copyright © 2016年 Facebook. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "RCTBridge.h"
11 | @interface EncryptionLibrary : NSObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/src/test/java/com/react_native_encryption_library/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.react_native_encryption_library;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/EncryptionDemo/Tools.h:
--------------------------------------------------------------------------------
1 | //
2 | // MD5Tools.h
3 | // EncryptionDemo
4 | //
5 | // Created by 江清清 on 16/5/27.
6 | // Copyright © 2016年 Facebook. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Tools : NSObject
12 | //进行字符串的MD5操作
13 | +(NSString *)MD5:(NSString *)str;
14 | +(NSString *)AESEncryptString:(NSString *)str withKey:(NSString *)encryptKey;
15 | +(NSString *)AESDecryptString:(NSString *)str withKey:(NSString *)encryptKey;
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/android/src/androidTest/java/com/react_native_encryption_library/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.react_native_encryption_library;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/EncryptionDemo/StringEncryptioned.h:
--------------------------------------------------------------------------------
1 | //
2 | // StringEncryptioned.h
3 | // GSM
4 | //
5 | // Created by ztt on 16/3/8.
6 | // Copyright © 2016年 QYF. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 |
13 | #define kChosenCipherBlockSize kCCBlockSizeAES128
14 | #define kChosenCipherKeySize kCCKeySizeAES128
15 | #define kChosenDigestLength CC_SHA1_DIGEST_LENGTH
16 | @interface StringEncryptioned : NSObject
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/EncryptionDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (nonatomic, strong) UIWindow *window;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/EncryptionDemo/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "AppDelegate.h"
13 |
14 | int main(int argc, char * argv[]) {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion '23.0.1'
6 |
7 | defaultConfig {
8 | minSdkVersion 16
9 | targetSdkVersion 23
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | compile files('libs/axis.jar')
24 | compile 'com.facebook.react:react-native:0.20.1'
25 | }
26 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-encryption-library",
3 | "version": "1.0.8",
4 | "description": "an encryption-library for react native by www.lcode.org",
5 | "main": "index.android.js",
6 | "scripts": {
7 | "test": "make test"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/jiangqqlmj/react-native-encryption-library.git"
12 | },
13 | "keywords": [
14 | "encryption"
15 | ],
16 | "author": "jiangqqlmj@163.com",
17 | "license": "ISC",
18 | "bugs": {
19 | "url": "https://github.com/jiangqqlmj/react-native-encryption-library/issues"
20 | },
21 | "homepage": "https://github.com/jiangqqlmj/react-native-encryption-library#readme"
22 | }
23 |
--------------------------------------------------------------------------------
/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jiangqq/Documents/android-sdk-macosx/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/EncryptionDemo.xcodeproj/xcuserdata/jiangqq.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | EncryptionDemo.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 00E356ED1AD99517003FC87E
16 |
17 | primary
18 |
19 |
20 | 13B07F861A680F5B00A75B9A
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/EncryptionDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/EncryptionDemo/StringEncryption.h:
--------------------------------------------------------------------------------
1 | // http://www.wuleilei.com/
2 |
3 | #import
4 | #import
5 | #import
6 | #define kChosenCipherBlockSize kCCBlockSizeAES128
7 | #define kChosenCipherKeySize kCCKeySizeAES128
8 | #define kChosenDigestLength CC_SHA1_DIGEST_LENGTH
9 |
10 | @interface StringEncryption : NSObject
11 |
12 | + (NSString *)encryptString:(NSString *)plainSourceStringToEncrypt withKey:(NSString *)encryptKey;
13 | + (NSString *)decryptString:(NSString *)base64StringToDecrypt withKey:(NSString *)encryptKey;
14 | + (NSData *)encrypt:(NSData *)plainText withKey:(NSString *)encryptKey;
15 | + (NSData *)decrypt:(NSData *)plainText withKey:(NSString *)encryptKey;
16 | + (NSData *)doCipher:(NSData *)plainText context:(CCOperation)encryptOrDecrypt withKey:(NSString *)encryptKey;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/EncryptionDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 江清清
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 |
--------------------------------------------------------------------------------
/EncryptionDemo/Tools.m:
--------------------------------------------------------------------------------
1 | //
2 | // MD5Tools.m
3 | // EncryptionDemo
4 | //
5 | // Created by 江清清 on 16/5/27.
6 | // Copyright © 2016年 Facebook. All rights reserved.
7 | //
8 |
9 | #import "Tools.h"
10 | #import
11 | #import "StringEncryption.h"
12 | @implementation Tools
13 |
14 | //字符串MD5操作
15 | +(NSString *)MD5:(NSString *)str{
16 | const char *cStr = [str UTF8String];
17 | unsigned char result[16];
18 | CC_MD5( cStr, strlen(cStr), result );
19 | return [NSString stringWithFormat:
20 | @"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
21 | result[0], result[1], result[2], result[3],
22 | result[4], result[5], result[6], result[7],
23 | result[8], result[9], result[10], result[11],
24 | result[12], result[13], result[14], result[15]
25 | ];
26 | }
27 |
28 | //进行字符串的AES加密操作 wIEuw3kAGwVNl7BW
29 | +(NSString *)AESEncryptString:(NSString *)str withKey:(NSString *)encryptKey{
30 | //开始AES加密
31 | NSString *result=[StringEncryption encryptString:str withKey:encryptKey];
32 | return result;
33 | }
34 |
35 | +(NSString *)AESDecryptString:(NSString *)str withKey:(NSString *)encryptKey{
36 | NSString *result=[StringEncryption decryptString:str withKey:encryptKey];
37 | return result;
38 | }
39 | @end
40 |
--------------------------------------------------------------------------------
/EncryptionDemo/NSData+Base64.h:
--------------------------------------------------------------------------------
1 | // http://www.wuleilei.com/
2 |
3 |
4 | #import
5 | @interface NSData (Base64)
6 |
7 | /*! @function +dataWithBase64EncodedString:
8 | @discussion This method returns an autoreleased NSData object. The NSData object is initialized with the
9 | contents of the Base 64 encoded string. This is a convenience method.
10 | @param inBase64String An NSString object that contains only Base 64 encoded data.
11 | @result The NSData object. */
12 | + (NSData *) dataWithBase64EncodedString:(NSString *) string;
13 |
14 | /*! @function -initWithBase64EncodedString:
15 | @discussion The NSData object is initialized with the contents of the Base 64 encoded string.
16 | This method returns self as a convenience.
17 | @param inBase64String An NSString object that contains only Base 64 encoded data.
18 | @result This method returns self. */
19 | - (id) initWithBase64EncodedString:(NSString *) string;
20 |
21 | /*! @function -base64EncodingWithLineLength:
22 | @discussion This method returns a Base 64 encoded string representation of the data object.
23 | @param inLineLength A value of zero means no line breaks. This is crunched to a multiple of 4 (the next
24 | one greater than inLineLength).
25 | @result The base 64 encoded data. */
26 | - (NSString *) base64EncodingWithLineLength:(unsigned int) lineLength;
27 |
28 | @end
--------------------------------------------------------------------------------
/android/src/main/java/com/chinaztt/encapsulation/EncryptionReactPackager.java:
--------------------------------------------------------------------------------
1 | package com.chinaztt.encapsulation;
2 |
3 | import com.facebook.react.ReactPackage;
4 | import com.facebook.react.bridge.JavaScriptModule;
5 | import com.facebook.react.bridge.NativeModule;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.react.uimanager.ViewManager;
8 |
9 | import java.util.ArrayList;
10 | import java.util.Collections;
11 | import java.util.List;
12 |
13 | /**
14 | * 当前类注释:
15 | * 项目名:android
16 | * 包名:com.chinaztt.encapsulation
17 | * 作者:江清清 on 16/5/26 14:10
18 | * 邮箱:jiangqqlmj@163.com
19 | * QQ: 781931404
20 | * 公司:江苏中天科技软件技术有限公司
21 | * 站点:www.lcode.org
22 | */
23 | public class EncryptionReactPackager implements ReactPackage {
24 |
25 | @Override
26 | public List createNativeModules(ReactApplicationContext reactContext) {
27 | List modules=new ArrayList<>();
28 | modules.add(new EncryptionModule(reactContext));
29 | return modules;
30 | }
31 |
32 | @Override
33 | public List> createJSModules() {
34 | return Collections.emptyList();
35 | }
36 |
37 | @Override
38 | public List createViewManagers(ReactApplicationContext reactContext) {
39 | return Collections.emptyList();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/android/src/main/java/com/chinaztt/utils/MD5Tools.java:
--------------------------------------------------------------------------------
1 | package com.chinaztt.utils;
2 |
3 | import java.security.MessageDigest;
4 |
5 | /**
6 | * 当前类注释:MD5加密 大写32位加密
7 | * 项目名:android
8 | * 包名:com.chinaztt.utils
9 | * 作者:江清清 on 16/5/26 13:57
10 | * 邮箱:jiangqqlmj@163.com
11 | * QQ: 781931404
12 | * 公司:江苏中天科技软件技术有限公司
13 | * 站点:www.lcode.org
14 | */
15 | public class MD5Tools {
16 | public final static String MD5(String s) {
17 | char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
18 | try {
19 | byte[] btInput = s.getBytes();
20 | // 获得MD5摘要算法的 MessageDigest 对象
21 | MessageDigest mdInst = MessageDigest.getInstance("MD5");
22 | // 使用指定的字节更新摘要
23 | mdInst.update(btInput);
24 | // 获得密文
25 | byte[] md = mdInst.digest();
26 | // 把密文转换成十六进制的字符串形式
27 | int j = md.length;
28 | char str[] = new char[j * 2];
29 | int k = 0;
30 | for (int i = 0; i < j; i++) {
31 | byte byte0 = md[i];
32 | str[k++] = hexDigits[byte0 >>> 4 & 0xf];
33 | str[k++] = hexDigits[byte0 & 0xf];
34 | }
35 | return new String(str);
36 | } catch (Exception e) {
37 | e.printStackTrace();
38 | return null;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/EncryptionDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSAllowsArbitraryLoads
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/EncryptionDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "AppDelegate.h"
11 |
12 | #import "RCTRootView.h"
13 |
14 | @implementation AppDelegate
15 |
16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
17 | {
18 | NSURL *jsCodeLocation;
19 |
20 | /**
21 | * Loading JavaScript code - uncomment the one you want.
22 | *
23 | * OPTION 1
24 | * Load from development server. Start the server from the repository root:
25 | *
26 | * $ npm start
27 | *
28 | * To run on device, change `localhost` to the IP address of your computer
29 | * (you can get this by typing `ifconfig` into the terminal and selecting the
30 | * `inet` value under `en0:`) and make sure your computer and iOS device are
31 | * on the same Wi-Fi network.
32 | */
33 |
34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
35 |
36 | /**
37 | * OPTION 2
38 | * Load from pre-bundled file on disk. The static bundle is automatically
39 | * generated by the "Bundle React Native code and images" build step when
40 | * running the project on an actual device or running the project on the
41 | * simulator in the "Release" build configuration.
42 | */
43 |
44 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
45 |
46 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
47 | moduleName:@"EncryptionDemo"
48 | initialProperties:nil
49 | launchOptions:launchOptions];
50 |
51 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
52 | UIViewController *rootViewController = [UIViewController new];
53 | rootViewController.view = rootView;
54 | self.window.rootViewController = rootViewController;
55 | [self.window makeKeyAndVisible];
56 | return YES;
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/EncryptionDemoTests/EncryptionDemoTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 | #import
12 |
13 | #import "RCTLog.h"
14 | #import "RCTRootView.h"
15 |
16 | #define TIMEOUT_SECONDS 600
17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
18 |
19 | @interface EncryptionDemoTests : XCTestCase
20 |
21 | @end
22 |
23 | @implementation EncryptionDemoTests
24 |
25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
26 | {
27 | if (test(view)) {
28 | return YES;
29 | }
30 | for (UIView *subview in [view subviews]) {
31 | if ([self findSubviewInView:subview matching:test]) {
32 | return YES;
33 | }
34 | }
35 | return NO;
36 | }
37 |
38 | - (void)testRendersWelcomeScreen
39 | {
40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
42 | BOOL foundElement = NO;
43 |
44 | __block NSString *redboxError = nil;
45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
46 | if (level >= RCTLogLevelError) {
47 | redboxError = message;
48 | }
49 | });
50 |
51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
54 |
55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
57 | return YES;
58 | }
59 | return NO;
60 | }];
61 | }
62 |
63 | RCTSetLogFunction(RCTDefaultLogFunction);
64 |
65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
67 | }
68 |
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/EncryptionDemo/EncryptionLibrary.m:
--------------------------------------------------------------------------------
1 | //
2 | // EncryptionLibrary.m
3 | // EncryptionDemo
4 | //
5 | // Created by 江清清 on 16/5/27.
6 | // Copyright © 2016年 Facebook. All rights reserved.
7 | //
8 |
9 | #import "EncryptionLibrary.h"
10 | #import "Tools.h"
11 |
12 | @implementation EncryptionLibrary
13 |
14 |
15 | RCT_EXPORT_MODULE(EncryptionModule)
16 |
17 |
18 | RCT_EXPORT_METHOD(MD5ByCallBack:(NSString *)message callback:(RCTResponseSenderBlock)callback){
19 | NSLog(@"传入的待加密数据为:%@",message);
20 | NSString *result=[Tools MD5:message];
21 | callback(@[[NSNull null],result]);
22 | }
23 |
24 | RCT_EXPORT_METHOD(MD5ByPromise:(NSString*)message
25 | resolver:(RCTPromiseResolveBlock)resolve
26 | rejecter:(RCTPromiseRejectBlock)reject){
27 | NSString *result=[Tools MD5:message];
28 | if(![result isEqualToString:@""]){
29 | resolve(result);
30 | }else{
31 | NSError *error=[NSError errorWithDomain:@"我是Promise回调错误信息..." code:500 userInfo:nil];
32 | reject(@"加密失败",@"加密失败",error);
33 | }
34 | }
35 |
36 | RCT_EXPORT_METHOD(AESEncryptByCallBack:(NSString *)message withKey:(NSString *)encryptKey callback:(RCTResponseSenderBlock)callback){
37 | NSString *result=[Tools AESEncryptString:message withKey:encryptKey];
38 | callback(@[[NSNull null],result ]);
39 | }
40 |
41 | RCT_EXPORT_METHOD(AESEncryptByPromise:(NSString *)message withKey:(NSString *)encryptKey resolver:(RCTPromiseResolveBlock)resolve
42 | rejecter:(RCTPromiseRejectBlock)reject){
43 | NSString *result=[Tools AESEncryptString:message withKey:encryptKey];
44 | if(![result isEqualToString:@""]){
45 | resolve(result);
46 | }else{
47 | NSError *error=[NSError errorWithDomain:@"我是Promise回调错误信息..." code:500 userInfo:nil];
48 | reject(@"加密失败",@"加密失败",error);
49 | }
50 | }
51 |
52 | RCT_EXPORT_METHOD(AESDecryptByCallBack:(NSString *)message withKey:(NSString *)encryptKey callback:(RCTResponseSenderBlock)callback){
53 | NSString *result=[Tools AESDecryptString:message withKey:encryptKey];
54 | callback(@[[NSNull null],result ]);
55 | }
56 |
57 | RCT_EXPORT_METHOD(AESDecryptByPromise:(NSString *)message withKey:(NSString *)encryptKey resolver:(RCTPromiseResolveBlock)resolve
58 | rejecter:(RCTPromiseRejectBlock)reject){
59 | NSString *result=[Tools AESDecryptString:message withKey:encryptKey];
60 | if(![result isEqualToString:@""]){
61 | resolve(result);
62 | }else{
63 | NSError *error=[NSError errorWithDomain:@"我是Promise回调错误信息..." code:500 userInfo:nil];
64 | reject(@"解密失败",@"解密失败",error);
65 | }
66 | }
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/EncryptionDemo/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/index.android.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | StyleSheet,
11 | Text,
12 | View,
13 | TouchableHighlight
14 | } from 'react-native';
15 | import {NativeModules} from 'react-native';
16 | var EncryptionModule=NativeModules.EncryptionModule
17 |
18 | //待加密的信息
19 | var PASSWORD='745r#x3g';
20 | var KEY='wIEuw3kAGwVNl7BW'; //16位AES加密私钥
21 |
22 | class CustomButton extends React.Component {
23 | render() {
24 | return (
25 |
29 | {this.props.text}
30 |
31 | );
32 | }
33 | }
34 | class react_native_encryption_library extends Component {
35 | constructor(props){
36 | super(props);
37 | this.state={
38 | result:'',
39 | AES_Result:'',
40 | }
41 | }
42 | async _MD5ByPromise(){
43 | try{
44 | var result=await EncryptionModule.MD5ByPromise(PASSWORD);
45 | this.setState({result:'Promise:'+result});
46 | }catch(e){
47 | this.setState({result:'MD5加密失败-通过Promise回调'});
48 | }
49 | }
50 | async _AESEncryptByPromise(){
51 | try{
52 | var result=await EncryptionModule.AESEncryptByPromise(PASSWORD,KEY);
53 | this.setState({AES_Result:result});
54 | }catch(e){
55 | this.setState({AES_Result:'AES加密失败-通过Promise回调'});
56 | }
57 | }
58 |
59 | async _AESDecryptByPromise(){
60 | try{
61 | var result=await EncryptionModule.AESDecryptByPromise(this.state.AES_Result,KEY);
62 | this.setState({AES_Result:result});
63 | }catch(e){
64 | this.setState({AES_Result:'AES解密失败-通过Promise回调'});
65 | }
66 | }
67 | render() {
68 | return (
69 |
70 |
71 | 加密模块封装实例-Android端
72 |
73 |
74 | 结果:{this.state.result}
75 |
76 | EncryptionModule.MD5ByCallBack(PASSWORD,(msg)=>{
79 | this.setState({result:'CallBack:'+msg});
80 | },(error)=>{
81 | this.setState({result:'MD5加密失败-通过Callback回调'});
82 | })}
83 | />
84 | this._MD5ByPromise()}
87 | />
88 |
89 | AES结果:{this.state.AES_Result}
90 |
91 | EncryptionModule.AESEncryptByCallBack(PASSWORD,KEY,(msg)=>{
94 | this.setState({AES_Result:msg});
95 | },(error)=>{
96 | this.setState({AES_Result:'AES加密失败-通过Callback回调'});
97 | })}
98 | />
99 | this._AESEncryptByPromise()}
102 | />
103 | EncryptionModule.AESDecryptByCallBack(this.state.AES_Result,KEY,(msg)=>{
106 | this.setState({AES_Result:msg});
107 | },(error)=>{
108 | this.setState({AES_Result:'AES解密失败-通过Callback回调'});
109 | })}
110 | />
111 | this._AESDecryptByPromise()}
114 | />
115 |
116 | );
117 | }
118 | }
119 | const styles = StyleSheet.create({
120 | welcome: {
121 | fontSize: 20,
122 | textAlign: 'center',
123 | margin: 10,
124 | },
125 | button: {
126 | margin:5,
127 | backgroundColor: 'white',
128 | padding: 15,
129 | borderBottomWidth: StyleSheet.hairlineWidth,
130 | borderBottomColor: '#cdcdcd',
131 | },
132 | });
133 |
134 | AppRegistry.registerComponent('encryption_library', () => react_native_encryption_library);
135 |
--------------------------------------------------------------------------------
/android/src/main/java/com/chinaztt/utils/AESTools.java:
--------------------------------------------------------------------------------
1 | package com.chinaztt.utils;
2 |
3 | import org.apache.axis.encoding.Base64;
4 |
5 | import javax.crypto.Cipher;
6 | import javax.crypto.spec.SecretKeySpec;
7 |
8 | /**
9 | * 当前类注释:
10 | * 项目名:android
11 | * 包名:com.chinaztt.utils
12 | * 作者:江清清 on 16/5/26 13:58
13 | * 邮箱:jiangqqlmj@163.com
14 | * QQ: 781931404
15 | * 公司:江苏中天科技软件技术有限公司
16 | * 站点:www.lcode.org
17 | */
18 | public class AESTools {
19 | /**
20 | * 加密--把加密后的byte数组先进行二进制转16进制在进行base64编码
21 | *
22 | * @param sSrc
23 | * @param sKey
24 | * @return
25 | * @throws Exception
26 | */
27 | public static String encrypt(String sSrc, String sKey) throws Exception {
28 | if (sKey == null) {
29 | throw new IllegalArgumentException("Argument sKey is null.");
30 | }
31 | if (sKey.length() != 16) {
32 | throw new IllegalArgumentException(
33 | "Argument sKey'length is not 16.");
34 | }
35 | byte[] raw = sKey.getBytes("ASCII");
36 | SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
37 |
38 | Cipher cipher = Cipher.getInstance("AES");
39 | cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
40 |
41 | byte[] encrypted = cipher.doFinal(sSrc.getBytes("UTF-8"));
42 | String tempStr = parseByte2HexStr(encrypted);
43 | //BASE64Encoder encoder = new BASE64Encoder();
44 | return Base64.encode(tempStr.getBytes("UTF-8"));
45 |
46 |
47 | }
48 |
49 | /**
50 | * 解密--先 进行base64解码,在进行16进制转为2进制然后再解码
51 | *
52 | * @param sSrc
53 | * @param sKey
54 | * @return
55 | * @throws Exception
56 | */
57 | public static String decrypt(String sSrc, String sKey) throws Exception {
58 |
59 | if (sKey == null) {
60 | throw new IllegalArgumentException("499");
61 | }
62 | if (sKey.length() != 16) {
63 | throw new IllegalArgumentException("498");
64 | }
65 |
66 | byte[] raw = sKey.getBytes("ASCII");
67 | SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
68 |
69 | Cipher cipher = Cipher.getInstance("AES");
70 | cipher.init(Cipher.DECRYPT_MODE, skeySpec);
71 |
72 | // Base64Encoder encoder = new Base64Encoder();
73 | byte[] encrypted1 = Base64.decode(sSrc);
74 | String tempStr = new String(encrypted1, "utf-8");
75 | encrypted1 = parseHexStr2Byte(tempStr);
76 | byte[] original = cipher.doFinal(encrypted1);
77 | String originalString = new String(original, "utf-8");
78 | return originalString;
79 | }
80 |
81 | /**
82 | * 将二进制转换成16进制
83 | *
84 | * @param buf
85 | * @return
86 | */
87 | public static String parseByte2HexStr(byte buf[]) {
88 | StringBuffer sb = new StringBuffer();
89 | for (int i = 0; i < buf.length; i++) {
90 | String hex = Integer.toHexString(buf[i] & 0xFF);
91 | if (hex.length() == 1) {
92 | hex = '0' + hex;
93 | }
94 | sb.append(hex.toUpperCase());
95 | }
96 | return sb.toString();
97 | }
98 |
99 | /**
100 | * 将16进制转换为二进制
101 | *
102 | * @param hexStr
103 | * @return
104 | */
105 | public static byte[] parseHexStr2Byte(String hexStr) {
106 | if (hexStr.length() < 1)
107 | return null;
108 | byte[] result = new byte[hexStr.length() / 2];
109 | for (int i = 0; i < hexStr.length() / 2; i++) {
110 | int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
111 | int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2),
112 | 16);
113 | result[i] = (byte) (high * 16 + low);
114 | }
115 | return result;
116 | }
117 |
118 | public static void main(String[] args) throws Exception {
119 | String Code = "jiangqq";
120 | String key = "wIEuw3kAGwVNl7BW";
121 | String codE;
122 | codE = AESTools.encrypt(Code, key);
123 | System.out.println("原文:" + Code);
124 | System.out.println("密钥:" + key);
125 | System.out.println("密文:" + codE);
126 | System.out.println("解密:" + AESTools.decrypt(codE, key));
127 |
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/EncryptionDemo/NSData+Base64.m:
--------------------------------------------------------------------------------
1 | // http://www.wuleilei.com/
2 |
3 | #import "NSData+Base64.h"
4 | #import
5 |
6 | static char encodingTable[64] = {
7 | 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
8 | 'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
9 | 'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
10 | 'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/' };
11 |
12 | @implementation NSData (Base64)
13 |
14 | + (NSData *) dataWithBase64EncodedString:(NSString *) string {
15 | NSData *result = [[NSData alloc] initWithBase64EncodedString:string];
16 | return result;
17 | }
18 |
19 | - (id) initWithBase64EncodedString:(NSString *) string {
20 | NSMutableData *mutableData = nil;
21 |
22 | if( string ) {
23 | unsigned long ixtext = 0;
24 | unsigned long lentext = 0;
25 | unsigned char ch = 0;
26 | unsigned char inbuf[3], outbuf[4];
27 | short i = 0, ixinbuf = 0;
28 | BOOL flignore = NO;
29 | BOOL flendtext = NO;
30 | NSData *base64Data = nil;
31 | const unsigned char *base64Bytes = nil;
32 |
33 | // Convert the string to ASCII data.
34 | base64Data = [string dataUsingEncoding:NSASCIIStringEncoding];
35 | base64Bytes = [base64Data bytes];
36 | mutableData = [NSMutableData dataWithCapacity:[base64Data length]];
37 | lentext = [base64Data length];
38 |
39 | while( YES ) {
40 | if( ixtext >= lentext ) break;
41 | ch = base64Bytes[ixtext++];
42 | flignore = NO;
43 |
44 | if( ( ch >= 'A' ) && ( ch <= 'Z' ) ) ch = ch - 'A';
45 | else if( ( ch >= 'a' ) && ( ch <= 'z' ) ) ch = ch - 'a' + 26;
46 | else if( ( ch >= '0' ) && ( ch <= '9' ) ) ch = ch - '0' + 52;
47 | else if( ch == '+' ) ch = 62;
48 | else if( ch == '=' ) flendtext = YES;
49 | else if( ch == '/' ) ch = 63;
50 | else flignore = YES;
51 |
52 | if( ! flignore ) {
53 | short ctcharsinbuf = 3;
54 | BOOL flbreak = NO;
55 |
56 | if( flendtext ) {
57 | if( ! ixinbuf ) break;
58 | if( ( ixinbuf == 1 ) || ( ixinbuf == 2 ) ) ctcharsinbuf = 1;
59 | else ctcharsinbuf = 2;
60 | ixinbuf = 3;
61 | flbreak = YES;
62 | }
63 |
64 | inbuf [ixinbuf++] = ch;
65 |
66 | if( ixinbuf == 4 ) {
67 | ixinbuf = 0;
68 | outbuf [0] = ( inbuf[0] << 2 ) | ( ( inbuf[1] & 0x30) >> 4 );
69 | outbuf [1] = ( ( inbuf[1] & 0x0F ) << 4 ) | ( ( inbuf[2] & 0x3C ) >> 2 );
70 | outbuf [2] = ( ( inbuf[2] & 0x03 ) << 6 ) | ( inbuf[3] & 0x3F );
71 |
72 | for( i = 0; i < ctcharsinbuf; i++ )
73 | [mutableData appendBytes:&outbuf[i] length:1];
74 | }
75 |
76 | if( flbreak ) break;
77 | }
78 | }
79 | }
80 |
81 | self = [self initWithData:mutableData];
82 | return self;
83 | }
84 |
85 | - (NSString *) base64EncodingWithLineLength:(unsigned int) lineLength {
86 | const unsigned char *bytes = [self bytes];
87 | NSMutableString *result = [NSMutableString stringWithCapacity:[self length]];
88 | unsigned long ixtext = 0;
89 | unsigned long lentext = [self length];
90 | long ctremaining = 0;
91 | unsigned char inbuf[3], outbuf[4];
92 | short i = 0;
93 | short charsonline = 0, ctcopy = 0;
94 | unsigned long ix = 0;
95 |
96 | while( YES ) {
97 | ctremaining = lentext - ixtext;
98 | if( ctremaining <= 0 ) break;
99 |
100 | for( i = 0; i < 3; i++ ) {
101 | ix = ixtext + i;
102 | if( ix < lentext ) inbuf[i] = bytes[ix];
103 | else inbuf [i] = 0;
104 | }
105 |
106 | outbuf [0] = (inbuf [0] & 0xFC) >> 2;
107 | outbuf [1] = ((inbuf [0] & 0x03) << 4) | ((inbuf [1] & 0xF0) >> 4);
108 | outbuf [2] = ((inbuf [1] & 0x0F) << 2) | ((inbuf [2] & 0xC0) >> 6);
109 | outbuf [3] = inbuf [2] & 0x3F;
110 | ctcopy = 4;
111 |
112 | switch( ctremaining ) {
113 | case 1:
114 | ctcopy = 2;
115 | break;
116 | case 2:
117 | ctcopy = 3;
118 | break;
119 | }
120 |
121 | for( i = 0; i < ctcopy; i++ )
122 | [result appendFormat:@"%c", encodingTable[outbuf[i]]];
123 |
124 | for( i = ctcopy; i < 4; i++ )
125 | [result appendFormat:@"%c",'='];
126 |
127 | ixtext += 3;
128 | charsonline += 4;
129 |
130 | if( lineLength > 0 ) {
131 | if (charsonline >= lineLength) {
132 | charsonline = 0;
133 | [result appendString:@"\n"];
134 | }
135 | }
136 | }
137 |
138 | return result;
139 | }
140 |
141 | @end
142 |
--------------------------------------------------------------------------------
/android/src/main/java/com/chinaztt/encapsulation/EncryptionModule.java:
--------------------------------------------------------------------------------
1 | package com.chinaztt.encapsulation;
2 |
3 | import android.util.Log;
4 |
5 | import com.chinaztt.utils.AESTools;
6 | import com.chinaztt.utils.MD5Tools;
7 | import com.facebook.react.bridge.Callback;
8 | import com.facebook.react.bridge.Promise;
9 | import com.facebook.react.bridge.ReactApplicationContext;
10 | import com.facebook.react.bridge.ReactContextBaseJavaModule;
11 | import com.facebook.react.bridge.ReactMethod;
12 |
13 | /**
14 | * 当前类注释:
15 | * 项目名:android
16 | * 包名:com.chinaztt.encapsulation
17 | * 作者:江清清 on 16/5/26 14:03
18 | * 邮箱:jiangqqlmj@163.com
19 | * QQ: 781931404
20 | * 公司:江苏中天科技软件技术有限公司
21 | * 站点:www.lcode.org
22 | */
23 | public class EncryptionModule extends ReactContextBaseJavaModule {
24 |
25 | public EncryptionModule(ReactApplicationContext reactContext) {
26 | super(reactContext);
27 | }
28 |
29 | @Override
30 | public String getName() {
31 | return "EncryptionModule";
32 | }
33 |
34 | /**
35 | * 对传入的数据进行MD5加密 然后通过CallBack方法回调到JS端
36 | * @param encryptionMsg 待加密数据
37 | * @param successBack
38 | * @param errorBack
39 | */
40 | @ReactMethod
41 | public void MD5ByCallBack(String encryptionMsg, Callback successBack,Callback errorBack){
42 | try {
43 | String result=MD5Tools.MD5(encryptionMsg);
44 | successBack.invoke(result);
45 | }catch (Exception e){
46 | errorBack.invoke(e.getMessage());
47 | e.printStackTrace();
48 | }
49 | }
50 | /**
51 | * 对传入的数据进行MD5加密 然后通过Promise方法回调到JS端
52 | * @param encryptionMsg
53 | * @param promise
54 | */
55 | @ReactMethod
56 | public void MD5ByPromise(String encryptionMsg, Promise promise){
57 | try {
58 | String result=MD5Tools.MD5(encryptionMsg);
59 | promise.resolve(result);
60 | }catch (Exception e){
61 | promise.reject(e);
62 | e.printStackTrace();
63 |
64 |
65 | }
66 | }
67 |
68 | /**
69 | * 对传入的待加密数据和秘钥进行加密,然后通过CallBack返回结果
70 | * @param encryptionMsg
71 | * @param encryptionKey
72 | * @param successBack
73 | * @param errorBack
74 | */
75 | @ReactMethod
76 | public void AESEncryptByCallBack(String encryptionMsg,String encryptionKey,Callback successBack,Callback errorBack){
77 | try {
78 | String result= AESTools.encrypt(encryptionMsg, encryptionKey);
79 | successBack.invoke(result);
80 | }catch (Exception e){
81 | errorBack.invoke(e.getMessage());
82 | e.printStackTrace();
83 | }
84 | }
85 |
86 | /**
87 | * 对传入的待加密数据和秘钥进行加密,然后通过Promise返回结果
88 | * @param encryptionMsg
89 | * @param encryptionKey
90 | * @param promise
91 | */
92 | @ReactMethod
93 | public void AESEncryptByPromise(String encryptionMsg,String encryptionKey,Promise promise){
94 | try {
95 | String result=AESTools.encrypt(encryptionMsg, encryptionKey);
96 | promise.resolve(result);
97 | }catch (Exception e){
98 | promise.reject(e);
99 | e.printStackTrace();
100 | }
101 | }
102 |
103 | /**
104 | * 对传入的加密数据和秘钥进行解密,然后通过CallBack返回结果
105 | * @param encryptionMsg
106 | * @param encryptionKey
107 | * @param successBack
108 | * @param errorBack
109 | */
110 | @ReactMethod
111 | public void AESDecryptByCallBack(String encryptionMsg,String encryptionKey,Callback successBack,Callback errorBack){
112 | try {
113 | Log.d("zttjiangqq","传入的数据为:"+encryptionMsg);
114 | String result= AESTools.decrypt(encryptionMsg, encryptionKey);
115 | successBack.invoke(result);
116 | }catch (Exception e){
117 | errorBack.invoke(e.getMessage());
118 | e.printStackTrace();
119 | }
120 | }
121 |
122 | /**
123 | * 对传入的加密数据和秘钥进行解密,然后通过Promise返回结果
124 | * @param encryptionMsg
125 | * @param encryptionKey
126 | * @param promise
127 | */
128 | @ReactMethod
129 | public void AESDecryptByPromise(String encryptionMsg,String encryptionKey,Promise promise){
130 | try {
131 | Log.d("zttjiangqq","传入的数据为:"+encryptionMsg);
132 | String result= AESTools.decrypt(encryptionMsg, encryptionKey);
133 | promise.resolve(result);
134 | }catch (Exception e){
135 | promise.reject(e);
136 | e.printStackTrace();
137 | }
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/EncryptionDemo.xcodeproj/xcshareddata/xcschemes/EncryptionDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/EncryptionDemo/StringEncryption.m:
--------------------------------------------------------------------------------
1 | // http://www.wuleilei.com/
2 |
3 | #import "StringEncryption.h"
4 | #import "NSData+Base64.h"
5 |
6 | //#define kEncryptKey @"wIEuw3kAGwVNl7BW" // 加密用的key wIEuw3kAGwVNl7BWCdmptuL6tAIjNcAq
7 |
8 | #if DEBUG
9 | #define LOGGING_FACILITY(X, Y) \
10 | NSAssert(X, Y);
11 |
12 | #define LOGGING_FACILITY1(X, Y, Z) \
13 | NSAssert1(X, Y, Z);
14 | #else
15 | #define LOGGING_FACILITY(X, Y) \
16 | if(!(X)) { \
17 | ZTTLog(Y); \
18 | exit(-1); \
19 | }
20 |
21 | #define LOGGING_FACILITY1(X, Y, Z) \
22 | if(!(X)) { \
23 | ZTTLog(Y, Z); \
24 | exit(-1); \
25 | }
26 | #endif
27 |
28 | @implementation StringEncryption
29 |
30 | CCOptions _padding = kCCOptionPKCS7Padding;
31 |
32 | + (NSString *)encryptString:(NSString *)plainSourceStringToEncrypt withKey:(NSString *)encryptKey
33 | {
34 |
35 | NSData *_secretData = [plainSourceStringToEncrypt dataUsingEncoding:NSASCIIStringEncoding];
36 |
37 | // You can use md5 to make sure key is 16 bits long
38 | NSData *encryptedData = [self encrypt:_secretData withKey:encryptKey];
39 |
40 | return [encryptedData base64EncodingWithLineLength:0];
41 | }
42 |
43 | + (NSString *)decryptString:(NSString *)base64StringToDecrypt withKey:(NSString *)encryptKey
44 | {
45 | NSData *data = [StringEncryption decrypt:[NSData dataWithBase64EncodedString:base64StringToDecrypt] withKey:encryptKey];
46 | return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
47 | }
48 |
49 | + (NSData *)encrypt:(NSData *)plainText withKey:(NSString *)encryptKey
50 | {
51 | return [self doCipher:plainText context:kCCEncrypt withKey:encryptKey];
52 | }
53 |
54 | + (NSData *)decrypt:(NSData *)plainText withKey:(NSString *)encryptKey
55 | {
56 | return [self doCipher:plainText context:kCCDecrypt withKey:encryptKey];
57 | }
58 |
59 | + (NSData *)doCipher:(NSData *)plainText context:(CCOperation)encryptOrDecrypt withKey:(NSString *)encryptKey
60 | {
61 | CCCryptorStatus ccStatus = kCCSuccess;
62 | // Symmetric crypto reference.
63 | CCCryptorRef thisEncipher = NULL;
64 | // Cipher Text container.
65 | NSData * cipherOrPlainText = nil;
66 | // Pointer to output buffer.
67 | uint8_t * bufferPtr = NULL;
68 | // Total size of the buffer.
69 | size_t bufferPtrSize = 0;
70 | // Remaining bytes to be performed on.
71 | size_t remainingBytes = 0;
72 | // Number of bytes moved to buffer.
73 | size_t movedBytes = 0;
74 | // Length of plainText buffer.
75 | size_t plainTextBufferSize = 0;
76 | // Placeholder for total written.
77 | size_t totalBytesWritten = 0;
78 | // A friendly helper pointer.
79 | uint8_t * ptr;
80 | CCOptions *pkcs7;
81 | pkcs7 = &_padding;
82 | NSData *aSymmetricKey = [encryptKey dataUsingEncoding:NSUTF8StringEncoding];
83 |
84 | // Initialization vector; dummy in this case 0's.
85 | uint8_t iv[kChosenCipherBlockSize];
86 | memset((void *) iv, 0x0, (size_t) sizeof(iv));
87 |
88 | plainTextBufferSize = [plainText length];
89 |
90 | // We don't want to toss padding on if we don't need to
91 | if(encryptOrDecrypt == kCCEncrypt) {
92 | if(*pkcs7 != kCCOptionECBMode) {
93 | if((plainTextBufferSize % kChosenCipherBlockSize) == 0) {
94 | *pkcs7 = 0x0000;
95 | } else {
96 | *pkcs7 = kCCOptionPKCS7Padding;
97 | }
98 | }
99 | } else if(encryptOrDecrypt != kCCDecrypt) {
100 | // ZTTLog(@"Invalid CCOperation parameter [%d] for cipher context.", *pkcs7 );
101 | }
102 |
103 | // Create and Initialize the crypto reference.
104 | ccStatus = CCCryptorCreate(encryptOrDecrypt,
105 | kCCAlgorithmAES128,
106 | *pkcs7,
107 | (const void *)[aSymmetricKey bytes],
108 | kChosenCipherKeySize,
109 | (const void *)iv,
110 | &thisEncipher
111 | );
112 |
113 | // Calculate byte block alignment for all calls through to and including final.
114 | bufferPtrSize = CCCryptorGetOutputLength(thisEncipher, plainTextBufferSize, true);
115 |
116 | // Allocate buffer.
117 | bufferPtr = malloc( bufferPtrSize * sizeof(uint8_t) );
118 |
119 | // Zero out buffer.
120 | memset((void *)bufferPtr, 0x0, bufferPtrSize);
121 |
122 | // Initialize some necessary book keeping.
123 | ptr = bufferPtr;
124 |
125 | // Set up initial size.
126 | remainingBytes = bufferPtrSize;
127 |
128 | // Actually perform the encryption or decryption.
129 | ccStatus = CCCryptorUpdate(thisEncipher,
130 | (const void *) [plainText bytes],
131 | plainTextBufferSize,
132 | ptr,
133 | remainingBytes,
134 | &movedBytes
135 | );
136 |
137 | // Handle book keeping.
138 | ptr += movedBytes;
139 | remainingBytes -= movedBytes;
140 | totalBytesWritten += movedBytes;
141 |
142 | // Finalize everything to the output buffer.
143 | ccStatus = CCCryptorFinal(thisEncipher,
144 | ptr,
145 | remainingBytes,
146 | &movedBytes
147 | );
148 |
149 | totalBytesWritten += movedBytes;
150 |
151 | if(thisEncipher) {
152 | (void) CCCryptorRelease(thisEncipher);
153 | thisEncipher = NULL;
154 | }
155 |
156 | if (ccStatus == kCCSuccess)
157 | cipherOrPlainText = [NSData dataWithBytes:(const void *)bufferPtr length:(NSUInteger)totalBytesWritten];
158 | else
159 | cipherOrPlainText = nil;
160 |
161 | if(bufferPtr) free(bufferPtr);
162 |
163 | return cipherOrPlainText;
164 | }
165 |
166 | @end
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ###当前项目封装了常用的加密方式例如:MD5,AES,DES加密,供React Native进行使用,不过当前项目适配Android平台。
2 | htt://www.lcode.org主要讲解了React Native开发,由基础环境搭建配置入门,基础,进阶相关讲解。
3 | ### Installation
4 | ```bash
5 | npm install react-native-encryption-library --save
6 | ```
7 | * In `android/setting.gradle`
8 |
9 | ```gradle
10 | ...
11 | include ':react-native-encryption-library'
12 | project(':react-native-encryption-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-encryption-library/android')
13 | ```
14 |
15 | * In `android/app/build.gradle`
16 |
17 | ```gradle
18 | ...
19 | dependencies {
20 | ...
21 | compile project(':react-native-encryption-library')
22 | }
23 | ```
24 |
25 | * register module (in MainActivity.java)
26 |
27 | On newer versions of React Native (0.18+):
28 | ```java
29 | import com.chinaztt.encapsulation.EncryptionReactPackager;; // <--- import
30 |
31 | public class MainActivity extends ReactActivity {
32 | ......
33 | @Override
34 | protected List getPackages() {
35 | return Arrays.asList(
36 | new EncryptionReactPackager(), // <------ add here
37 | new MainReactPackage());
38 | }
39 | }
40 | ```
41 |
42 | On older versions of React Native:
43 | ```java
44 | import com.chinaztt.encapsulation.EncryptionReactPackager;; // <--- import
45 |
46 | public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
47 | ......
48 |
49 | @Override
50 | protected void onCreate(Bundle savedInstanceState) {
51 | super.onCreate(savedInstanceState);
52 | mReactRootView = new ReactRootView(this);
53 |
54 | mReactInstanceManager = ReactInstanceManager.builder()
55 | .setApplication(getApplication())
56 | .setBundleAssetName("index.android.bundle")
57 | .setJSMainModuleName("index.android")
58 | .addPackage(new MainReactPackage())
59 | .addPackage( new EncryptionReactPackager()) // <------ add here
60 | .setUseDeveloperSupport(BuildConfig.DEBUG)
61 | .setInitialLifecycleState(LifecycleState.RESUMED)
62 | .build();
63 |
64 | mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
65 |
66 | setContentView(mReactRootView);
67 | }
68 |
69 | ......
70 |
71 | }
72 | ```
73 |
74 | ### Usage
75 |
76 | First, require it from your app's JavaScript files with:
77 | ```bash
78 | import {NativeModules} from 'react-native';
79 | var EncryptionModule=NativeModules.EncryptionModule
80 | ```
81 |
82 |
83 | ### Example
84 |
85 | ```js
86 | import React, { Component } from 'react';
87 | import {
88 | AppRegistry,
89 | StyleSheet,
90 | Text,
91 | View,
92 | TouchableHighlight
93 | } from 'react-native';
94 | import {NativeModules} from 'react-native';
95 | var EncryptionModule=NativeModules.EncryptionModule
96 |
97 | //待加密的信息
98 | var PASSWORD='745r#x3g';
99 | var KEY='wIEuw3kAGwVNl7BW'; //16位AES加密私钥
100 |
101 | class CustomButton extends React.Component {
102 | render() {
103 | return (
104 |
108 | {this.props.text}
109 |
110 | );
111 | }
112 | }
113 | class react_native_encryption_library extends Component {
114 | constructor(props){
115 | super(props);
116 | this.state={
117 | result:'',
118 | AES_Result:'',
119 | }
120 | }
121 | async _MD5ByPromise(){
122 | try{
123 | var result=await EncryptionModule.MD5ByPromise(PASSWORD);
124 | this.setState({result:'Promise:'+result});
125 | }catch(e){
126 | this.setState({result:'MD5加密失败-通过Promise回调'});
127 | }
128 | }
129 | async _AESEncryptByPromise(){
130 | try{
131 | var result=await EncryptionModule.AESEncryptByPromise(PASSWORD,KEY);
132 | this.setState({AES_Result:result});
133 | }catch(e){
134 | this.setState({AES_Result:'AES加密失败-通过Promise回调'});
135 | }
136 | }
137 |
138 | async _AESDecryptByPromise(){
139 | try{
140 | var result=await EncryptionModule.AESDecryptByPromise(this.state.AES_Result,KEY);
141 | this.setState({AES_Result:result});
142 | }catch(e){
143 | this.setState({AES_Result:'AES解密失败-通过Promise回调'});
144 | }
145 | }
146 | render() {
147 | return (
148 |
149 |
150 | 加密模块封装实例-Android端
151 |
152 |
153 | 结果:{this.state.result}
154 |
155 | EncryptionModule.MD5ByCallBack(PASSWORD,(msg)=>{
158 | this.setState({result:'CallBack:'+msg});
159 | },(error)=>{
160 | this.setState({result:'MD5加密失败-通过Callback回调'});
161 | })}
162 | />
163 | this._MD5ByPromise()}
166 | />
167 |
168 | AES结果:{this.state.AES_Result}
169 |
170 | EncryptionModule.AESEncryptByCallBack(PASSWORD,KEY,(msg)=>{
173 | this.setState({AES_Result:msg});
174 | },(error)=>{
175 | this.setState({AES_Result:'AES加密失败-通过Callback回调'});
176 | })}
177 | />
178 | this._AESEncryptByPromise()}
181 | />
182 | EncryptionModule.AESDecryptByCallBack(this.state.AES_Result,KEY,(msg)=>{
185 | this.setState({AES_Result:msg});
186 | },(error)=>{
187 | this.setState({AES_Result:'AES解密失败-通过Callback回调'});
188 | })}
189 | />
190 | this._AESDecryptByPromise()}
193 | />
194 |
195 | );
196 | }
197 | }
198 | const styles = StyleSheet.create({
199 | welcome: {
200 | fontSize: 20,
201 | textAlign: 'center',
202 | margin: 10,
203 | },
204 | button: {
205 | margin:5,
206 | backgroundColor: 'white',
207 | padding: 15,
208 | borderBottomWidth: StyleSheet.hairlineWidth,
209 | borderBottomColor: '#cdcdcd',
210 | },
211 | });
212 | AppRegistry.registerComponent('encryption_library', () => react_native_encryption_library);
213 | ```
214 | ###Screenshot
215 | 
216 |
217 |
--------------------------------------------------------------------------------
/android/react-native-encryption-library.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | generateDebugSources
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
--------------------------------------------------------------------------------
/EncryptionDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15 | 00E356F31AD99517003FC87E /* EncryptionDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* EncryptionDemoTests.m */; };
16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
25 | CA1BAD7E1CF81F9D00A2F883 /* Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = CA1BAD7D1CF81F9D00A2F883 /* Tools.m */; };
26 | CA1BAD871CF81FAA00A2F883 /* EncryptionLibrary.m in Sources */ = {isa = PBXBuildFile; fileRef = CA1BAD801CF81FAA00A2F883 /* EncryptionLibrary.m */; };
27 | CA1BAD881CF81FAA00A2F883 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = CA1BAD821CF81FAA00A2F883 /* NSData+Base64.m */; };
28 | CA1BAD891CF81FAA00A2F883 /* StringEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = CA1BAD841CF81FAA00A2F883 /* StringEncryption.m */; };
29 | CA1BAD8A1CF81FAA00A2F883 /* StringEncryptioned.m in Sources */ = {isa = PBXBuildFile; fileRef = CA1BAD861CF81FAA00A2F883 /* StringEncryptioned.m */; };
30 | /* End PBXBuildFile section */
31 |
32 | /* Begin PBXContainerItemProxy section */
33 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
34 | isa = PBXContainerItemProxy;
35 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
36 | proxyType = 2;
37 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
38 | remoteInfo = RCTActionSheet;
39 | };
40 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {
41 | isa = PBXContainerItemProxy;
42 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
43 | proxyType = 2;
44 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
45 | remoteInfo = RCTGeolocation;
46 | };
47 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {
48 | isa = PBXContainerItemProxy;
49 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
50 | proxyType = 2;
51 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
52 | remoteInfo = RCTImage;
53 | };
54 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {
55 | isa = PBXContainerItemProxy;
56 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
57 | proxyType = 2;
58 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
59 | remoteInfo = RCTNetwork;
60 | };
61 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {
62 | isa = PBXContainerItemProxy;
63 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
64 | proxyType = 2;
65 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
66 | remoteInfo = RCTVibration;
67 | };
68 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
69 | isa = PBXContainerItemProxy;
70 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
71 | proxyType = 1;
72 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
73 | remoteInfo = EncryptionDemo;
74 | };
75 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
76 | isa = PBXContainerItemProxy;
77 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
78 | proxyType = 2;
79 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
80 | remoteInfo = RCTSettings;
81 | };
82 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {
83 | isa = PBXContainerItemProxy;
84 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
85 | proxyType = 2;
86 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
87 | remoteInfo = RCTWebSocket;
88 | };
89 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
90 | isa = PBXContainerItemProxy;
91 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
92 | proxyType = 2;
93 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
94 | remoteInfo = React;
95 | };
96 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
97 | isa = PBXContainerItemProxy;
98 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
99 | proxyType = 2;
100 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
101 | remoteInfo = RCTLinking;
102 | };
103 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
104 | isa = PBXContainerItemProxy;
105 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
106 | proxyType = 2;
107 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
108 | remoteInfo = RCTText;
109 | };
110 | /* End PBXContainerItemProxy section */
111 |
112 | /* Begin PBXFileReference section */
113 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
114 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; };
115 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; };
116 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; };
117 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; };
118 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; };
119 | 00E356EE1AD99517003FC87E /* EncryptionDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EncryptionDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
120 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
121 | 00E356F21AD99517003FC87E /* EncryptionDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EncryptionDemoTests.m; sourceTree = ""; };
122 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; };
123 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; };
124 | 13B07F961A680F5B00A75B9A /* EncryptionDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EncryptionDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
125 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = EncryptionDemo/AppDelegate.h; sourceTree = ""; };
126 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = EncryptionDemo/AppDelegate.m; sourceTree = ""; };
127 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
128 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = EncryptionDemo/Images.xcassets; sourceTree = ""; };
129 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = EncryptionDemo/Info.plist; sourceTree = ""; };
130 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = EncryptionDemo/main.m; sourceTree = ""; };
131 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; };
132 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; };
133 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
134 | CA1BAD7C1CF81F9D00A2F883 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tools.h; path = EncryptionDemo/Tools.h; sourceTree = ""; };
135 | CA1BAD7D1CF81F9D00A2F883 /* Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Tools.m; path = EncryptionDemo/Tools.m; sourceTree = ""; };
136 | CA1BAD7F1CF81FAA00A2F883 /* EncryptionLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EncryptionLibrary.h; path = EncryptionDemo/EncryptionLibrary.h; sourceTree = ""; };
137 | CA1BAD801CF81FAA00A2F883 /* EncryptionLibrary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EncryptionLibrary.m; path = EncryptionDemo/EncryptionLibrary.m; sourceTree = ""; };
138 | CA1BAD811CF81FAA00A2F883 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+Base64.h"; path = "EncryptionDemo/NSData+Base64.h"; sourceTree = ""; };
139 | CA1BAD821CF81FAA00A2F883 /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSData+Base64.m"; path = "EncryptionDemo/NSData+Base64.m"; sourceTree = ""; };
140 | CA1BAD831CF81FAA00A2F883 /* StringEncryption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringEncryption.h; path = EncryptionDemo/StringEncryption.h; sourceTree = ""; };
141 | CA1BAD841CF81FAA00A2F883 /* StringEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StringEncryption.m; path = EncryptionDemo/StringEncryption.m; sourceTree = ""; };
142 | CA1BAD851CF81FAA00A2F883 /* StringEncryptioned.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringEncryptioned.h; path = EncryptionDemo/StringEncryptioned.h; sourceTree = ""; };
143 | CA1BAD861CF81FAA00A2F883 /* StringEncryptioned.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StringEncryptioned.m; path = EncryptionDemo/StringEncryptioned.m; sourceTree = ""; };
144 | /* End PBXFileReference section */
145 |
146 | /* Begin PBXFrameworksBuildPhase section */
147 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
148 | isa = PBXFrameworksBuildPhase;
149 | buildActionMask = 2147483647;
150 | files = (
151 | );
152 | runOnlyForDeploymentPostprocessing = 0;
153 | };
154 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
155 | isa = PBXFrameworksBuildPhase;
156 | buildActionMask = 2147483647;
157 | files = (
158 | 146834051AC3E58100842450 /* libReact.a in Frameworks */,
159 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
160 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
161 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
162 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
163 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
164 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
165 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
166 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
167 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
168 | );
169 | runOnlyForDeploymentPostprocessing = 0;
170 | };
171 | /* End PBXFrameworksBuildPhase section */
172 |
173 | /* Begin PBXGroup section */
174 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = {
175 | isa = PBXGroup;
176 | children = (
177 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,
178 | );
179 | name = Products;
180 | sourceTree = "";
181 | };
182 | 00C302B61ABCB90400DB3ED1 /* Products */ = {
183 | isa = PBXGroup;
184 | children = (
185 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,
186 | );
187 | name = Products;
188 | sourceTree = "";
189 | };
190 | 00C302BC1ABCB91800DB3ED1 /* Products */ = {
191 | isa = PBXGroup;
192 | children = (
193 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,
194 | );
195 | name = Products;
196 | sourceTree = "";
197 | };
198 | 00C302D41ABCB9D200DB3ED1 /* Products */ = {
199 | isa = PBXGroup;
200 | children = (
201 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,
202 | );
203 | name = Products;
204 | sourceTree = "";
205 | };
206 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = {
207 | isa = PBXGroup;
208 | children = (
209 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,
210 | );
211 | name = Products;
212 | sourceTree = "";
213 | };
214 | 00E356EF1AD99517003FC87E /* EncryptionDemoTests */ = {
215 | isa = PBXGroup;
216 | children = (
217 | 00E356F21AD99517003FC87E /* EncryptionDemoTests.m */,
218 | 00E356F01AD99517003FC87E /* Supporting Files */,
219 | );
220 | path = EncryptionDemoTests;
221 | sourceTree = "";
222 | };
223 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
224 | isa = PBXGroup;
225 | children = (
226 | 00E356F11AD99517003FC87E /* Info.plist */,
227 | );
228 | name = "Supporting Files";
229 | sourceTree = "";
230 | };
231 | 139105B71AF99BAD00B5F7CC /* Products */ = {
232 | isa = PBXGroup;
233 | children = (
234 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
235 | );
236 | name = Products;
237 | sourceTree = "";
238 | };
239 | 139FDEE71B06529A00C62182 /* Products */ = {
240 | isa = PBXGroup;
241 | children = (
242 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
243 | );
244 | name = Products;
245 | sourceTree = "";
246 | };
247 | 13B07FAE1A68108700A75B9A /* EncryptionDemo */ = {
248 | isa = PBXGroup;
249 | children = (
250 | CA77E3061CF7E2EE00015E2D /* Module */,
251 | CA77E2EE1CF7E08000015E2D /* Tools */,
252 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
253 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
254 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
255 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
256 | 13B07FB61A68108700A75B9A /* Info.plist */,
257 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
258 | 13B07FB71A68108700A75B9A /* main.m */,
259 | );
260 | name = EncryptionDemo;
261 | sourceTree = "";
262 | };
263 | 146834001AC3E56700842450 /* Products */ = {
264 | isa = PBXGroup;
265 | children = (
266 | 146834041AC3E56700842450 /* libReact.a */,
267 | );
268 | name = Products;
269 | sourceTree = "";
270 | };
271 | 78C398B11ACF4ADC00677621 /* Products */ = {
272 | isa = PBXGroup;
273 | children = (
274 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
275 | );
276 | name = Products;
277 | sourceTree = "";
278 | };
279 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
280 | isa = PBXGroup;
281 | children = (
282 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
283 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
284 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
285 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
286 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
287 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
288 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
289 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
290 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
291 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
292 | );
293 | name = Libraries;
294 | sourceTree = "";
295 | };
296 | 832341B11AAA6A8300B99B32 /* Products */ = {
297 | isa = PBXGroup;
298 | children = (
299 | 832341B51AAA6A8300B99B32 /* libRCTText.a */,
300 | );
301 | name = Products;
302 | sourceTree = "";
303 | };
304 | 83CBB9F61A601CBA00E9B192 = {
305 | isa = PBXGroup;
306 | children = (
307 | 13B07FAE1A68108700A75B9A /* EncryptionDemo */,
308 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
309 | 00E356EF1AD99517003FC87E /* EncryptionDemoTests */,
310 | 83CBBA001A601CBA00E9B192 /* Products */,
311 | );
312 | indentWidth = 2;
313 | sourceTree = "";
314 | tabWidth = 2;
315 | };
316 | 83CBBA001A601CBA00E9B192 /* Products */ = {
317 | isa = PBXGroup;
318 | children = (
319 | 13B07F961A680F5B00A75B9A /* EncryptionDemo.app */,
320 | 00E356EE1AD99517003FC87E /* EncryptionDemoTests.xctest */,
321 | );
322 | name = Products;
323 | sourceTree = "";
324 | };
325 | CA77E2EE1CF7E08000015E2D /* Tools */ = {
326 | isa = PBXGroup;
327 | children = (
328 | CA1BAD7C1CF81F9D00A2F883 /* Tools.h */,
329 | CA1BAD7D1CF81F9D00A2F883 /* Tools.m */,
330 | );
331 | name = Tools;
332 | sourceTree = "";
333 | };
334 | CA77E3061CF7E2EE00015E2D /* Module */ = {
335 | isa = PBXGroup;
336 | children = (
337 | CA1BAD7F1CF81FAA00A2F883 /* EncryptionLibrary.h */,
338 | CA1BAD801CF81FAA00A2F883 /* EncryptionLibrary.m */,
339 | CA1BAD811CF81FAA00A2F883 /* NSData+Base64.h */,
340 | CA1BAD821CF81FAA00A2F883 /* NSData+Base64.m */,
341 | CA1BAD831CF81FAA00A2F883 /* StringEncryption.h */,
342 | CA1BAD841CF81FAA00A2F883 /* StringEncryption.m */,
343 | CA1BAD851CF81FAA00A2F883 /* StringEncryptioned.h */,
344 | CA1BAD861CF81FAA00A2F883 /* StringEncryptioned.m */,
345 | );
346 | name = Module;
347 | sourceTree = "";
348 | };
349 | /* End PBXGroup section */
350 |
351 | /* Begin PBXNativeTarget section */
352 | 00E356ED1AD99517003FC87E /* EncryptionDemoTests */ = {
353 | isa = PBXNativeTarget;
354 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "EncryptionDemoTests" */;
355 | buildPhases = (
356 | 00E356EA1AD99517003FC87E /* Sources */,
357 | 00E356EB1AD99517003FC87E /* Frameworks */,
358 | 00E356EC1AD99517003FC87E /* Resources */,
359 | );
360 | buildRules = (
361 | );
362 | dependencies = (
363 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
364 | );
365 | name = EncryptionDemoTests;
366 | productName = EncryptionDemoTests;
367 | productReference = 00E356EE1AD99517003FC87E /* EncryptionDemoTests.xctest */;
368 | productType = "com.apple.product-type.bundle.unit-test";
369 | };
370 | 13B07F861A680F5B00A75B9A /* EncryptionDemo */ = {
371 | isa = PBXNativeTarget;
372 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "EncryptionDemo" */;
373 | buildPhases = (
374 | 13B07F871A680F5B00A75B9A /* Sources */,
375 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
376 | 13B07F8E1A680F5B00A75B9A /* Resources */,
377 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
378 | );
379 | buildRules = (
380 | );
381 | dependencies = (
382 | );
383 | name = EncryptionDemo;
384 | productName = "Hello World";
385 | productReference = 13B07F961A680F5B00A75B9A /* EncryptionDemo.app */;
386 | productType = "com.apple.product-type.application";
387 | };
388 | /* End PBXNativeTarget section */
389 |
390 | /* Begin PBXProject section */
391 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
392 | isa = PBXProject;
393 | attributes = {
394 | LastUpgradeCheck = 0610;
395 | ORGANIZATIONNAME = Facebook;
396 | TargetAttributes = {
397 | 00E356ED1AD99517003FC87E = {
398 | CreatedOnToolsVersion = 6.2;
399 | TestTargetID = 13B07F861A680F5B00A75B9A;
400 | };
401 | };
402 | };
403 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "EncryptionDemo" */;
404 | compatibilityVersion = "Xcode 3.2";
405 | developmentRegion = English;
406 | hasScannedForEncodings = 0;
407 | knownRegions = (
408 | en,
409 | Base,
410 | );
411 | mainGroup = 83CBB9F61A601CBA00E9B192;
412 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
413 | projectDirPath = "";
414 | projectReferences = (
415 | {
416 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
417 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
418 | },
419 | {
420 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
421 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
422 | },
423 | {
424 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;
425 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
426 | },
427 | {
428 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */;
429 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
430 | },
431 | {
432 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
433 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
434 | },
435 | {
436 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
437 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
438 | },
439 | {
440 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
441 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
442 | },
443 | {
444 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;
445 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
446 | },
447 | {
448 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
449 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
450 | },
451 | {
452 | ProductGroup = 146834001AC3E56700842450 /* Products */;
453 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
454 | },
455 | );
456 | projectRoot = "";
457 | targets = (
458 | 13B07F861A680F5B00A75B9A /* EncryptionDemo */,
459 | 00E356ED1AD99517003FC87E /* EncryptionDemoTests */,
460 | );
461 | };
462 | /* End PBXProject section */
463 |
464 | /* Begin PBXReferenceProxy section */
465 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
466 | isa = PBXReferenceProxy;
467 | fileType = archive.ar;
468 | path = libRCTActionSheet.a;
469 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;
470 | sourceTree = BUILT_PRODUCTS_DIR;
471 | };
472 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {
473 | isa = PBXReferenceProxy;
474 | fileType = archive.ar;
475 | path = libRCTGeolocation.a;
476 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;
477 | sourceTree = BUILT_PRODUCTS_DIR;
478 | };
479 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {
480 | isa = PBXReferenceProxy;
481 | fileType = archive.ar;
482 | path = libRCTImage.a;
483 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;
484 | sourceTree = BUILT_PRODUCTS_DIR;
485 | };
486 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {
487 | isa = PBXReferenceProxy;
488 | fileType = archive.ar;
489 | path = libRCTNetwork.a;
490 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;
491 | sourceTree = BUILT_PRODUCTS_DIR;
492 | };
493 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {
494 | isa = PBXReferenceProxy;
495 | fileType = archive.ar;
496 | path = libRCTVibration.a;
497 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
498 | sourceTree = BUILT_PRODUCTS_DIR;
499 | };
500 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
501 | isa = PBXReferenceProxy;
502 | fileType = archive.ar;
503 | path = libRCTSettings.a;
504 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
505 | sourceTree = BUILT_PRODUCTS_DIR;
506 | };
507 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {
508 | isa = PBXReferenceProxy;
509 | fileType = archive.ar;
510 | path = libRCTWebSocket.a;
511 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;
512 | sourceTree = BUILT_PRODUCTS_DIR;
513 | };
514 | 146834041AC3E56700842450 /* libReact.a */ = {
515 | isa = PBXReferenceProxy;
516 | fileType = archive.ar;
517 | path = libReact.a;
518 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
519 | sourceTree = BUILT_PRODUCTS_DIR;
520 | };
521 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
522 | isa = PBXReferenceProxy;
523 | fileType = archive.ar;
524 | path = libRCTLinking.a;
525 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;
526 | sourceTree = BUILT_PRODUCTS_DIR;
527 | };
528 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
529 | isa = PBXReferenceProxy;
530 | fileType = archive.ar;
531 | path = libRCTText.a;
532 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
533 | sourceTree = BUILT_PRODUCTS_DIR;
534 | };
535 | /* End PBXReferenceProxy section */
536 |
537 | /* Begin PBXResourcesBuildPhase section */
538 | 00E356EC1AD99517003FC87E /* Resources */ = {
539 | isa = PBXResourcesBuildPhase;
540 | buildActionMask = 2147483647;
541 | files = (
542 | );
543 | runOnlyForDeploymentPostprocessing = 0;
544 | };
545 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
546 | isa = PBXResourcesBuildPhase;
547 | buildActionMask = 2147483647;
548 | files = (
549 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
550 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
551 | );
552 | runOnlyForDeploymentPostprocessing = 0;
553 | };
554 | /* End PBXResourcesBuildPhase section */
555 |
556 | /* Begin PBXShellScriptBuildPhase section */
557 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
558 | isa = PBXShellScriptBuildPhase;
559 | buildActionMask = 2147483647;
560 | files = (
561 | );
562 | inputPaths = (
563 | );
564 | name = "Bundle React Native code and images";
565 | outputPaths = (
566 | );
567 | runOnlyForDeploymentPostprocessing = 0;
568 | shellPath = /bin/sh;
569 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
570 | };
571 | /* End PBXShellScriptBuildPhase section */
572 |
573 | /* Begin PBXSourcesBuildPhase section */
574 | 00E356EA1AD99517003FC87E /* Sources */ = {
575 | isa = PBXSourcesBuildPhase;
576 | buildActionMask = 2147483647;
577 | files = (
578 | 00E356F31AD99517003FC87E /* EncryptionDemoTests.m in Sources */,
579 | );
580 | runOnlyForDeploymentPostprocessing = 0;
581 | };
582 | 13B07F871A680F5B00A75B9A /* Sources */ = {
583 | isa = PBXSourcesBuildPhase;
584 | buildActionMask = 2147483647;
585 | files = (
586 | CA1BAD7E1CF81F9D00A2F883 /* Tools.m in Sources */,
587 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
588 | CA1BAD881CF81FAA00A2F883 /* NSData+Base64.m in Sources */,
589 | CA1BAD891CF81FAA00A2F883 /* StringEncryption.m in Sources */,
590 | CA1BAD871CF81FAA00A2F883 /* EncryptionLibrary.m in Sources */,
591 | CA1BAD8A1CF81FAA00A2F883 /* StringEncryptioned.m in Sources */,
592 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
593 | );
594 | runOnlyForDeploymentPostprocessing = 0;
595 | };
596 | /* End PBXSourcesBuildPhase section */
597 |
598 | /* Begin PBXTargetDependency section */
599 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
600 | isa = PBXTargetDependency;
601 | target = 13B07F861A680F5B00A75B9A /* EncryptionDemo */;
602 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
603 | };
604 | /* End PBXTargetDependency section */
605 |
606 | /* Begin PBXVariantGroup section */
607 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
608 | isa = PBXVariantGroup;
609 | children = (
610 | 13B07FB21A68108700A75B9A /* Base */,
611 | );
612 | name = LaunchScreen.xib;
613 | path = EncryptionDemo;
614 | sourceTree = "";
615 | };
616 | /* End PBXVariantGroup section */
617 |
618 | /* Begin XCBuildConfiguration section */
619 | 00E356F61AD99517003FC87E /* Debug */ = {
620 | isa = XCBuildConfiguration;
621 | buildSettings = {
622 | BUNDLE_LOADER = "$(TEST_HOST)";
623 | GCC_PREPROCESSOR_DEFINITIONS = (
624 | "DEBUG=1",
625 | "$(inherited)",
626 | );
627 | INFOPLIST_FILE = EncryptionDemoTests/Info.plist;
628 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
629 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
630 | PRODUCT_NAME = "$(TARGET_NAME)";
631 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EncryptionDemo.app/EncryptionDemo";
632 | };
633 | name = Debug;
634 | };
635 | 00E356F71AD99517003FC87E /* Release */ = {
636 | isa = XCBuildConfiguration;
637 | buildSettings = {
638 | BUNDLE_LOADER = "$(TEST_HOST)";
639 | COPY_PHASE_STRIP = NO;
640 | INFOPLIST_FILE = EncryptionDemoTests/Info.plist;
641 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
642 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
643 | PRODUCT_NAME = "$(TARGET_NAME)";
644 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EncryptionDemo.app/EncryptionDemo";
645 | };
646 | name = Release;
647 | };
648 | 13B07F941A680F5B00A75B9A /* Debug */ = {
649 | isa = XCBuildConfiguration;
650 | buildSettings = {
651 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
652 | DEAD_CODE_STRIPPING = NO;
653 | HEADER_SEARCH_PATHS = (
654 | "$(inherited)",
655 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
656 | "$(SRCROOT)/../node_modules/react-native/React/**",
657 | );
658 | INFOPLIST_FILE = EncryptionDemo/Info.plist;
659 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
660 | OTHER_LDFLAGS = (
661 | "-ObjC",
662 | "-lc++",
663 | );
664 | PRODUCT_NAME = EncryptionDemo;
665 | };
666 | name = Debug;
667 | };
668 | 13B07F951A680F5B00A75B9A /* Release */ = {
669 | isa = XCBuildConfiguration;
670 | buildSettings = {
671 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
672 | HEADER_SEARCH_PATHS = (
673 | "$(inherited)",
674 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
675 | "$(SRCROOT)/../node_modules/react-native/React/**",
676 | );
677 | INFOPLIST_FILE = EncryptionDemo/Info.plist;
678 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
679 | OTHER_LDFLAGS = (
680 | "-ObjC",
681 | "-lc++",
682 | );
683 | PRODUCT_NAME = EncryptionDemo;
684 | };
685 | name = Release;
686 | };
687 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
688 | isa = XCBuildConfiguration;
689 | buildSettings = {
690 | ALWAYS_SEARCH_USER_PATHS = NO;
691 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
692 | CLANG_CXX_LIBRARY = "libc++";
693 | CLANG_ENABLE_MODULES = YES;
694 | CLANG_ENABLE_OBJC_ARC = YES;
695 | CLANG_WARN_BOOL_CONVERSION = YES;
696 | CLANG_WARN_CONSTANT_CONVERSION = YES;
697 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
698 | CLANG_WARN_EMPTY_BODY = YES;
699 | CLANG_WARN_ENUM_CONVERSION = YES;
700 | CLANG_WARN_INT_CONVERSION = YES;
701 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
702 | CLANG_WARN_UNREACHABLE_CODE = YES;
703 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
704 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
705 | COPY_PHASE_STRIP = NO;
706 | ENABLE_STRICT_OBJC_MSGSEND = YES;
707 | GCC_C_LANGUAGE_STANDARD = gnu99;
708 | GCC_DYNAMIC_NO_PIC = NO;
709 | GCC_OPTIMIZATION_LEVEL = 0;
710 | GCC_PREPROCESSOR_DEFINITIONS = (
711 | "DEBUG=1",
712 | "$(inherited)",
713 | );
714 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
715 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
716 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
717 | GCC_WARN_UNDECLARED_SELECTOR = YES;
718 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
719 | GCC_WARN_UNUSED_FUNCTION = YES;
720 | GCC_WARN_UNUSED_VARIABLE = YES;
721 | HEADER_SEARCH_PATHS = (
722 | "$(inherited)",
723 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
724 | "$(SRCROOT)/../node_modules/react-native/React/**",
725 | );
726 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
727 | MTL_ENABLE_DEBUG_INFO = YES;
728 | ONLY_ACTIVE_ARCH = YES;
729 | SDKROOT = iphoneos;
730 | };
731 | name = Debug;
732 | };
733 | 83CBBA211A601CBA00E9B192 /* Release */ = {
734 | isa = XCBuildConfiguration;
735 | buildSettings = {
736 | ALWAYS_SEARCH_USER_PATHS = NO;
737 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
738 | CLANG_CXX_LIBRARY = "libc++";
739 | CLANG_ENABLE_MODULES = YES;
740 | CLANG_ENABLE_OBJC_ARC = YES;
741 | CLANG_WARN_BOOL_CONVERSION = YES;
742 | CLANG_WARN_CONSTANT_CONVERSION = YES;
743 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
744 | CLANG_WARN_EMPTY_BODY = YES;
745 | CLANG_WARN_ENUM_CONVERSION = YES;
746 | CLANG_WARN_INT_CONVERSION = YES;
747 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
748 | CLANG_WARN_UNREACHABLE_CODE = YES;
749 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
750 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
751 | COPY_PHASE_STRIP = YES;
752 | ENABLE_NS_ASSERTIONS = NO;
753 | ENABLE_STRICT_OBJC_MSGSEND = YES;
754 | GCC_C_LANGUAGE_STANDARD = gnu99;
755 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
756 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
757 | GCC_WARN_UNDECLARED_SELECTOR = YES;
758 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
759 | GCC_WARN_UNUSED_FUNCTION = YES;
760 | GCC_WARN_UNUSED_VARIABLE = YES;
761 | HEADER_SEARCH_PATHS = (
762 | "$(inherited)",
763 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
764 | "$(SRCROOT)/../node_modules/react-native/React/**",
765 | );
766 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
767 | MTL_ENABLE_DEBUG_INFO = NO;
768 | SDKROOT = iphoneos;
769 | VALIDATE_PRODUCT = YES;
770 | };
771 | name = Release;
772 | };
773 | /* End XCBuildConfiguration section */
774 |
775 | /* Begin XCConfigurationList section */
776 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "EncryptionDemoTests" */ = {
777 | isa = XCConfigurationList;
778 | buildConfigurations = (
779 | 00E356F61AD99517003FC87E /* Debug */,
780 | 00E356F71AD99517003FC87E /* Release */,
781 | );
782 | defaultConfigurationIsVisible = 0;
783 | defaultConfigurationName = Release;
784 | };
785 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "EncryptionDemo" */ = {
786 | isa = XCConfigurationList;
787 | buildConfigurations = (
788 | 13B07F941A680F5B00A75B9A /* Debug */,
789 | 13B07F951A680F5B00A75B9A /* Release */,
790 | );
791 | defaultConfigurationIsVisible = 0;
792 | defaultConfigurationName = Release;
793 | };
794 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "EncryptionDemo" */ = {
795 | isa = XCConfigurationList;
796 | buildConfigurations = (
797 | 83CBBA201A601CBA00E9B192 /* Debug */,
798 | 83CBBA211A601CBA00E9B192 /* Release */,
799 | );
800 | defaultConfigurationIsVisible = 0;
801 | defaultConfigurationName = Release;
802 | };
803 | /* End XCConfigurationList section */
804 | };
805 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
806 | }
807 |
--------------------------------------------------------------------------------