├── EncryptUtils ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── dictionaries │ │ ├── 2015_249_pc.xml │ │ └── Jinlin.xml │ ├── findbugs-idea.xml │ ├── gradle.xml │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ ├── qaplug_profiles.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── jinlin │ │ │ └── encryptutils │ │ │ ├── MainActivity.java │ │ │ ├── aes │ │ │ ├── AES.java │ │ │ ├── AESActivity.java │ │ │ └── JavaAESCryptor.java │ │ │ ├── base64 │ │ │ ├── Base64.java │ │ │ └── Base64Activity.java │ │ │ ├── des │ │ │ ├── DES.java │ │ │ └── DESActivity.java │ │ │ └── md5 │ │ │ ├── MD5.java │ │ │ └── MD5Activity.java │ │ ├── jni │ │ ├── aes │ │ │ ├── aes.c │ │ │ ├── aes.h │ │ │ ├── aes_util.c │ │ │ └── com_jinlin_encryptutils_aes_AES.h │ │ ├── base64 │ │ │ ├── base64.cpp │ │ │ └── com_jinlin_encryptutils_base64_Base64.h │ │ ├── des │ │ │ ├── com_jinlin_encryptutils_des_DES.h │ │ │ ├── des.c │ │ │ ├── des.h │ │ │ └── des_util.c │ │ └── md5 │ │ │ ├── com_jinlin_encryptutils_md5_MD5.h │ │ │ ├── md5.c │ │ │ ├── md5.h │ │ │ └── md5_util.c │ │ └── res │ │ ├── layout │ │ ├── activity_aes.xml │ │ ├── activity_base64.xml │ │ ├── activity_des.xml │ │ ├── activity_main.xml │ │ └── activity_md5.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── README.md ├── gif ├── demo.gif └── demo2.gif ├── jni-md5-as ├── .gitignore ├── .idea │ ├── .name │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── dictionaries │ │ ├── 2015_249_pc.xml │ │ └── Jinlin.xml │ ├── findbugs-idea.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ ├── com │ │ │ └── jinlin │ │ │ │ ├── MainActivity.java │ │ │ │ └── util │ │ │ │ └── MD5.java │ │ └── com_jinlin_util_MD5.h │ │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ ├── base64.c │ │ ├── com_jinlin_util_MD5.h │ │ ├── md5.c │ │ ├── md5.h │ │ └── md5_util.c │ │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jni-md5-as.iml └── settings.gradle └── jni-md5-ec ├── .classpath ├── .project ├── .settings └── org.eclipse.jdt.core.prefs ├── AndroidManifest.xml ├── bin ├── AndroidManifest.xml ├── classes.dex ├── classes │ └── com_jinlin_util_MD5.h ├── dexedLibs │ └── android-support-v4-5f3d2d17147a77bc4a994dc12a087686.jar ├── jarlist.cache ├── jni-md5-ec.apk ├── res │ └── crunch │ │ ├── drawable-hdpi │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ │ └── drawable-xxhdpi │ │ └── ic_launcher.png └── resources.ap_ ├── ic_launcher-web.png ├── jni ├── Android.mk ├── Application.mk ├── base64.c ├── com_jinlin_util_MD5.h ├── md5.c ├── md5.h └── md5_util.c ├── libs ├── android-support-v4.jar ├── arm64-v8a │ └── libmd5.so ├── armeabi-v7a │ └── libmd5.so ├── armeabi │ └── libmd5.so ├── mips │ └── libmd5.so ├── mips64 │ └── libmd5.so ├── x86 │ └── libmd5.so └── x86_64 │ └── libmd5.so ├── obj └── local │ ├── arm64-v8a │ ├── libmd5.so │ └── objs │ │ └── md5 │ │ ├── md5.o │ │ ├── md5.o.d │ │ ├── md5_util.o │ │ └── md5_util.o.d │ ├── armeabi-v7a │ ├── libmd5.so │ └── objs │ │ └── md5 │ │ ├── md5.o │ │ ├── md5.o.d │ │ ├── md5_util.o │ │ └── md5_util.o.d │ ├── armeabi │ ├── libmd5.so │ └── objs │ │ └── md5 │ │ ├── md5.o │ │ ├── md5.o.d │ │ ├── md5_util.o │ │ └── md5_util.o.d │ ├── mips │ ├── libmd5.so │ └── objs │ │ └── md5 │ │ ├── md5.o │ │ ├── md5.o.d │ │ ├── md5_util.o │ │ └── md5_util.o.d │ ├── mips64 │ ├── libmd5.so │ └── objs │ │ └── md5 │ │ ├── md5.o │ │ ├── md5.o.d │ │ ├── md5_util.o │ │ └── md5_util.o.d │ ├── x86 │ ├── libmd5.so │ └── objs │ │ └── md5 │ │ ├── md5.o │ │ ├── md5.o.d │ │ ├── md5_util.o │ │ └── md5_util.o.d │ └── x86_64 │ ├── libmd5.so │ └── objs │ └── md5 │ ├── md5.o │ ├── md5.o.d │ ├── md5_util.o │ └── md5_util.o.d ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png ├── layout │ └── activity_main.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── values │ ├── strings.xml │ └── styles.xml └── src ├── com └── jinlin │ ├── md5 │ └── MainActivity.java │ └── util │ └── MD5.java └── com_jinlin_util_MD5.h /EncryptUtils/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/.name: -------------------------------------------------------------------------------- 1 | EncryptUtils -------------------------------------------------------------------------------- /EncryptUtils/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/dictionaries/2015_249_pc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/dictionaries/Jinlin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 25 | 26 | 27 | 28 | 29 | 34 | 35 | 36 | 48 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Android 68 | 69 | 70 | Android Lint 71 | 72 | 73 | J2ME issuesJava 74 | 75 | 76 | Java 77 | 78 | 79 | Java language level migration aidsJava 80 | 81 | 82 | Resource management issuesJava 83 | 84 | 85 | 86 | 87 | Android 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 109 | 110 | 112 | 113 | $USER_HOME$/.subversion 114 | 115 | 116 | 117 | 118 | 119 | 120 | 125 | 126 | 127 | 128 | 129 | 130 | 1.8 131 | 132 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /EncryptUtils/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /EncryptUtils/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /EncryptUtils/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.jinlin.encryptutils" 9 | minSdkVersion 15 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | ndk { 15 | moduleName "encrypt" 16 | ldLibs "log", "z", "m" 17 | abiFilters "armeabi", "armeabi-v7a", "x86", "x86_64", "mips", "arm64-v8a", "mips64" 18 | cFlags "-std=c11" 19 | } 20 | } 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | } 27 | } 28 | 29 | dependencies { 30 | compile fileTree(dir: 'libs', include: ['*.jar']) 31 | compile 'com.android.support:appcompat-v7:23.1.1' 32 | } 33 | -------------------------------------------------------------------------------- /EncryptUtils/app/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/2015-249-pc/Library/Android/sdk/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 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils; 2 | 3 | import android.app.ListActivity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.ListView; 9 | 10 | import com.jinlin.encryptutils.aes.AESActivity; 11 | import com.jinlin.encryptutils.base64.Base64Activity; 12 | import com.jinlin.encryptutils.des.DESActivity; 13 | import com.jinlin.encryptutils.md5.MD5Activity; 14 | 15 | public class MainActivity extends ListActivity { 16 | private String[] mDatas = {"AES", "Base64", "DES", "MD5"}; 17 | 18 | private Class[] mActivities = {AESActivity.class,Base64Activity.class,DESActivity.class, MD5Activity.class}; 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_expandable_list_item_1, mDatas); 23 | setListAdapter(adapter); 24 | } 25 | 26 | @Override 27 | protected void onListItemClick(ListView l, View v, int position, long id) { 28 | startActivity(new Intent(this, mActivities[position])); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/aes/AES.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.aes; 2 | 3 | /** 4 | * Created by J!nl!n on 15/12/21. 5 | * Copyright © 1990-2015 J!nl!n™ Inc. All rights reserved. 6 | *

7 | * ━━━━━━神兽出没━━━━━━ 8 | *    ┏┓   ┏┓ 9 | *   ┏┛┻━━━┛┻┓ 10 | *   ┃       ┃ 11 | *   ┃   ━   ┃ 12 | *   ┃ ┳┛ ┗┳ ┃ 13 | *   ┃       ┃ 14 | *   ┃   ┻   ┃ 15 | *   ┃       ┃ 16 | *   ┗━┓   ┏━┛Code is far away from bug with the animal protecting 17 | *     ┃   ┃ 神兽保佑,代码无bug 18 | *     ┃   ┃ 19 | *     ┃   ┗━━━┓ 20 | *     ┃       ┣┓ 21 | *     ┃       ┏┛ 22 | *     ┗┓┓┏━┳┓┏┛ 23 | *      ┃┫┫ ┃┫┫ 24 | *      ┗┻┛ ┗┻┛ 25 | * ━━━━━━感觉萌萌哒━━━━━━ 26 | */ 27 | public class AES { 28 | 29 | static { 30 | System.loadLibrary("encrypt"); 31 | } 32 | 33 | public static final int ENCRYPT = 0; 34 | 35 | public static final int DECRYPT = 1; 36 | 37 | public native static byte[] crypt(byte[] data, long time, int mode); 38 | 39 | public native static byte[] read(String path, long time); 40 | 41 | /** 42 | * 将16进制转换为二进制(服务端) 43 | * 44 | * @param hexStr 45 | * @return 46 | */ 47 | public static byte[] hexStr2Bytes(String hexStr) { 48 | if (hexStr.length() < 1) 49 | return null; 50 | byte[] result = new byte[hexStr.length() / 2]; 51 | for (int i = 0; i < hexStr.length() / 2; i++) { 52 | int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16); 53 | int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16); 54 | result[i] = (byte) (high * 16 + low); 55 | } 56 | return result; 57 | } 58 | 59 | public static String bytes2HexStr(byte[] data) { 60 | if (data == null || data.length == 0) { 61 | return null; 62 | } 63 | StringBuilder buf = new StringBuilder(); 64 | for (byte aData : data) { 65 | if (((int) aData & 0xff) < 0x10) { /* & 0xff转换无符号整型 */ 66 | buf.append("0"); 67 | } 68 | buf.append(Long.toHexString((int) aData & 0xff)); /* 转换16进制,下方法同 */ 69 | } 70 | return buf.toString(); 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/aes/AESActivity.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.aes; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.widget.TextView; 6 | 7 | import com.jinlin.encryptutils.R; 8 | 9 | import java.io.UnsupportedEncodingException; 10 | 11 | /** 12 | * Created by J!nl!n on 15/12/21. 13 | * Copyright © 1990-2015 J!nl!n™ Inc. All rights reserved. 14 | *

15 | * ━━━━━━神兽出没━━━━━━ 16 | *    ┏┓   ┏┓ 17 | *   ┏┛┻━━━┛┻┓ 18 | *   ┃       ┃ 19 | *   ┃   ━   ┃ 20 | *   ┃ ┳┛ ┗┳ ┃ 21 | *   ┃       ┃ 22 | *   ┃   ┻   ┃ 23 | *   ┃       ┃ 24 | *   ┗━┓   ┏━┛Code is far away from bug with the animal protecting 25 | *     ┃   ┃ 神兽保佑,代码无bug 26 | *     ┃   ┃ 27 | *     ┃   ┗━━━┓ 28 | *     ┃       ┣┓ 29 | *     ┃       ┏┛ 30 | *     ┗┓┓┏━┳┓┏┛ 31 | *      ┃┫┫ ┃┫┫ 32 | *      ┗┻┛ ┗┻┛ 33 | * ━━━━━━感觉萌萌哒━━━━━━ 34 | */ 35 | public class AESActivity extends AppCompatActivity { 36 | public static final String TESTDATA = "Jinlin"; 37 | private TextView tv1; 38 | private TextView tv2; 39 | private TextView tv3; 40 | private TextView tv4; 41 | 42 | private void assignViews() { 43 | tv1 = (TextView) findViewById(R.id.tv1); 44 | tv2 = (TextView) findViewById(R.id.tv2); 45 | tv3 = (TextView) findViewById(R.id.tv3); 46 | tv4 = (TextView) findViewById(R.id.tv4); 47 | } 48 | 49 | @Override 50 | protected void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | setContentView(R.layout.activity_aes); 53 | 54 | assignViews(); 55 | 56 | try { 57 | System.out.println("======jni-crypt-test======"); 58 | byte[] data = TESTDATA.getBytes("UTF-8"); 59 | data = AES.crypt(data, System.currentTimeMillis(), AES.ENCRYPT); 60 | String hexStr = AES.bytes2HexStr(data); 61 | System.out.println("encrypt:" + hexStr); 62 | tv1.setText(String.format("jni encrypt:%s", hexStr)); 63 | 64 | data = AES.hexStr2Bytes(hexStr); 65 | data = AES.crypt(data, System.currentTimeMillis(), AES.DECRYPT); 66 | System.out.println("decrypt:" + new String(data, "UTF-8")); 67 | tv2.setText(String.format("jni decrypt:%s", new String(data, "UTF-8"))); 68 | 69 | System.out.println("======java-crypt-test======"); 70 | data = TESTDATA.getBytes("UTF-8"); 71 | data = JavaAESCryptor.encrypt(data); 72 | hexStr = AES.bytes2HexStr(data); 73 | System.out.println("encrypt:" + hexStr); 74 | tv3.setText(String.format("java encrypt:%s", hexStr)); 75 | 76 | data = AES.hexStr2Bytes(hexStr); 77 | data = JavaAESCryptor.decrypt(data); 78 | System.out.println("decrypt:" + new String(data, "UTF-8")); 79 | tv4.setText(String.format("java decrypt:%s", new String(data, "UTF-8"))); 80 | 81 | System.out.println("======jni-file-test======"); 82 | data = AES.read("/mnt/sdcard/test.txt", System.currentTimeMillis()); 83 | if (data != null) { 84 | System.out.println("read:" + new String(data, "UTF-8")); 85 | } 86 | } catch (UnsupportedEncodingException e) { 87 | e.printStackTrace(); 88 | } 89 | } 90 | 91 | } -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/aes/JavaAESCryptor.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.aes; 2 | 3 | import javax.crypto.Cipher; 4 | import javax.crypto.spec.IvParameterSpec; 5 | import javax.crypto.spec.SecretKeySpec; 6 | 7 | 8 | //使用256位长度密钥需查看的链接· 9 | //http://czj4451.iteye.com/blog/1986483 10 | //http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html 11 | //http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html 12 | public class JavaAESCryptor { 13 | 14 | private static final String TEST_DATA = "kLNyk5O9jj0kG/lqskHCLs7HQttQjqMwNToSXGVs7WraXf0bVpBA1vaE+30Mz2wu/6dmmU6mHOVAye+w9zrgZswPAjqEtU8nAa7+z5RDeil/5kBEEnV/IVO+Xry6YO4AL6xuHm/6k32zn6C8R2ZCvNL/vvUbk49YH5MEyCU/9See8Y8hqM9jPTmGc9+izcIjZtkMnC1PfShwvgdtE5gkkBqVJx20bnjyzEEPIb3dxt/DlhmbnpBeC6GWzCHjzvdLcC3mfYHoP6+A1r+oXjDxGFfKIDgtwaUZfzAKhlpsx9gOn7e2CaC85Nyu2Xy1vjTBlJiwN1EPvI87nQrWWqOBDyRRzhlbc+f2pEfZ6yIQKXnR7QKLKptxnD3jcKuH5r2l82b1Q3OSFTCYRCzYtA/CYbdJq4gRxx8bFwSeqmxtYy0=kLNyk5O9jj0kG/lqskHCLs7HQttQjqMwNToSXGVs7WraXf0bVpBA1vaE+30Mz2wu/6dmmU6mHOVAye+w9zrgZswPAjqEtU8nAa7+z5RDeil/5kBEEnV/IVO+Xry6YO4AL6xuHm/6k32zn6C8R2ZCvNL/vvUbk49YH5MEyCU/9See8Y8hqM9jPTmGc9+izcIjZtkMnC1PfShwvgdtE5gkkBqVJx20bnjyzEEPIb3dxt/DlhmbnpBeC6GWzCHjzvdLcC3mfYHoP6+A1r+oXjDxGFfKIDgtwaUZfzAKhlpsx9gOn7e2CaC85Nyu2Xy1vjTBlJiwN1EPvI87nQrWWqOBDyRRzhlbc+f2pEfZ6yIQKXnR7QKLKptxnD3jcKuH5r2l82b1Q3OSFTCYRCzYtA/CYbdJq4gRxx8bFwSeqmxtYy0="; 15 | 16 | // 测试 17 | public static void main(String[] args) throws Exception { 18 | // 加密 19 | System.out.println("加密前:" + TEST_DATA); 20 | byte[] encryptResult = encrypt(TEST_DATA.getBytes("UTF-8")); 21 | System.out.println("加密后:"+AES.bytes2HexStr(encryptResult)); 22 | 23 | // 解密 24 | byte[] decryptResult = decrypt(encryptResult); 25 | 26 | System.out.println("解密后:" + new String(decryptResult)); 27 | } 28 | 29 | // iv同C语言中iv 30 | private static byte ivBytes[] = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 31 | 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; 32 | 33 | // keyBytes同C语言中key 34 | private static byte keyBytes[] = new byte[] { 0x60, 0x3d, (byte) 0xeb, 35 | 0x10, 0x15, (byte) 0xca, 0x71, (byte) 0xbe, 0x2b, 0x73, 36 | (byte) 0xae, (byte) 0xf0, (byte) 0x85, 0x7d, 0x77, (byte) 0x81, 37 | 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, (byte) 0xd7, 0x2d, 38 | (byte) 0x98, 0x10, (byte) 0xa3, 0x09, 0x14, (byte) 0xdf, 39 | (byte) 0xf4 }; 40 | 41 | /** 42 | * 加密 43 | * 44 | * @param content 45 | * 需要加密的内容 46 | * @param content 47 | * 加密密码 48 | * @return 49 | */ 50 | public static byte[] encrypt(byte[] content) { 51 | return docrypt(content, keyBytes, Cipher.ENCRYPT_MODE); 52 | } 53 | 54 | /** 55 | * 解密 56 | * 57 | * @param content 58 | * 待解密内容 59 | * @param content 60 | * 解密密钥 61 | * @return 62 | */ 63 | public static byte[] decrypt(byte[] content) { 64 | return docrypt(content, keyBytes, Cipher.DECRYPT_MODE); 65 | } 66 | 67 | public static byte[] docrypt(byte[] content, byte[] keyBytes, int mode) { 68 | try { 69 | // KeyGenerator kgen = KeyGenerator.getInstance("AES"); 70 | // kgen.init(128, new SecureRandom(keyBytes)); 71 | // SecretKey secretKey = kgen.generateKey(); 72 | // byte[] enCodeFormat = secretKey.getEncoded(); 73 | 74 | SecretKeySpec key = new SecretKeySpec(keyBytes, "AES"); // keyBytes32个字节,256位, 75 | // 与C语言中的key一致 76 | Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");// 创建密码器 77 | final IvParameterSpec iv = new IvParameterSpec(ivBytes); 78 | 79 | cipher.init(mode, key, iv);// 初始化 80 | byte[] result = cipher.doFinal(content); 81 | return result; // 加密 82 | } catch (Exception e) { 83 | e.printStackTrace(); 84 | } 85 | return null; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/base64/Base64.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.base64; 2 | 3 | /** 4 | * Created by J!nl!n on 15/12/19. 5 | * Copyright © 1990-2015 J!nl!n™ Inc. All rights reserved. 6 | *

7 | * ━━━━━━神兽出没━━━━━━ 8 | *    ┏┓   ┏┓ 9 | *   ┏┛┻━━━┛┻┓ 10 | *   ┃       ┃ 11 | *   ┃   ━   ┃ 12 | *   ┃ ┳┛ ┗┳ ┃ 13 | *   ┃       ┃ 14 | *   ┃   ┻   ┃ 15 | *   ┃       ┃ 16 | *   ┗━┓   ┏━┛Code is far away from bug with the animal protecting 17 | *     ┃   ┃ 神兽保佑,代码无bug 18 | *     ┃   ┃ 19 | *     ┃   ┗━━━┓ 20 | *     ┃       ┣┓ 21 | *     ┃       ┏┛ 22 | *     ┗┓┓┏━┳┓┏┛ 23 | *      ┃┫┫ ┃┫┫ 24 | *      ┗┻┛ ┗┻┛ 25 | * ━━━━━━感觉萌萌哒━━━━━━ 26 | */ 27 | public class Base64 { 28 | 29 | static { 30 | System.loadLibrary("encrypt"); 31 | } 32 | 33 | public static native String encode(String str); 34 | 35 | public static native String decode(String str); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/base64/Base64Activity.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.base64; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.util.Base64; 6 | import android.util.Log; 7 | import android.widget.TextView; 8 | 9 | import com.jinlin.encryptutils.R; 10 | 11 | public class Base64Activity extends AppCompatActivity { 12 | private TextView et; 13 | private TextView tv1; 14 | private TextView tv2; 15 | private TextView tv3; 16 | private TextView tv4; 17 | 18 | private void assignViews() { 19 | et = (TextView) findViewById(R.id.et); 20 | tv1 = (TextView) findViewById(R.id.tv1); 21 | tv2 = (TextView) findViewById(R.id.tv2); 22 | tv3 = (TextView) findViewById(R.id.tv3); 23 | tv4 = (TextView) findViewById(R.id.tv4); 24 | 25 | // Base64 编码: 26 | byte [] encode = Base64.encode(et.getText().toString().getBytes(), Base64.DEFAULT); 27 | String enc = new String(encode); 28 | Log.d("Jinlin", "base 64 encode = " + enc); 29 | tv1.setText(String.format("java encode:%s", enc)); 30 | 31 | // Base64 解码: 32 | byte [] result = Base64.decode(enc, Base64.DEFAULT); 33 | String res = new String(result); 34 | Log.d("Jinlin", "base 64 result = " + res); 35 | tv2.setText(String.format("java decode:%s", res)); 36 | 37 | String s = com.jinlin.encryptutils.base64.Base64.encode(et.getText().toString()); 38 | tv3.setText(String.format("NDK encode:%s", s)); 39 | tv4.setText(String.format("NDK decode:%s", com.jinlin.encryptutils.base64.Base64.decode(s))); 40 | 41 | } 42 | 43 | 44 | @Override 45 | protected void onCreate(Bundle savedInstanceState) { 46 | super.onCreate(savedInstanceState); 47 | setContentView(R.layout.activity_base64); 48 | assignViews(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/des/DES.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.des; 2 | 3 | import java.security.SecureRandom; 4 | 5 | import javax.crypto.Cipher; 6 | import javax.crypto.SecretKey; 7 | import javax.crypto.SecretKeyFactory; 8 | import javax.crypto.spec.DESKeySpec; 9 | 10 | /** 11 | * Created by J!nl!n on 15/12/21. 12 | * Copyright © 1990-2015 J!nl!n™ Inc. All rights reserved. 13 | *

14 | * ━━━━━━神兽出没━━━━━━ 15 | *    ┏┓   ┏┓ 16 | *   ┏┛┻━━━┛┻┓ 17 | *   ┃       ┃ 18 | *   ┃   ━   ┃ 19 | *   ┃ ┳┛ ┗┳ ┃ 20 | *   ┃       ┃ 21 | *   ┃   ┻   ┃ 22 | *   ┃       ┃ 23 | *   ┗━┓   ┏━┛Code is far away from bug with the animal protecting 24 | *     ┃   ┃ 神兽保佑,代码无bug 25 | *     ┃   ┃ 26 | *     ┃   ┗━━━┓ 27 | *     ┃       ┣┓ 28 | *     ┃       ┏┛ 29 | *     ┗┓┓┏━┳┓┏┛ 30 | *      ┃┫┫ ┃┫┫ 31 | *      ┗┻┛ ┗┻┛ 32 | * ━━━━━━感觉萌萌哒━━━━━━ 33 | */ 34 | public class DES { 35 | 36 | static { 37 | System.loadLibrary("encrypt"); 38 | } 39 | 40 | public static native byte[] desCrypt(byte[] data, byte[] key, int flag); 41 | 42 | /** 43 | * 加密 44 | * 45 | * @param rawKeyData 46 | * @param str 47 | * @return 48 | * @throws Exception 49 | */ 50 | public static byte[] encrypt(byte rawKeyData[], String str) 51 | throws Exception { 52 | // DES算法要求有一个可信任的随机数源 53 | SecureRandom sr = new SecureRandom(); 54 | // 从原始密匙数据创建一个DESKeySpec对象 55 | DESKeySpec dks = new DESKeySpec(rawKeyData); 56 | // 创建一个密匙工厂,然后用它把DESKeySpec转换成一个SecretKey对象 57 | SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); 58 | SecretKey key = keyFactory.generateSecret(dks); 59 | // Cipher对象实际完成加密操作 60 | Cipher cipher = Cipher.getInstance("DES"); 61 | // 用密匙初始化Cipher对象 62 | cipher.init(Cipher.ENCRYPT_MODE, key, sr); 63 | // 现在,获取数据并加密 64 | byte data[] = str.getBytes(); 65 | // 正式执行加密操作 66 | byte[] encryptedData = cipher.doFinal(data); 67 | return encryptedData; 68 | } 69 | 70 | /** 71 | * 解密 72 | * 73 | * @param src byte[] 74 | * @param password String 75 | * @return byte[] 76 | * @throws Exception 77 | */ 78 | public static byte[] decrypt(byte[] src, String password) throws Exception { 79 | // DES算法要求有一个可信任的随机数源 80 | SecureRandom random = new SecureRandom(); 81 | // 创建一个DESKeySpec对象 82 | DESKeySpec desKey = new DESKeySpec(password.getBytes()); 83 | // 创建一个密匙工厂 84 | SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); 85 | // 将DESKeySpec对象转换成SecretKey对象 86 | SecretKey securekey = keyFactory.generateSecret(desKey); 87 | // Cipher对象实际完成解密操作 88 | Cipher cipher = Cipher.getInstance("DES"); 89 | // 用密匙初始化Cipher对象 90 | cipher.init(Cipher.DECRYPT_MODE, securekey, random); 91 | // 真正开始解密操作 92 | return cipher.doFinal(src); 93 | } 94 | } -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/des/DESActivity.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.des; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.util.Base64; 6 | import android.widget.TextView; 7 | 8 | import com.jinlin.encryptutils.R; 9 | 10 | /** 11 | * Created by J!nl!n on 15/12/21. 12 | * Copyright © 1990-2015 J!nl!n™ Inc. All rights reserved. 13 | *

14 | * ━━━━━━神兽出没━━━━━━ 15 | *    ┏┓   ┏┓ 16 | *   ┏┛┻━━━┛┻┓ 17 | *   ┃       ┃ 18 | *   ┃   ━   ┃ 19 | *   ┃ ┳┛ ┗┳ ┃ 20 | *   ┃       ┃ 21 | *   ┃   ┻   ┃ 22 | *   ┃       ┃ 23 | *   ┗━┓   ┏━┛Code is far away from bug with the animal protecting 24 | *     ┃   ┃ 神兽保佑,代码无bug 25 | *     ┃   ┃ 26 | *     ┃   ┗━━━┓ 27 | *     ┃       ┣┓ 28 | *     ┃       ┏┛ 29 | *     ┗┓┓┏━┳┓┏┛ 30 | *      ┃┫┫ ┃┫┫ 31 | *      ┗┻┛ ┗┻┛ 32 | * ━━━━━━感觉萌萌哒━━━━━━ 33 | */ 34 | public class DESActivity extends AppCompatActivity { 35 | String data = "Jinlin"; 36 | String key = "12345678"; 37 | private TextView tv1; 38 | private TextView tv2; 39 | private TextView tv3; 40 | private TextView tv4; 41 | 42 | private void assignViews() { 43 | tv1 = (TextView) findViewById(R.id.tv1); 44 | tv2 = (TextView) findViewById(R.id.tv2); 45 | tv3 = (TextView) findViewById(R.id.tv3); 46 | tv4 = (TextView) findViewById(R.id.tv4); 47 | } 48 | 49 | @Override 50 | protected void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | setContentView(R.layout.activity_des); 53 | assignViews(); 54 | try { 55 | byte b[] = DES.desCrypt(data.getBytes(), key.getBytes(), 1); 56 | System.out.println("encrypt==>" + Base64.encodeToString(b, Base64.DEFAULT)); 57 | tv1.setText(String.format("ndk encrypt==>%s", Base64.encodeToString(b, Base64.DEFAULT))); 58 | 59 | b = DES.desCrypt(b, key.getBytes(), 0); 60 | System.out.println("decrypt==>" + new String(b)); 61 | tv2.setText(String.format("ndk decrypt==>%s", new String(b))); 62 | 63 | byte jb[] = DES.encrypt(key.getBytes(), data); 64 | System.out.println("java encrypt==>" + Base64.encodeToString(jb, Base64.DEFAULT)); 65 | tv3.setText(String.format("java encrypt==>%s", Base64.encodeToString(jb, Base64.DEFAULT))); 66 | 67 | b = DES.decrypt(jb, key); 68 | tv4.setText(String.format("java decrypt==>%s", new String(b))); 69 | } catch (Exception e) { 70 | e.printStackTrace(); 71 | } 72 | } 73 | 74 | void quickSort(int array[], int start, int end) { 75 | if (start < end) { 76 | int i = start, j = end, x = array[start]; 77 | while (i < j) { 78 | while (i < j && array[j] > x) { 79 | --j; 80 | } 81 | if (i < j) { 82 | array[i++] = array[j]; 83 | } 84 | while (i < j && array[i] < x) { 85 | ++i; 86 | } 87 | if (i < j) { 88 | array[j--] = array[i]; 89 | } 90 | } 91 | array[i] = x; 92 | quickSort(array, start, i - 1); 93 | quickSort(array, i + 1, end); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/md5/MD5.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.md5; 2 | 3 | import java.security.MessageDigest; 4 | 5 | public class MD5 { 6 | static { 7 | System.loadLibrary("encrypt"); 8 | } 9 | 10 | public static native String encryptByMD5(String str); 11 | 12 | public static String getMD5(String info) { 13 | try { 14 | MessageDigest md5 = MessageDigest.getInstance("MD5"); 15 | md5.update(info.getBytes("UTF-8")); 16 | byte[] encryption = md5.digest(); 17 | 18 | StringBuilder strBuf = new StringBuilder(); 19 | for (byte anEncryption : encryption) { 20 | if (Integer.toHexString(0xff & anEncryption).length() == 1) { 21 | strBuf.append("0").append(Integer.toHexString(0xff & anEncryption)); 22 | } else { 23 | strBuf.append(Integer.toHexString(0xff & anEncryption)); 24 | } 25 | } 26 | return strBuf.toString(); 27 | } catch (Exception e) { 28 | return ""; 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/java/com/jinlin/encryptutils/md5/MD5Activity.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.encryptutils.md5; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.text.Editable; 6 | import android.text.TextWatcher; 7 | import android.widget.EditText; 8 | import android.widget.TextView; 9 | 10 | import com.jinlin.encryptutils.R; 11 | 12 | public class MD5Activity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_md5); 18 | 19 | // 待加密 20 | String strText = "J!nl!n"; 21 | EditText et = (EditText) findViewById(R.id.et); 22 | et.setText(strText); 23 | 24 | // java 25 | final TextView tv2 = (TextView) findViewById(R.id.tv2); 26 | tv2.setText(String.format("java: %s", MD5.getMD5(strText))); 27 | // ndk c 28 | final TextView tv3 = (TextView) findViewById(R.id.tv3); 29 | tv3.setText(String.format("ndk c: %s", MD5.encryptByMD5(strText))); 30 | 31 | et.addTextChangedListener(new TextWatcher() { 32 | @Override 33 | public void onTextChanged(CharSequence s, int start, int before, int count) { 34 | } 35 | 36 | @Override 37 | public void beforeTextChanged(CharSequence s, int start, int count, int after) { 38 | } 39 | 40 | @Override 41 | public void afterTextChanged(Editable s) { 42 | tv2.setText(String.format("java: %s", MD5.getMD5(s.toString()))); 43 | tv3.setText(String.format("ndk c: %s", MD5.encryptByMD5(s.toString()))); 44 | } 45 | }); 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/aes/aes.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * Filename: aes.h 3 | * Author: Brad Conte (brad AT bradconte.com) 4 | * Copyright: 5 | * Disclaimer: This code is presented "as is" without any guarantees. 6 | * Details: Defines the API for the corresponding AES implementation. 7 | *********************************************************************/ 8 | 9 | #ifndef AES_H 10 | #define AES_H 11 | 12 | /*************************** HEADER FILES ***************************/ 13 | #include 14 | 15 | /****************************** MACROS ******************************/ 16 | #define AES_BLOCK_SIZE 16 // AES operates on 16 bytes at a time 17 | 18 | /**************************** DATA TYPES ****************************/ 19 | typedef unsigned char BYTE; // 8-bit byte 20 | typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines 21 | 22 | /*********************** FUNCTION DECLARATIONS **********************/ 23 | /////////////////// 24 | // AES 25 | /////////////////// 26 | // Key setup must be done before any AES en/de-cryption functions can be used. 27 | void aes_key_setup(const BYTE key[], // The key, must be 128, 192, or 256 bits 28 | WORD w[], // Output key schedule to be used later 29 | int keysize); // Bit length of the key, 128, 192, or 256 30 | 31 | void aes_encrypt(const BYTE in[], // 16 bytes of plaintext 32 | BYTE out[], // 16 bytes of ciphertext 33 | const WORD key[], // From the key setup 34 | int keysize); // Bit length of the key, 128, 192, or 256 35 | 36 | void aes_decrypt(const BYTE in[], // 16 bytes of ciphertext 37 | BYTE out[], // 16 bytes of plaintext 38 | const WORD key[], // From the key setup 39 | int keysize); // Bit length of the key, 128, 192, or 256 40 | 41 | /////////////////// 42 | // AES - CBC 43 | /////////////////// 44 | int aes_encrypt_cbc(const BYTE in[], // Plaintext 45 | size_t in_len, // Must be a multiple of AES_BLOCK_SIZE 46 | BYTE out[], // Ciphertext, same length as plaintext 47 | const WORD key[], // From the key setup 48 | int keysize, // Bit length of the key, 128, 192, or 256 49 | const BYTE iv[]); // IV, must be AES_BLOCK_SIZE bytes long 50 | 51 | // Only output the CBC-MAC of the input. 52 | int aes_encrypt_cbc_mac(const BYTE in[], // plaintext 53 | size_t in_len, // Must be a multiple of AES_BLOCK_SIZE 54 | BYTE out[], // Output MAC 55 | const WORD key[], // From the key setup 56 | int keysize, // Bit length of the key, 128, 192, or 256 57 | const BYTE iv[]); // IV, must be AES_BLOCK_SIZE bytes long 58 | 59 | /////////////////// 60 | // AES - CTR 61 | /////////////////// 62 | void increment_iv(BYTE iv[], // Must be a multiple of AES_BLOCK_SIZE 63 | int counter_size); // Bytes of the IV used for counting (low end) 64 | 65 | void aes_encrypt_ctr(const BYTE in[], // Plaintext 66 | size_t in_len, // Any byte length 67 | BYTE out[], // Ciphertext, same length as plaintext 68 | const WORD key[], // From the key setup 69 | int keysize, // Bit length of the key, 128, 192, or 256 70 | const BYTE iv[]); // IV, must be AES_BLOCK_SIZE bytes long 71 | 72 | void aes_decrypt_ctr(const BYTE in[], // Ciphertext 73 | size_t in_len, // Any byte length 74 | BYTE out[], // Plaintext, same length as ciphertext 75 | const WORD key[], // From the key setup 76 | int keysize, // Bit length of the key, 128, 192, or 256 77 | const BYTE iv[]); // IV, must be AES_BLOCK_SIZE bytes long 78 | 79 | /////////////////// 80 | // AES - CCM 81 | /////////////////// 82 | // Returns True if the input parameters do not violate any constraint. 83 | int aes_encrypt_ccm(const BYTE plaintext[], // IN - Plaintext. 84 | WORD plaintext_len, // IN - Plaintext length. 85 | const BYTE associated_data[], // IN - Associated Data included in authentication, but not encryption. 86 | unsigned short associated_data_len, // IN - Associated Data length in bytes. 87 | const BYTE nonce[], // IN - The Nonce to be used for encryption. 88 | unsigned short nonce_len, // IN - Nonce length in bytes. 89 | BYTE ciphertext[], // OUT - Ciphertext, a concatination of the plaintext and the MAC. 90 | WORD *ciphertext_len, // OUT - The length of the ciphertext, always plaintext_len + mac_len. 91 | WORD mac_len, // IN - The desired length of the MAC, must be 4, 6, 8, 10, 12, 14, or 16. 92 | const BYTE key[], // IN - The AES key for encryption. 93 | int keysize); // IN - The length of the key in bits. Valid values are 128, 192, 256. 94 | 95 | // Returns True if the input parameters do not violate any constraint. 96 | // Use mac_auth to ensure decryption/validation was preformed correctly. 97 | // If authentication does not succeed, the plaintext is zeroed out. To overwride 98 | // this, call with mac_auth = NULL. The proper proceedure is to decrypt with 99 | // authentication enabled (mac_auth != NULL) and make a second call to that 100 | // ignores authentication explicitly if the first call failes. 101 | int aes_decrypt_ccm(const BYTE ciphertext[], // IN - Ciphertext, the concatination of encrypted plaintext and MAC. 102 | WORD ciphertext_len, // IN - Ciphertext length in bytes. 103 | const BYTE assoc[], // IN - The Associated Data, required for authentication. 104 | unsigned short assoc_len, // IN - Associated Data length in bytes. 105 | const BYTE nonce[], // IN - The Nonce to use for decryption, same one as for encryption. 106 | unsigned short nonce_len, // IN - Nonce length in bytes. 107 | BYTE plaintext[], // OUT - The plaintext that was decrypted. Will need to be large enough to hold ciphertext_len - mac_len. 108 | WORD *plaintext_len, // OUT - Length in bytes of the output plaintext, always ciphertext_len - mac_len . 109 | WORD mac_len, // IN - The length of the MAC that was calculated. 110 | int *mac_auth, // OUT - TRUE if authentication succeeded, FALSE if it did not. NULL pointer will ignore the authentication. 111 | const BYTE key[], // IN - The AES key for decryption. 112 | int keysize); // IN - The length of the key in BITS. Valid values are 128, 192, 256. 113 | 114 | 115 | #endif // AES_H 116 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/aes/aes_util.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by J!nl!n on 15/12/21. 3 | // 4 | 5 | #include "com_jinlin_encryptutils_aes_AES.h" 6 | #include 7 | #include 8 | #include "aes.h" 9 | 10 | //CRYPT CONFIG 11 | #define MAX_LEN (2*1024*1024) 12 | #define ENCRYPT 0 13 | #define DECRYPT 1 14 | #define AES_KEY_SIZE 256 15 | #define READ_LEN 10 16 | 17 | #define TARGET_CLASS "com/jinlin/encryptutils/aes/AES" 18 | #define TARGET_CRYPT "crypt" 19 | #define TARGET_CRYPT_SIG "([BJI)[B" 20 | #define TARGET_READ "read" 21 | #define TARGET_READ_SIG "(Ljava/lang/String;J)[B" 22 | 23 | //AES_IV 24 | static unsigned char AES_IV[16] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 25 | 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; 26 | //AES_KEY 27 | static unsigned char AES_KEY[32] = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 28 | 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, 0x1f, 0x35, 0x2c, 29 | 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 30 | 0xf4 }; 31 | 32 | /* 33 | * Class: tv_fun_common_crypt_Funcrypt 34 | * Method: sha1 35 | * Signature: (Ljava/lang/String;JI)[Ljava/lang/Object; 36 | */ 37 | JNIEXPORT jbyteArray JNICALL android_native_aes(JNIEnv *env, jclass clazz, 38 | jbyteArray jarray, jlong jtimestamp, jint jmode) { 39 | //check input data 40 | unsigned int len = (unsigned int) ((*env)->GetArrayLength(env, jarray)); 41 | if (len <= 0 || len >= MAX_LEN) { 42 | return NULL; 43 | } 44 | 45 | unsigned char *data = (unsigned char*) (*env)->GetByteArrayElements(env, 46 | jarray, NULL); 47 | if (!data) { 48 | return NULL; 49 | } 50 | 51 | //计算填充长度,当为加密方式且长度不为16的整数倍时,则填充,与3DES填充类似(DESede/CBC/PKCS5Padding) 52 | unsigned int mode = (unsigned int) jmode; 53 | unsigned int rest_len = len % AES_BLOCK_SIZE; 54 | unsigned int padding_len = ( 55 | (ENCRYPT == mode) ? (AES_BLOCK_SIZE - rest_len) : 0); 56 | unsigned int src_len = len + padding_len; 57 | 58 | //设置输入 59 | unsigned char *input = (unsigned char *) malloc(src_len); 60 | memset(input, 0, src_len); 61 | memcpy(input, data, len); 62 | if (padding_len > 0) { 63 | memset(input + len, (unsigned char) padding_len, padding_len); 64 | } 65 | //data不再使用 66 | (*env)->ReleaseByteArrayElements(env, jarray, data, 0); 67 | 68 | //设置输出Buffer 69 | unsigned char * buff = (unsigned char*) malloc(src_len); 70 | if (!buff) { 71 | free(input); 72 | return NULL; 73 | } 74 | memset(buff, src_len, 0); 75 | 76 | //set key & iv 77 | unsigned int key_schedule[AES_BLOCK_SIZE * 4] = { 0 }; //>=53(这里取64) 78 | aes_key_setup(AES_KEY, key_schedule, AES_KEY_SIZE); 79 | 80 | //执行加解密计算(CBC mode) 81 | if (mode == ENCRYPT) { 82 | aes_encrypt_cbc(input, src_len, buff, key_schedule, AES_KEY_SIZE, 83 | AES_IV); 84 | } else { 85 | aes_decrypt_cbc(input, src_len, buff, key_schedule, AES_KEY_SIZE, 86 | AES_IV); 87 | } 88 | 89 | //解密时计算填充长度 90 | if (ENCRYPT != mode) { 91 | unsigned char * ptr = buff; 92 | ptr += (src_len - 1); 93 | padding_len = (unsigned int) *ptr; 94 | if (padding_len > 0 && padding_len <= AES_BLOCK_SIZE) { 95 | src_len -= padding_len; 96 | } 97 | ptr = NULL; 98 | } 99 | 100 | //设置返回变量 101 | jbyteArray bytes = (*env)->NewByteArray(env, src_len); 102 | (*env)->SetByteArrayRegion(env, bytes, 0, src_len, (jbyte*) buff); 103 | 104 | //内存释放 105 | free(input); 106 | free(buff); 107 | 108 | return bytes; 109 | } 110 | 111 | JNIEXPORT jbyteArray JNICALL android_native_read(JNIEnv *env, jclass clazz, 112 | jstring jstr, jlong jtimestam) { 113 | char * path = (char *) (*env)->GetStringUTFChars(env, jstr, NULL); 114 | if (!path) { 115 | return NULL; 116 | } 117 | FILE *fp = fopen(path, "r"); //获取文件的指针 118 | if (!fp) { 119 | return NULL; 120 | } 121 | (*env)->ReleaseStringUTFChars(env, jstr, path); 122 | 123 | char pBuf[READ_LEN + 1] = { 0 }; 124 | fread(pBuf, 1, READ_LEN, fp); //读文件 125 | pBuf[READ_LEN] = 0; 126 | fclose(fp); 127 | 128 | //设置返回变量 129 | jbyteArray bytes = (*env)->NewByteArray(env, READ_LEN); 130 | (*env)->SetByteArrayRegion(env, bytes, 0, READ_LEN, (jbyte*) pBuf); 131 | 132 | return bytes; 133 | } 134 | 135 | /** 136 | * 注册JNI 137 | */ 138 | static const JNINativeMethod gMethods[] = { { TARGET_CRYPT, TARGET_CRYPT_SIG, 139 | (void*) android_native_aes }, { TARGET_READ, TARGET_READ_SIG, 140 | (void*) android_native_read } }; 141 | 142 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { 143 | JNIEnv* env = NULL; 144 | if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) { 145 | return -1; 146 | } 147 | 148 | jclass clazz = (*env)->FindClass(env, TARGET_CLASS); 149 | if (!clazz) { 150 | return -1; 151 | } 152 | //这里就是关键了,把本地函数和一个java类方法关联起来。不管之前是否关联过,一律把之前的替换掉! 153 | if ((*env)->RegisterNatives(env, clazz, gMethods, 154 | sizeof(gMethods) / sizeof(gMethods[0])) != JNI_OK) { 155 | return -1; 156 | } 157 | 158 | return JNI_VERSION_1_4; 159 | } 160 | 161 | JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) { 162 | JNIEnv* env = NULL; 163 | if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) { 164 | return; 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/aes/com_jinlin_encryptutils_aes_AES.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_encryptutils_aes_AES */ 4 | 5 | #ifndef _Included_com_jinlin_encryptutils_aes_AES 6 | #define _Included_com_jinlin_encryptutils_aes_AES 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | #undef com_jinlin_encryptutils_aes_AES_ENCRYPT 11 | #define com_jinlin_encryptutils_aes_AES_ENCRYPT 0L 12 | #undef com_jinlin_encryptutils_aes_AES_DECRYPT 13 | #define com_jinlin_encryptutils_aes_AES_DECRYPT 1L 14 | /* 15 | * Class: com_jinlin_encryptutils_aes_AES 16 | * Method: crypt 17 | * Signature: ([BJI)[B 18 | */ 19 | JNIEXPORT jbyteArray JNICALL Java_com_jinlin_encryptutils_aes_AES_crypt 20 | (JNIEnv *, jclass, jbyteArray, jlong, jint); 21 | 22 | /* 23 | * Class: com_jinlin_encryptutils_aes_AES 24 | * Method: read 25 | * Signature: (Ljava/lang/String;J)[B 26 | */ 27 | JNIEXPORT jbyteArray JNICALL Java_com_jinlin_encryptutils_aes_AES_read 28 | (JNIEnv *, jclass, jstring, jlong); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/base64/base64.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by J!nl!n on 15/12/19. 3 | // 4 | 5 | #include 6 | #include "com_jinlin_encryptutils_base64_Base64.h" 7 | 8 | #include // 这个是输出LOG所用到的函数所在的路径 9 | 10 | #define LOG_TAG "BASE64" // 这个是自定义的LOG的标识 11 | #undef LOG // 取消默认的LOG 12 | 13 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) // 定义LOG类型 14 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) // 定义LOG类型 15 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) // 定义LOG类型 16 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) // 定义LOG类型 17 | #define LOGF(...) __android_log_print(ANDROID_LOG_FATAL,LOG_TAG,__VA_ARGS__) // 定义LOG类型 18 | 19 | const char base[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 20 | 21 | char *base64_encode(const char *data, int data_len); 22 | 23 | char *base64_decode(const char *data, int data_len); 24 | 25 | static char find_pos(char ch); 26 | 27 | // 把java的字符串转换成c的字符串,使用反射 28 | char *Jstring2CStr(JNIEnv *env, jstring jstr) { 29 | char *rtn = NULL; 30 | // 1:先找到字节码文件 31 | jclass clsstring = env->FindClass("java/lang/String"); 32 | jstring strencode = env->NewStringUTF("utf-8"); 33 | // 2:通过字节码文件找到方法ID 34 | jmethodID mid = env->GetMethodID(clsstring, "getBytes", "(Ljava/lang/String;)[B"); 35 | // 3:通过方法id,调用方法 36 | jbyteArray barr = (jbyteArray) env->CallObjectMethod(jstr, mid, strencode); // String .getByte("GB2312"); 37 | // 4:得到数据的长度 38 | jsize alen = env->GetArrayLength(barr); 39 | // 5:得到数据的首地址 40 | jbyte *ba = env->GetByteArrayElements(barr, JNI_FALSE); 41 | // 6:得到C语言的字符串 42 | if (alen > 0) { 43 | rtn = (char *) malloc((size_t) (alen + 1)); //"\0" 44 | memcpy(rtn, ba, (size_t) alen); 45 | rtn[alen] = 0; 46 | } 47 | env->ReleaseByteArrayElements(barr, ba, 0); 48 | return rtn; 49 | } 50 | 51 | /* 52 | * Class: com_jinlin_encryptutils_base64_Base64 53 | * Method: encode 54 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 55 | */ 56 | JNIEXPORT jstring JNICALL Java_com_jinlin_encryptutils_base64_Base64_encode 57 | (JNIEnv *env, jobject clazz, jstring string) { 58 | // 此时的t里面有了jstring的内容 59 | char *cstr = Jstring2CStr(env, string); 60 | LOGD("original: %s", cstr); 61 | int len = (int) strlen(cstr); 62 | char *enc = base64_encode(cstr, len); 63 | LOGD("encoded : %s", enc); 64 | return env->NewStringUTF(enc); 65 | } 66 | 67 | /* 68 | * Class: com_jinlin_encryptutils_base64_Base64 69 | * Method: decode 70 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 71 | */ 72 | JNIEXPORT jstring JNICALL Java_com_jinlin_encryptutils_base64_Base64_decode 73 | (JNIEnv *env, jobject clazz, jstring string) { 74 | // 先将jstring转换成char* 75 | char *cstr = (char *) env->GetStringUTFChars(string, 0); 76 | LOGD("original: %s", cstr); 77 | int len = (int) strlen(cstr); 78 | char *dec = base64_decode(cstr, len); 79 | LOGD("decoded : %s", dec); 80 | // 将base64编码后的char转换成jstring返回给java层 81 | return env->NewStringUTF(dec); 82 | } 83 | 84 | /* */ 85 | char *base64_encode(const char *data, int data_len) { 86 | //int data_len = strlen(data); 87 | int prepare = 0; 88 | int ret_len; 89 | int temp = 0; 90 | char *ret = NULL; 91 | char *f = NULL; 92 | int tmp = 0; 93 | char changed[4]; 94 | int i = 0; 95 | ret_len = data_len / 3; 96 | temp = data_len % 3; 97 | if (temp > 0) { 98 | ret_len += 1; 99 | } 100 | ret_len = ret_len * 4 + 1; 101 | ret = (char *) malloc(ret_len); 102 | 103 | if (ret == NULL) { 104 | LOGD("No enough memory.\n"); 105 | exit(0); 106 | } 107 | memset(ret, 0, ret_len); 108 | f = ret; 109 | while (tmp < data_len) { 110 | temp = 0; 111 | prepare = 0; 112 | memset(changed, '\0', 4); 113 | while (temp < 3) { 114 | //printf("tmp = %d\n", tmp); 115 | if (tmp >= data_len) { 116 | break; 117 | } 118 | prepare = ((prepare << 8) | (data[tmp] & 0xFF)); 119 | tmp++; 120 | temp++; 121 | } 122 | prepare = (prepare << ((3 - temp) * 8)); 123 | //printf("before for : temp = %d, prepare = %d\n", temp, prepare); 124 | for (i = 0; i < 4; i++) { 125 | if (temp < i) { 126 | changed[i] = 0x40; 127 | } 128 | else { 129 | changed[i] = (prepare >> ((3 - i) * 6)) & 0x3F; 130 | } 131 | *f = base[changed[i]]; 132 | //printf("%.2X", changed[i]); 133 | f++; 134 | } 135 | } 136 | *f = '\0'; 137 | 138 | return ret; 139 | 140 | } 141 | 142 | /* */ 143 | static char find_pos(char ch) { 144 | char *ptr = (char *) strrchr(base, ch);//the last position (the only) in base[] 145 | return (ptr - base); 146 | } 147 | 148 | /* */ 149 | char *base64_decode(const char *data, int data_len) { 150 | int ret_len = (data_len / 4) * 3; 151 | int equal_count = 0; 152 | char *ret = NULL; 153 | char *f = NULL; 154 | int tmp = 0; 155 | int temp = 0; 156 | char need[3]; 157 | int prepare = 0; 158 | int i = 0; 159 | if (*(data + data_len - 1) == '=') { 160 | equal_count += 1; 161 | } 162 | if (*(data + data_len - 2) == '=') { 163 | equal_count += 1; 164 | } 165 | if (*(data + data_len - 3) == '=') {//seems impossible 166 | equal_count += 1; 167 | } 168 | switch (equal_count) { 169 | case 0: 170 | ret_len += 4;//3 + 1 [1 for NULL] 171 | break; 172 | case 1: 173 | ret_len += 4;//Ceil((6*3)/8)+1 174 | break; 175 | case 2: 176 | ret_len += 3;//Ceil((6*2)/8)+1 177 | break; 178 | case 3: 179 | ret_len += 2;//Ceil((6*1)/8)+1 180 | break; 181 | } 182 | ret = (char *) malloc(ret_len); 183 | if (ret == NULL) { 184 | LOGD("No enough memory.\n"); 185 | exit(0); 186 | } 187 | memset(ret, 0, ret_len); 188 | f = ret; 189 | while (tmp < (data_len - equal_count)) { 190 | temp = 0; 191 | prepare = 0; 192 | memset(need, 0, 4); 193 | while (temp < 4) { 194 | if (tmp >= (data_len - equal_count)) { 195 | break; 196 | } 197 | prepare = (prepare << 6) | (find_pos(data[tmp])); 198 | temp++; 199 | tmp++; 200 | } 201 | prepare = prepare << ((4 - temp) * 6); 202 | for (i = 0; i < 3; i++) { 203 | if (i == temp) { 204 | break; 205 | } 206 | *f = (char) ((prepare >> ((2 - i) * 8)) & 0xFF); 207 | f++; 208 | } 209 | } 210 | *f = '\0'; 211 | return ret; 212 | } -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/base64/com_jinlin_encryptutils_base64_Base64.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_encryptutils_base64_Base64 */ 4 | 5 | #ifndef _Included_com_jinlin_encryptutils_base64_Base64 6 | #define _Included_com_jinlin_encryptutils_base64_Base64 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_encryptutils_base64_Base64 12 | * Method: encode 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_com_jinlin_encryptutils_base64_Base64_encode 16 | (JNIEnv *, jobject, jstring); 17 | 18 | /* 19 | * Class: com_jinlin_encryptutils_base64_Base64 20 | * Method: decode 21 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 22 | */ 23 | JNIEXPORT jstring JNICALL Java_com_jinlin_encryptutils_base64_Base64_decode 24 | (JNIEnv *, jobject, jstring); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/des/com_jinlin_encryptutils_des_DES.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_encryptutils_des_DES */ 4 | 5 | #ifndef _Included_com_jinlin_encryptutils_des_DES 6 | #define _Included_com_jinlin_encryptutils_des_DES 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_encryptutils_des_DES 12 | * Method: desCrypt 13 | * Signature: ([B[BI)[B 14 | */ 15 | JNIEXPORT jbyteArray JNICALL Java_com_jinlin_encryptutils_des_DES_desCrypt 16 | (JNIEnv *, jclass, jbyteArray, jbyteArray, jint); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/des/des.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by jun on 2015/12/20. 3 | // 4 | 5 | #include "des.h" 6 | #include 7 | #include 8 | // 初始置换表 9 | int IP[] = {58, 50, 42, 34, 26, 18, 10, 2, 10 | 60, 52, 44, 36, 28, 20, 12, 4, 11 | 62, 54, 46, 38, 30, 22, 14, 6, 12 | 64, 56, 48, 40, 32, 24, 16, 8, 13 | 57, 49, 41, 33, 25, 17, 9, 1, 14 | 59, 51, 43, 35, 27, 19, 11, 3, 15 | 61, 53, 45, 37, 29, 21, 13, 5, 16 | 63, 55, 47, 39, 31, 23, 15, 7}; 17 | 18 | // 结尾置换表 19 | int IP_1[] = {40, 8, 48, 16, 56, 24, 64, 32, 20 | 39, 7, 47, 15, 55, 23, 63, 31, 21 | 38, 6, 46, 14, 54, 22, 62, 30, 22 | 37, 5, 45, 13, 53, 21, 61, 29, 23 | 36, 4, 44, 12, 52, 20, 60, 28, 24 | 35, 3, 43, 11, 51, 19, 59, 27, 25 | 34, 2, 42, 10, 50, 18, 58, 26, 26 | 33, 1, 41, 9, 49, 17, 57, 25}; 27 | 28 | /*------------------下面是生成密钥所用表-----------------*/ 29 | 30 | // 密钥置换表,将64位密钥变成56位 31 | int PC_1[] = {57, 49, 41, 33, 25, 17, 9, 32 | 1, 58, 50, 42, 34, 26, 18, 33 | 10, 2, 59, 51, 43, 35, 27, 34 | 19, 11, 3, 60, 52, 44, 36, 35 | 63, 55, 47, 39, 31, 23, 15, 36 | 7, 62, 54, 46, 38, 30, 22, 37 | 14, 6, 61, 53, 45, 37, 29, 38 | 21, 13, 5, 28, 20, 12, 4}; 39 | 40 | // 压缩置换,将56位密钥压缩成48位子密钥 41 | int PC_2[] = {14, 17, 11, 24, 1, 5, 42 | 3, 28, 15, 6, 21, 10, 43 | 23, 19, 12, 4, 26, 8, 44 | 16, 7, 27, 20, 13, 2, 45 | 41, 52, 31, 37, 47, 55, 46 | 30, 40, 51, 45, 33, 48, 47 | 44, 49, 39, 56, 34, 53, 48 | 46, 42, 50, 36, 29, 32}; 49 | 50 | // 每轮左移的位数 51 | int shiftBits[] = {1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1}; 52 | 53 | /*------------------下面是密码函数 f 所用表-----------------*/ 54 | 55 | // 扩展置换表,将 32位 扩展至 48位 56 | int E[] = {32, 1, 2, 3, 4, 5, 57 | 4, 5, 6, 7, 8, 9, 58 | 8, 9, 10, 11, 12, 13, 59 | 12, 13, 14, 15, 16, 17, 60 | 16, 17, 18, 19, 20, 21, 61 | 20, 21, 22, 23, 24, 25, 62 | 24, 25, 26, 27, 28, 29, 63 | 28, 29, 30, 31, 32, 1}; 64 | 65 | // S盒,每个S盒是4x16的置换表,6位 -> 4位 66 | int S_BOX[8][4][16] = { 67 | { 68 | {14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7}, 69 | {0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8}, 70 | {4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0}, 71 | {15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13} 72 | }, 73 | { 74 | {15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10}, 75 | {3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5}, 76 | {0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15}, 77 | {13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9} 78 | }, 79 | { 80 | {10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8}, 81 | {13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1}, 82 | {13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7}, 83 | {1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12} 84 | }, 85 | { 86 | {7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15}, 87 | {13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9}, 88 | {10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4}, 89 | {3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14} 90 | }, 91 | { 92 | {2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9}, 93 | {14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6}, 94 | {4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14}, 95 | {11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3} 96 | }, 97 | { 98 | {12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11}, 99 | {10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8}, 100 | {9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6}, 101 | {4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13} 102 | }, 103 | { 104 | {4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1}, 105 | {13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6}, 106 | {1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2}, 107 | {6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12} 108 | }, 109 | { 110 | {13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7}, 111 | {1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2}, 112 | {7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8}, 113 | {2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11} 114 | } 115 | }; 116 | 117 | // P置换,32位 -> 32位 118 | int P[] = {16, 7, 20, 21, 119 | 29, 12, 28, 17, 120 | 1, 15, 23, 26, 121 | 5, 18, 31, 10, 122 | 2, 8, 24, 14, 123 | 32, 27, 3, 9, 124 | 19, 13, 30, 6, 125 | 22, 11, 4, 25 }; 126 | 127 | void byteTo64Int(char data[8], unsigned short out[64]) 128 | { 129 | for (int i = 0; i < 8; ++i) { 130 | for (int j = 7; j >=0; --j) { 131 | out[i*8+j]=data[i]>>(7-j)&1; 132 | } 133 | } 134 | } 135 | 136 | void initKey(unsigned short key[64], unsigned short outkey[16][48]) 137 | { 138 | unsigned short int key56[56]; 139 | for (int i = 0; i < 56; ++i) { 140 | key56[i]=key[PC_1[i]-1]; 141 | } 142 | for (int j = 0; j < 16; ++j) { 143 | leftMoveKey(key56,shiftBits[j]); 144 | for (int i = 0; i < 48; ++i) { 145 | outkey[j][i]=key56[PC_2[i]-1]; 146 | } 147 | } 148 | } 149 | 150 | unsigned short keyset[16][48]; 151 | 152 | void make_SubKey(char key[8]) 153 | { 154 | unsigned short key64[64]; 155 | byteTo64Int(key,key64); 156 | initKey(key64,keyset); 157 | } 158 | 159 | void Des_edCryption(char * input, char * output, short mode) 160 | { 161 | unsigned short data64[64]; 162 | memset(output,0,8); 163 | byteTo64Int(input,data64); 164 | arrayCryption(data64,mode,output); 165 | } 166 | 167 | void arrayCryption(unsigned short * data64, short mode,char * out) 168 | { 169 | unsigned short ipdata[64]; 170 | for (int i = 0; i < 64; ++i) { 171 | ipdata[i]=data64[IP[i]-1]; 172 | } 173 | for (int j = 0; j < 16; ++j) { 174 | LoopF(ipdata,(mode?j:15-j),mode); 175 | } 176 | for (int k = 0; k < 64; ++k) { 177 | data64[k]=ipdata[IP_1[k]-1]; 178 | } 179 | Bit64ToByte(data64,out); 180 | } 181 | 182 | void Bit64ToByte(unsigned short data64[64], unsigned char out[8]) 183 | { 184 | for (int i = 0; i < 8; ++i) { 185 | for (int j = 0; j < 8; ++j) { 186 | out[i] |= data64[i*8+j]<<(7-j); 187 | } 188 | } 189 | } 190 | 191 | 192 | void LoopF(unsigned short data64[64],short time,short flag) 193 | { 194 | unsigned short tmp=0; 195 | unsigned short R[32]; 196 | unsigned short RE[48]; 197 | unsigned short sValue[32]; 198 | for (int m = 0; m < 32; ++m) { 199 | R[m]=data64[32+m]; 200 | } 201 | for (int i = 0; i < 48; ++i) { 202 | RE[i]=R[E[i]-1]^keyset[time][i]; 203 | } 204 | for (int j = 0; j < 8; ++j) { 205 | tmp=S_BOX[j][(RE[j*6]<<1)|(RE[j*6+5])][(RE[j*6+1]<<3)|(RE[j*6+2]<<2)|(RE[j*6+3]<<1)|RE[j*6+4]]; 206 | for (int k = 0; k < 4; ++k) { 207 | sValue[j*4+3-k]=(tmp>>k)&1; 208 | } 209 | } 210 | for (int i = 0; i < 32; i++) { 211 | // 重新合成M,返回数组M 212 | // 最后一次变换时,左右不进行互换。此处采用两次变换实现不变 213 | tmp=sValue[P[i]-1]^data64[i]; 214 | if ((!flag &&!time) ||(flag && time == 15)) { 215 | data64[i] = tmp; 216 | } else { 217 | data64[i] = R[i]; 218 | data64[i + 32] =tmp; 219 | } 220 | } 221 | } 222 | 223 | void leftMoveKey(unsigned short keyarray[56], int offset) 224 | { 225 | short temp1=keyarray[0]; 226 | short temp2=keyarray[28]; 227 | short temp3=keyarray[1]; 228 | short temp4=keyarray[29]; 229 | for (int i = 0; i < 26; ++i) { 230 | keyarray[i]=keyarray[offset+i]; 231 | keyarray[i+28]=keyarray[offset+28+i]; 232 | } 233 | if (offset==1) 234 | { 235 | keyarray[26]=keyarray[27]; 236 | keyarray[27]=temp1; 237 | keyarray[54]=keyarray[55]; 238 | keyarray[55]=temp2; 239 | } 240 | else{ 241 | keyarray[26]=temp1; 242 | keyarray[27]=temp3; 243 | keyarray[54]=temp2; 244 | keyarray[55]=temp4; 245 | } 246 | } -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/des/des.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by jun on 2015/12/20. 3 | // 4 | 5 | #ifndef MYAPPLICATION_DES_H 6 | #define MYAPPLICATION_DES_H 7 | 8 | #include 9 | #define TAG "Jinlin" 10 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,TAG ,__VA_ARGS__) // 定义LOGD类型 11 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,TAG ,__VA_ARGS__) // 定义LOGI类型 12 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN,TAG ,__VA_ARGS__) // 定义LOGW类型 13 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG ,__VA_ARGS__) // 定义LOGE类型 14 | #define LOGF(...) __android_log_print(ANDROID_LOG_FATAL,TAG ,__VA_ARGS__) // 定义LOGF类型 15 | void Des_edCryption(char input[8], char output[8], short mode); 16 | void make_SubKey(char key[8]); 17 | #endif 18 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/des/des_util.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by J!nl!n on 15/12/21. 3 | // 4 | #include "com_jinlin_encryptutils_des_DES.h" 5 | #include 6 | #include "des.h" 7 | #include 8 | #include 9 | 10 | JNIEXPORT jbyteArray JNICALL Java_com_jinlin_encryptutils_des_DES_desCrypt(JNIEnv *env, jobject instance, 11 | jbyteArray data_, 12 | jbyteArray key_, jint flag) { 13 | jbyte *data = (*env)->GetByteArrayElements(env, data_, NULL); 14 | jbyte *key = (*env)->GetByteArrayElements(env, key_, NULL); 15 | int datalength = (*env)->GetArrayLength(env, data_); 16 | int keylength = (*env)->GetArrayLength(env, key_); 17 | if (keylength != 8) { 18 | return 0; 19 | } 20 | LOGI("data:%s, length:%d", data, datalength); 21 | char *data_block = (char *) malloc(8); 22 | char *process_block = (char *) malloc(8); 23 | int number = datalength / 8 + (flag ? 1 : 0); 24 | char *trans_data = (char *) malloc(number * 8); 25 | int size = 0; 26 | memset(trans_data, 0, number * 8); 27 | make_SubKey(key); 28 | for (int i = 0; i < number; ++i) { 29 | memset(data_block, 0, 8); 30 | if ((i + 1) * 8 <= datalength) { 31 | memmove(data_block, data + i * 8, 8); 32 | } 33 | else { 34 | memmove(data_block, data + i * 8, datalength - i * 8); 35 | } 36 | if (i != number - 1) { 37 | Des_edCryption(data_block, process_block, flag); 38 | memmove(trans_data + i * 8, process_block, 8); 39 | size += 8; 40 | } 41 | else if (flag) { 42 | int padding = 8 - datalength % 8; 43 | memset(data_block + 8 - padding, padding, padding); 44 | Des_edCryption(data_block, process_block, flag); 45 | memmove(trans_data + i * 8, process_block, 8); 46 | size += 8; 47 | } 48 | else { 49 | Des_edCryption(data_block, process_block, flag); 50 | int padding = process_block[7]; 51 | LOGI("padding:%d", padding); 52 | if (padding <= 8) { 53 | memmove(trans_data + i * 8, process_block, 8 - padding); 54 | size += 8 - padding; 55 | } 56 | } 57 | } 58 | jbyteArray jba = (*env)->NewByteArray(env, size); 59 | LOGI("trans:%s,size:%d", trans_data, size); 60 | (*env)->SetByteArrayRegion(env, jba, 0, size, trans_data); 61 | free(process_block); 62 | free(data_block); 63 | free(trans_data); 64 | 65 | (*env)->ReleaseByteArrayElements(env, data_, data, 0); 66 | (*env)->ReleaseByteArrayElements(env, key_, key, 0); 67 | return jba; 68 | } -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/md5/com_jinlin_encryptutils_md5_MD5.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_encryptutils_md5_MD5 */ 4 | 5 | #ifndef _Included_com_jinlin_encryptutils_md5_MD5 6 | #define _Included_com_jinlin_encryptutils_md5_MD5 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_encryptutils_md5_MD5 12 | * Method: encryptByMD5 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_com_jinlin_encryptutils_md5_MD5_encryptByMD5 16 | (JNIEnv *, jclass, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/md5/md5.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by J!nl!n on 15/11/10. 3 | // 4 | 5 | /* MD5.H - header file for MD5C.C 6 | */ 7 | 8 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 9 | rights reserved. 10 | 11 | License to copy and use this software is granted provided that it 12 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 13 | Algorithm" in all material mentioning or referencing this software 14 | or this function. 15 | 16 | License is also granted to make and use derivative works provided 17 | that such works are identified as "derived from the RSA Data 18 | Security, Inc. MD5 Message-Digest Algorithm" in all material 19 | mentioning or referencing the derived work. 20 | 21 | RSA Data Security, Inc. makes no representations concerning either 22 | the merchantability of this software or the suitability of this 23 | software for any particular purpose. It is provided "as is" 24 | without express or implied warranty of any kind. 25 | 26 | These notices must be retained in any copies of any part of this 27 | documentation and/or software. 28 | */ 29 | 30 | /* POINTER defines a generic pointer type */ 31 | typedef unsigned char *POINTER; 32 | 33 | /* UINT2 defines a two byte word */ 34 | typedef unsigned short int UINT2; 35 | 36 | /* UINT4 defines a four byte word */ 37 | typedef unsigned long int UINT4; 38 | 39 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 40 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 41 | returns an empty list. 42 | */ 43 | 44 | /* MD5 context. */ 45 | typedef struct tagMD5_CTX { 46 | UINT4 state[4]; 47 | /* state (ABCD) */ 48 | UINT4 count[2]; 49 | /* number of bits, modulo 2^64 (lsb first) */ 50 | unsigned char buffer[64]; /* input buffer */ 51 | } MD5_CTX; 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | void MD5Init(MD5_CTX *context); 56 | void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen); 57 | void MD5Final(unsigned char digest[16], MD5_CTX *context); 58 | 59 | static void MD5Transform(UINT4 state[4], unsigned char block[64]); 60 | static void Encode(unsigned char *output, UINT4 *input, unsigned int len); 61 | static void Decode(UINT4 *output, unsigned char *input, unsigned int len); 62 | static void MD5_memcpy(POINTER output, POINTER input, unsigned int len); 63 | static void MD5_memset(POINTER output, int value, unsigned int len); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/jni/md5/md5_util.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "com_jinlin_encryptutils_md5_MD5.h" 5 | #include "md5.h" 6 | 7 | #define LOG_TAG "MD5" 8 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) 9 | 10 | // 把java的字符串转换成c的字符串,使用反射 11 | char *Jstring2CStr(JNIEnv *env, jstring jstr) { 12 | char *rtn = NULL; 13 | // 1:先找到字节码文件 14 | jclass clsstring = (*env)->FindClass(env, "java/lang/String"); 15 | jstring strencode = (*env)->NewStringUTF(env, "GB2312"); 16 | // 2:通过字节码文件找到方法ID 17 | jmethodID mid = (*env)->GetMethodID(env, clsstring, "getBytes", "(Ljava/lang/String;)[B"); 18 | // 3:通过方法id,调用方法 19 | jbyteArray barr = (jbyteArray) (*env)->CallObjectMethod(env, jstr, mid, strencode); // String .getByte("GB2312"); 20 | // 4:得到数据的长度 21 | jsize alen = (*env)->GetArrayLength(env, barr); 22 | // 5:得到数据的首地址 23 | jbyte *ba = (*env)->GetByteArrayElements(env, barr, JNI_FALSE); 24 | // 6:得到C语言的字符串 25 | if (alen > 0) { 26 | rtn = (char *) malloc(alen + 1); //"\0" 27 | memcpy(rtn, ba, alen); 28 | rtn[alen] = 0; 29 | } 30 | (*env)->ReleaseByteArrayElements(env, barr, ba, 0); // 31 | return rtn; 32 | } 33 | 34 | /* 35 | * Class: com_jinlin_util_MD5 36 | * Method: encryptByMD5 37 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 38 | */ 39 | JNIEXPORT jstring JNICALL Java_com_jinlin_encryptutils_md5_MD5_encryptByMD5 40 | (JNIEnv *env, jclass jcalzz, jstring jInfo) { 41 | 42 | // char* cstr = Jstring2CStr(env, jInfo); 43 | char *cstr = (char *) (*env)->GetStringUTFChars(env, jInfo, 0); 44 | 45 | MD5_CTX context = {0}; 46 | MD5Init(&context); 47 | MD5Update(&context, cstr, strlen(cstr)); 48 | unsigned char dest[16] = {0}; 49 | MD5Final(dest, &context); 50 | (*env)->ReleaseStringUTFChars(env, jInfo, cstr); 51 | 52 | int i; 53 | char destination[32] = {0}; 54 | for (i = 0; i < 16; i++) { 55 | sprintf(destination, "%s%02x", destination, dest[i]); 56 | } 57 | LOGI("%s", destination); 58 | return (*env)->NewStringUTF(env, destination); 59 | } 60 | 61 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/layout/activity_aes.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 19 | 25 | 31 | 37 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/layout/activity_base64.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 19 | 20 | 26 | 27 | 33 | 34 | 40 | 41 | 47 | 48 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/layout/activity_des.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 18 | 24 | 30 | 36 | 42 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/layout/activity_md5.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | 17 | 18 | 23 | 24 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/EncryptUtils/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/EncryptUtils/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/EncryptUtils/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/EncryptUtils/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/EncryptUtils/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | EncryptUtils 3 | 4 | -------------------------------------------------------------------------------- /EncryptUtils/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /EncryptUtils/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.5.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /EncryptUtils/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /EncryptUtils/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/EncryptUtils/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /EncryptUtils/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 21 11:34:03 PDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip 7 | -------------------------------------------------------------------------------- /EncryptUtils/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /EncryptUtils/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /EncryptUtils/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jni-encrypt 2 | 3 | a demo that use two difference way to get a md5/aes/base64/des string by use Java&C, we can use ndk to do a lot of work. 4 | all u can see in the demo picture 5 | 6 | ![Examples list](https://github.com/5peak2me/jni-md5/blob/master/gif/demo.gif) 7 | ![Examples list](https://github.com/5peak2me/jni-md5/blob/master/gif/demo2.gif) 8 | 9 | -------------------------------------------------------------------------------- /gif/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/gif/demo.gif -------------------------------------------------------------------------------- /gif/demo2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/gif/demo2.gif -------------------------------------------------------------------------------- /jni-md5-as/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/.name: -------------------------------------------------------------------------------- 1 | jni-md5-as -------------------------------------------------------------------------------- /jni-md5-as/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/dictionaries/2015_249_pc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/dictionaries/Jinlin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Android 22 | 23 | 24 | Android Lint 25 | 26 | 27 | J2ME issuesJava 28 | 29 | 30 | Java 31 | 32 | 33 | Java language level migration aidsJava 34 | 35 | 36 | Resource management issuesJava 37 | 38 | 39 | 40 | 41 | Android 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 63 | 64 | $USER_HOME$/.subversion 65 | 66 | 67 | 68 | 69 | 70 | 71 | 76 | 77 | 78 | 79 | 80 | 81 | 1.8 82 | 83 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /jni-md5-as/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /jni-md5-as/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /jni-md5-as/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.jinlin" 9 | minSdkVersion 10 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | ndk { 15 | moduleName "md5" 16 | ldLibs "log", "z", "m" 17 | abiFilters "armeabi", "armeabi-v7a", "x86" 18 | } 19 | } 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | compile fileTree(dir: 'libs', include: ['*.jar']) 30 | compile 'com.android.support:appcompat-v7:23.1.0' 31 | } 32 | -------------------------------------------------------------------------------- /jni-md5-as/app/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/2015-249-pc/Library/Android/sdk/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 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/java/com/jinlin/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.jinlin; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.text.Editable; 6 | import android.text.TextWatcher; 7 | import android.widget.EditText; 8 | import android.widget.TextView; 9 | 10 | import com.jinlin.util.MD5; 11 | 12 | public class MainActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | 19 | // 待加密 20 | String strText = "J!nl!n"; 21 | EditText et = (EditText) findViewById(R.id.et); 22 | et.setText(strText); 23 | 24 | // java 25 | final TextView tv2 = (TextView) findViewById(R.id.tv2); 26 | tv2.setText("java: " + MD5.getMD5(strText)); 27 | // ndk c 28 | final TextView tv3 = (TextView) findViewById(R.id.tv3); 29 | tv3.setText("ndk c: " + MD5.encryptByMD5(strText)); 30 | 31 | et.addTextChangedListener(new TextWatcher() { 32 | @Override 33 | public void onTextChanged(CharSequence s, int start, int before, int count) { 34 | } 35 | 36 | @Override 37 | public void beforeTextChanged(CharSequence s, int start, int count, int after) { 38 | } 39 | 40 | @Override 41 | public void afterTextChanged(Editable s) { 42 | tv2.setText("java: " + MD5.getMD5(s.toString())); 43 | tv3.setText("ndk c: " + MD5.encryptByMD5(s.toString())); 44 | } 45 | }); 46 | } 47 | 48 | static { 49 | System.loadLibrary("md5"); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/java/com/jinlin/util/MD5.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.util; 2 | 3 | import java.security.MessageDigest; 4 | 5 | public class MD5 { 6 | 7 | public static native String encryptByMD5(String str); 8 | 9 | public static String getMD5(String info) { 10 | try { 11 | MessageDigest md5 = MessageDigest.getInstance("MD5"); 12 | md5.update(info.getBytes("UTF-8")); 13 | byte[] encryption = md5.digest(); 14 | 15 | StringBuffer strBuf = new StringBuffer(); 16 | for (int i = 0; i < encryption.length; i++) { 17 | if (Integer.toHexString(0xff & encryption[i]).length() == 1) { 18 | strBuf.append("0").append(Integer.toHexString(0xff & encryption[i])); 19 | } else { 20 | strBuf.append(Integer.toHexString(0xff & encryption[i])); 21 | } 22 | } 23 | return strBuf.toString(); 24 | } catch (Exception e) { 25 | return ""; 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/java/com_jinlin_util_MD5.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_util_MD5 */ 4 | 5 | #ifndef _Included_com_jinlin_util_MD5 6 | #define _Included_com_jinlin_util_MD5 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_util_MD5 12 | * Method: encryptByMD5 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_com_jinlin_util_MD5_encryptByMD5 16 | (JNIEnv *, jclass, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | # 对应打包成函数库的名字 6 | LOCAL_MODULE := md5 7 | # 对应c代码的文件 8 | LOCAL_SRC_FILES := md5_util.c md5.c 9 | LOCAL_LDLIBS += -llog 10 | 11 | include $(BUILD_SHARED_LIBRARY) -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PLATFORM := android-10 2 | APP_ABI := all 3 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/jni/base64.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | const char base[] = 7 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 8 | char* base64_encode(const char* data, int data_len); 9 | char *base64_decode(const char* data, int data_len); 10 | static char find_pos(char ch); 11 | 12 | /* */ 13 | char *base64_encode(const char* data, int data_len) { 14 | 15 | //int data_len = strlen(data); 16 | int prepare = 0; 17 | int ret_len; 18 | int temp = 0; 19 | char *ret = NULL; 20 | char *f = NULL; 21 | int tmp = 0; 22 | char changed[4]; 23 | int i = 0; 24 | ret_len = data_len / 3; 25 | temp = data_len % 3; 26 | if (temp > 0) { 27 | 28 | ret_len += 1; 29 | 30 | } 31 | ret_len = ret_len * 4 + 1; 32 | ret = (char *) malloc(ret_len); 33 | 34 | if (ret == NULL) { 35 | 36 | printf("No enough memory.\n"); 37 | exit(0); 38 | 39 | } 40 | memset(ret, 0, ret_len); 41 | f = ret; 42 | while (tmp < data_len) { 43 | 44 | temp = 0; 45 | prepare = 0; 46 | memset(changed, '\0', 4); 47 | while (temp < 3) { 48 | 49 | //printf("tmp = %d\n", tmp); 50 | if (tmp >= data_len) { 51 | 52 | break; 53 | 54 | } 55 | prepare = ((prepare << 8) | (data[tmp] & 0xFF)); 56 | tmp++; 57 | temp++; 58 | 59 | } 60 | prepare = (prepare << ((3 - temp) * 8)); 61 | //printf("before for : temp = %d, prepare = %d\n", temp, prepare); 62 | for (i = 0; i < 4; i++) { 63 | 64 | if (temp < i) { 65 | 66 | changed[i] = 0x40; 67 | 68 | } else { 69 | 70 | changed[i] = (prepare >> ((3 - i) * 6)) & 0x3F; 71 | 72 | } 73 | *f = base[changed[i]]; 74 | //printf("%.2X", changed[i]); 75 | f++; 76 | 77 | } 78 | 79 | } 80 | *f = '\0'; 81 | 82 | return ret; 83 | 84 | } 85 | /* */ 86 | static char find_pos(char ch) { 87 | 88 | char *ptr = (char*) strrchr(base, ch); //the last position (the only) in base[] 89 | return (ptr - base); 90 | 91 | } 92 | /* */ 93 | char *base64_decode(const char *data, int data_len) { 94 | 95 | int ret_len = (data_len / 4) * 3; 96 | int equal_count = 0; 97 | char *ret = NULL; 98 | char *f = NULL; 99 | int tmp = 0; 100 | int temp = 0; 101 | char need[3]; 102 | int prepare = 0; 103 | int i = 0; 104 | if (*(data + data_len - 1) == '=') { 105 | 106 | equal_count += 1; 107 | 108 | } 109 | if (*(data + data_len - 2) == '=') { 110 | 111 | equal_count += 1; 112 | 113 | } 114 | if (*(data + data_len - 3) == '=') { 115 | //seems impossible 116 | equal_count += 1; 117 | 118 | } 119 | switch (equal_count) { 120 | 121 | case 0: 122 | ret_len += 4; //3 + 1 [1 for NULL] 123 | break; 124 | case 1: 125 | ret_len += 4; //Ceil((6*3)/8)+1 126 | break; 127 | case 2: 128 | ret_len += 3; //Ceil((6*2)/8)+1 129 | break; 130 | case 3: 131 | ret_len += 2; //Ceil((6*1)/8)+1 132 | break; 133 | 134 | } 135 | ret = (char *) malloc(ret_len); 136 | if (ret == NULL) { 137 | 138 | printf("No enough memory.\n"); 139 | exit(0); 140 | 141 | } 142 | memset(ret, 0, ret_len); 143 | f = ret; 144 | while (tmp < (data_len - equal_count)) { 145 | 146 | temp = 0; 147 | prepare = 0; 148 | memset(need, 0, 3); 149 | while (temp < 4) { 150 | 151 | if (tmp >= (data_len - equal_count)) { 152 | 153 | break; 154 | 155 | } 156 | prepare = (prepare << 6) | (find_pos(data[tmp])); 157 | temp++; 158 | tmp++; 159 | 160 | } 161 | prepare = prepare << ((4 - temp) * 6); 162 | for (i = 0; i < 3; i++) { 163 | 164 | if (i == temp) { 165 | 166 | break; 167 | 168 | } 169 | *f = (char) ((prepare >> ((2 - i) * 8)) & 0xFF); 170 | f++; 171 | 172 | } 173 | 174 | } 175 | *f = '\0'; 176 | return ret; 177 | 178 | } 179 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/jni/com_jinlin_util_MD5.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_util_MD5 */ 4 | 5 | #ifndef _Included_com_jinlin_util_MD5 6 | #define _Included_com_jinlin_util_MD5 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_util_MD5 12 | * Method: encryptByMD5 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_com_jinlin_util_MD5_encryptByMD5 16 | (JNIEnv *, jclass, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/jni/md5.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by J!nl!n on 15/11/10. 3 | // 4 | 5 | /* MD5.H - header file for MD5C.C 6 | */ 7 | 8 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 9 | rights reserved. 10 | 11 | License to copy and use this software is granted provided that it 12 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 13 | Algorithm" in all material mentioning or referencing this software 14 | or this function. 15 | 16 | License is also granted to make and use derivative works provided 17 | that such works are identified as "derived from the RSA Data 18 | Security, Inc. MD5 Message-Digest Algorithm" in all material 19 | mentioning or referencing the derived work. 20 | 21 | RSA Data Security, Inc. makes no representations concerning either 22 | the merchantability of this software or the suitability of this 23 | software for any particular purpose. It is provided "as is" 24 | without express or implied warranty of any kind. 25 | 26 | These notices must be retained in any copies of any part of this 27 | documentation and/or software. 28 | */ 29 | 30 | /* POINTER defines a generic pointer type */ 31 | typedef unsigned char *POINTER; 32 | 33 | /* UINT2 defines a two byte word */ 34 | typedef unsigned short int UINT2; 35 | 36 | /* UINT4 defines a four byte word */ 37 | typedef unsigned long int UINT4; 38 | 39 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 40 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 41 | returns an empty list. 42 | */ 43 | 44 | /* MD5 context. */ 45 | typedef struct tagMD5_CTX { 46 | UINT4 state[4]; 47 | /* state (ABCD) */ 48 | UINT4 count[2]; 49 | /* number of bits, modulo 2^64 (lsb first) */ 50 | unsigned char buffer[64]; /* input buffer */ 51 | } MD5_CTX; 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | void MD5Init(MD5_CTX *context); 56 | void MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen); 57 | void MD5Final(unsigned char digest[16], MD5_CTX *context); 58 | 59 | static void MD5Transform(UINT4 state[4], unsigned char block[64]); 60 | static void Encode(unsigned char *output, UINT4 *input, unsigned int len); 61 | static void Decode(UINT4 *output, unsigned char *input, unsigned int len); 62 | static void MD5_memcpy(POINTER output, POINTER input, unsigned int len); 63 | static void MD5_memset(POINTER output, int value, unsigned int len); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/jni/md5_util.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "com_jinlin_util_MD5.h" 5 | #include "md5.h" 6 | 7 | #define LOG_TAG "MD5" 8 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) 9 | 10 | // 把java的字符串转换成c的字符串,使用反射 11 | char *Jstring2CStr(JNIEnv *env, jstring jstr) { 12 | char *rtn = NULL; 13 | // 1:先找到字节码文件 14 | jclass clsstring = (*env)->FindClass(env, "java/lang/String"); 15 | jstring strencode = (*env)->NewStringUTF(env, "GB2312"); 16 | // 2:通过字节码文件找到方法ID 17 | jmethodID mid = (*env)->GetMethodID(env, clsstring, "getBytes", "(Ljava/lang/String;)[B"); 18 | // 3:通过方法id,调用方法 19 | jbyteArray barr = (jbyteArray) (*env)->CallObjectMethod(env, jstr, mid, strencode); // String .getByte("GB2312"); 20 | // 4:得到数据的长度 21 | jsize alen = (*env)->GetArrayLength(env, barr); 22 | // 5:得到数据的首地址 23 | jbyte *ba = (*env)->GetByteArrayElements(env, barr, JNI_FALSE); 24 | // 6:得到C语言的字符串 25 | if (alen > 0) { 26 | rtn = (char *) malloc(alen + 1); //"\0" 27 | memcpy(rtn, ba, alen); 28 | rtn[alen] = 0; 29 | } 30 | (*env)->ReleaseByteArrayElements(env, barr, ba, 0); // 31 | return rtn; 32 | } 33 | 34 | /* 35 | * Class: com_jinlin_util_MD5 36 | * Method: encryptByMD5 37 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 38 | */ 39 | JNIEXPORT jstring JNICALL Java_com_jinlin_util_MD5_encryptByMD5 40 | (JNIEnv *env, jclass jcalzz, jstring jInfo) { 41 | 42 | // char* cstr = Jstring2CStr(env, jInfo); 43 | char *cstr = (char *) (*env)->GetStringUTFChars(env, jInfo, 0); 44 | 45 | MD5_CTX context = {0}; 46 | MD5Init(&context); 47 | MD5Update(&context, cstr, strlen(cstr)); 48 | unsigned char dest[16] = {0}; 49 | MD5Final(dest, &context); 50 | (*env)->ReleaseStringUTFChars(env, jInfo, cstr); 51 | 52 | int i; 53 | char destination[32] = {0}; 54 | for (i = 0; i < 16; i++) { 55 | sprintf(destination, "%s%02x", destination, dest[i]); 56 | } 57 | LOGI("%s", destination); 58 | return (*env)->NewStringUTF(env, destination); 59 | } 60 | 61 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 16 | 17 | 22 | 23 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-as/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-as/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-as/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-as/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-as/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | jni-md5-as 3 | 4 | -------------------------------------------------------------------------------- /jni-md5-as/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jni-md5-as/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /jni-md5-as/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /jni-md5-as/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-as/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /jni-md5-as/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 10 12:52:16 CST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 7 | -------------------------------------------------------------------------------- /jni-md5-as/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /jni-md5-as/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /jni-md5-as/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /jni-md5-ec/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /jni-md5-ec/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | jni-md5-ec 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /jni-md5-ec/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /jni-md5-ec/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /jni-md5-ec/bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /jni-md5-ec/bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/classes.dex -------------------------------------------------------------------------------- /jni-md5-ec/bin/classes/com_jinlin_util_MD5.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_util_MD5 */ 4 | 5 | #ifndef _Included_com_jinlin_util_MD5 6 | #define _Included_com_jinlin_util_MD5 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_util_MD5 12 | * Method: encryptByMD5 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_com_jinlin_util_MD5_encryptByMD5 16 | (JNIEnv *, jclass, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /jni-md5-ec/bin/dexedLibs/android-support-v4-5f3d2d17147a77bc4a994dc12a087686.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/dexedLibs/android-support-v4-5f3d2d17147a77bc4a994dc12a087686.jar -------------------------------------------------------------------------------- /jni-md5-ec/bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependency. DO NOT EDIT. 2 | # format is 3 | # Encoding is UTF-8 4 | -------------------------------------------------------------------------------- /jni-md5-ec/bin/jni-md5-ec.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/jni-md5-ec.apk -------------------------------------------------------------------------------- /jni-md5-ec/bin/res/crunch/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/res/crunch/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/bin/res/crunch/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/res/crunch/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/bin/res/crunch/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/res/crunch/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/bin/res/crunch/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/res/crunch/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/bin/resources.ap_ -------------------------------------------------------------------------------- /jni-md5-ec/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/ic_launcher-web.png -------------------------------------------------------------------------------- /jni-md5-ec/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | # 对应打包成函数库的名字 6 | LOCAL_MODULE := md5 7 | # 对应c代码的文件 8 | LOCAL_SRC_FILES := md5_util.c md5.c 9 | LOCAL_LDLIBS += -llog 10 | 11 | include $(BUILD_SHARED_LIBRARY) -------------------------------------------------------------------------------- /jni-md5-ec/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PLATFORM := android-10 2 | APP_ABI := all 3 | -------------------------------------------------------------------------------- /jni-md5-ec/jni/base64.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | const char base[] = 7 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 8 | char* base64_encode(const char* data, int data_len); 9 | char *base64_decode(const char* data, int data_len); 10 | static char find_pos(char ch); 11 | 12 | /* */ 13 | char *base64_encode(const char* data, int data_len) { 14 | 15 | //int data_len = strlen(data); 16 | int prepare = 0; 17 | int ret_len; 18 | int temp = 0; 19 | char *ret = NULL; 20 | char *f = NULL; 21 | int tmp = 0; 22 | char changed[4]; 23 | int i = 0; 24 | ret_len = data_len / 3; 25 | temp = data_len % 3; 26 | if (temp > 0) { 27 | 28 | ret_len += 1; 29 | 30 | } 31 | ret_len = ret_len * 4 + 1; 32 | ret = (char *) malloc(ret_len); 33 | 34 | if (ret == NULL) { 35 | 36 | printf("No enough memory.\n"); 37 | exit(0); 38 | 39 | } 40 | memset(ret, 0, ret_len); 41 | f = ret; 42 | while (tmp < data_len) { 43 | 44 | temp = 0; 45 | prepare = 0; 46 | memset(changed, '\0', 4); 47 | while (temp < 3) { 48 | 49 | //printf("tmp = %d\n", tmp); 50 | if (tmp >= data_len) { 51 | 52 | break; 53 | 54 | } 55 | prepare = ((prepare << 8) | (data[tmp] & 0xFF)); 56 | tmp++; 57 | temp++; 58 | 59 | } 60 | prepare = (prepare << ((3 - temp) * 8)); 61 | //printf("before for : temp = %d, prepare = %d\n", temp, prepare); 62 | for (i = 0; i < 4; i++) { 63 | 64 | if (temp < i) { 65 | 66 | changed[i] = 0x40; 67 | 68 | } else { 69 | 70 | changed[i] = (prepare >> ((3 - i) * 6)) & 0x3F; 71 | 72 | } 73 | *f = base[changed[i]]; 74 | //printf("%.2X", changed[i]); 75 | f++; 76 | 77 | } 78 | 79 | } 80 | *f = '\0'; 81 | 82 | return ret; 83 | 84 | } 85 | /* */ 86 | static char find_pos(char ch) { 87 | 88 | char *ptr = (char*) strrchr(base, ch); //the last position (the only) in base[] 89 | return (ptr - base); 90 | 91 | } 92 | /* */ 93 | char *base64_decode(const char *data, int data_len) { 94 | 95 | int ret_len = (data_len / 4) * 3; 96 | int equal_count = 0; 97 | char *ret = NULL; 98 | char *f = NULL; 99 | int tmp = 0; 100 | int temp = 0; 101 | char need[3]; 102 | int prepare = 0; 103 | int i = 0; 104 | if (*(data + data_len - 1) == '=') { 105 | 106 | equal_count += 1; 107 | 108 | } 109 | if (*(data + data_len - 2) == '=') { 110 | 111 | equal_count += 1; 112 | 113 | } 114 | if (*(data + data_len - 3) == '=') { 115 | //seems impossible 116 | equal_count += 1; 117 | 118 | } 119 | switch (equal_count) { 120 | 121 | case 0: 122 | ret_len += 4; //3 + 1 [1 for NULL] 123 | break; 124 | case 1: 125 | ret_len += 4; //Ceil((6*3)/8)+1 126 | break; 127 | case 2: 128 | ret_len += 3; //Ceil((6*2)/8)+1 129 | break; 130 | case 3: 131 | ret_len += 2; //Ceil((6*1)/8)+1 132 | break; 133 | 134 | } 135 | ret = (char *) malloc(ret_len); 136 | if (ret == NULL) { 137 | 138 | printf("No enough memory.\n"); 139 | exit(0); 140 | 141 | } 142 | memset(ret, 0, ret_len); 143 | f = ret; 144 | while (tmp < (data_len - equal_count)) { 145 | 146 | temp = 0; 147 | prepare = 0; 148 | memset(need, 0, 3); 149 | while (temp < 4) { 150 | 151 | if (tmp >= (data_len - equal_count)) { 152 | 153 | break; 154 | 155 | } 156 | prepare = (prepare << 6) | (find_pos(data[tmp])); 157 | temp++; 158 | tmp++; 159 | 160 | } 161 | prepare = prepare << ((4 - temp) * 6); 162 | for (i = 0; i < 3; i++) { 163 | 164 | if (i == temp) { 165 | 166 | break; 167 | 168 | } 169 | *f = (char) ((prepare >> ((2 - i) * 8)) & 0xFF); 170 | f++; 171 | 172 | } 173 | 174 | } 175 | *f = '\0'; 176 | return ret; 177 | 178 | } 179 | -------------------------------------------------------------------------------- /jni-md5-ec/jni/com_jinlin_util_MD5.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_util_MD5 */ 4 | 5 | #ifndef _Included_com_jinlin_util_MD5 6 | #define _Included_com_jinlin_util_MD5 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_util_MD5 12 | * Method: encryptByMD5 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_com_jinlin_util_MD5_encryptByMD5 16 | (JNIEnv *, jclass, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /jni-md5-ec/jni/md5.h: -------------------------------------------------------------------------------- 1 | /* MD5.H - header file for MD5C.C 2 | */ 3 | 4 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 5 | rights reserved. 6 | 7 | License to copy and use this software is granted provided that it 8 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 9 | Algorithm" in all material mentioning or referencing this software 10 | or this function. 11 | 12 | License is also granted to make and use derivative works provided 13 | that such works are identified as "derived from the RSA Data 14 | Security, Inc. MD5 Message-Digest Algorithm" in all material 15 | mentioning or referencing the derived work. 16 | 17 | RSA Data Security, Inc. makes no representations concerning either 18 | the merchantability of this software or the suitability of this 19 | software for any particular purpose. It is provided "as is" 20 | without express or implied warranty of any kind. 21 | 22 | These notices must be retained in any copies of any part of this 23 | documentation and/or software. 24 | */ 25 | 26 | /* POINTER defines a generic pointer type */ 27 | typedef unsigned char *POINTER; 28 | 29 | /* UINT2 defines a two byte word */ 30 | typedef unsigned short int UINT2; 31 | 32 | /* UINT4 defines a four byte word */ 33 | typedef unsigned long int UINT4; 34 | 35 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 36 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 37 | returns an empty list. 38 | */ 39 | 40 | /* MD5 context. */ 41 | typedef struct tagMD5_CTX{ 42 | UINT4 state[4]; /* state (ABCD) */ 43 | UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 44 | unsigned char buffer[64]; /* input buffer */ 45 | } MD5_CTX; 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | void MD5Init (MD5_CTX *context); 50 | void MD5Update (MD5_CTX *context,unsigned char *input,unsigned int inputLen); 51 | void MD5Final (unsigned char digest[16], MD5_CTX *context); 52 | 53 | static void MD5Transform (UINT4 state[4], unsigned char block[64]); 54 | static void Encode (unsigned char *output, UINT4 *input, unsigned int len); 55 | static void Decode (UINT4 *output, unsigned char *input, unsigned int len); 56 | static void MD5_memcpy (POINTER output, POINTER input, unsigned int len); 57 | static void MD5_memset (POINTER output, int value, unsigned int len); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /jni-md5-ec/jni/md5_util.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "com_jinlin_util_MD5.h" 5 | #include "md5.h" 6 | 7 | #define LOG_TAG "MD5" 8 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) 9 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) 10 | 11 | // 把java的字符串转换成c的字符串,使用反射 12 | char* Jstring2CStr(JNIEnv* env, jstring jstr) { 13 | char* rtn = NULL; 14 | // 1:先找到字节码文件 15 | jclass clsstring = (*env)->FindClass(env, "java/lang/String"); 16 | jstring strencode = (*env)->NewStringUTF(env, "GB2312"); 17 | // 2:通过字节码文件找到方法ID 18 | jmethodID mid = (*env)->GetMethodID(env, clsstring, "getBytes", "(Ljava/lang/String;)[B"); 19 | // 3:通过方法id,调用方法 20 | jbyteArray barr = (jbyteArray)(*env)->CallObjectMethod(env, jstr, mid, strencode); // String .getByte("GB2312"); 21 | // 4:得到数据的长度 22 | jsize alen = (*env)->GetArrayLength(env, barr); 23 | // 5:得到数据的首地址 24 | jbyte* ba = (*env)->GetByteArrayElements(env, barr, JNI_FALSE); 25 | // 6:得到C语言的字符串 26 | if (alen > 0) { 27 | rtn = (char*) malloc(alen + 1); //"\0" 28 | memcpy(rtn, ba, alen); 29 | rtn[alen] = 0; 30 | } 31 | (*env)->ReleaseByteArrayElements(env, barr, ba, 0); // 32 | return rtn; 33 | } 34 | 35 | /* 36 | * Class: com_jinlin_util_MD5 37 | * Method: encryptByMD5 38 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 39 | */ 40 | JNIEXPORT jstring JNICALL Java_com_jinlin_util_MD5_encryptByMD5(JNIEnv *env, 41 | jclass jclazz, jstring jInfo) { 42 | 43 | char* cstr = Jstring2CStr(env, jInfo); 44 | // char* cstr = (char*)(*env)->GetStringUTFChars(env, jInfo, 0); 45 | 46 | MD5_CTX context = { 0 }; 47 | MD5Init(&context); 48 | MD5Update(&context, cstr, strlen(cstr)); 49 | unsigned char dest[16] = { 0 }; 50 | MD5Final(dest, &context); 51 | (*env)->ReleaseStringUTFChars(env, jInfo, cstr); 52 | 53 | int i; 54 | char destination[32] = { 0 }; 55 | for (i = 0; i < 16; i++) { 56 | sprintf(destination, "%s%02x", destination, dest[i]); 57 | } 58 | LOGI("%s", destination); 59 | return (*env)->NewStringUTF(env, destination); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /jni-md5-ec/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/android-support-v4.jar -------------------------------------------------------------------------------- /jni-md5-ec/libs/arm64-v8a/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/arm64-v8a/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/libs/armeabi-v7a/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/armeabi-v7a/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/libs/armeabi/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/armeabi/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/libs/mips/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/mips/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/libs/mips64/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/mips64/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/libs/x86/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/x86/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/libs/x86_64/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/libs/x86_64/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/arm64-v8a/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/arm64-v8a/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/arm64-v8a/objs/md5/md5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/arm64-v8a/objs/md5/md5.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/arm64-v8a/objs/md5/md5.o.d: -------------------------------------------------------------------------------- 1 | obj/local/arm64-v8a/objs/md5/md5.o: jni/md5.c jni/md5.h 2 | 3 | jni/md5.h: 4 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/arm64-v8a/objs/md5/md5_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/arm64-v8a/objs/md5/md5_util.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/arm64-v8a/objs/md5/md5_util.o.d: -------------------------------------------------------------------------------- 1 | obj/local/arm64-v8a/objs/md5/md5_util.o: jni/md5_util.c \ 2 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/stdio.h \ 3 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/cdefs.h \ 4 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/cdefs_elf.h \ 5 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/android/api-level.h \ 6 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/types.h \ 7 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/stdint.h \ 8 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/machine/wchar_limits.h \ 9 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/types.h \ 10 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm/types.h \ 11 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/types.h \ 12 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/int-ll64.h \ 13 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm/bitsperlong.h \ 14 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/bitsperlong.h \ 15 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/posix_types.h \ 16 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/stddef.h \ 17 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/compiler.h \ 18 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm/posix_types.h \ 19 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/posix_types.h \ 20 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/sysmacros.h \ 21 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/string.h \ 22 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/malloc.h \ 23 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/xlocale.h \ 24 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/android/log.h \ 25 | jni/com_jinlin_util_MD5.h \ 26 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/jni.h \ 27 | jni/md5.h 28 | 29 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/stdio.h: 30 | 31 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/cdefs.h: 32 | 33 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/cdefs_elf.h: 34 | 35 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/android/api-level.h: 36 | 37 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/types.h: 38 | 39 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/stdint.h: 40 | 41 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/machine/wchar_limits.h: 42 | 43 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/types.h: 44 | 45 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm/types.h: 46 | 47 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/types.h: 48 | 49 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/int-ll64.h: 50 | 51 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm/bitsperlong.h: 52 | 53 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/bitsperlong.h: 54 | 55 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/posix_types.h: 56 | 57 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/stddef.h: 58 | 59 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/linux/compiler.h: 60 | 61 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm/posix_types.h: 62 | 63 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/asm-generic/posix_types.h: 64 | 65 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/sysmacros.h: 66 | 67 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/string.h: 68 | 69 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/malloc.h: 70 | 71 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/xlocale.h: 72 | 73 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/android/log.h: 74 | 75 | jni/com_jinlin_util_MD5.h: 76 | 77 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/jni.h: 78 | 79 | jni/md5.h: 80 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi-v7a/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/armeabi-v7a/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi-v7a/objs/md5/md5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/armeabi-v7a/objs/md5/md5.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi-v7a/objs/md5/md5.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi-v7a/objs/md5/md5.o: jni/md5.c jni/md5.h 2 | 3 | jni/md5.h: 4 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi-v7a/objs/md5/md5_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/armeabi-v7a/objs/md5/md5_util.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi-v7a/objs/md5/md5_util.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi-v7a/objs/md5/md5_util.o: jni/md5_util.c \ 2 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdio.h \ 3 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs.h \ 4 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs_elf.h \ 5 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/api-level.h \ 6 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/types.h \ 7 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdint.h \ 8 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_types.h \ 9 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/_types.h \ 10 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_wchar_limits.h \ 11 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/posix_types.h \ 12 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/stddef.h \ 13 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/compiler.h \ 14 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/posix_types.h \ 15 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/types.h \ 16 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/types.h \ 17 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/kernel.h \ 18 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/sysmacros.h \ 19 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/string.h \ 20 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/malloc.h \ 21 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/log.h \ 22 | jni/com_jinlin_util_MD5.h \ 23 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/jni.h \ 24 | jni/md5.h 25 | 26 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdio.h: 27 | 28 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs.h: 29 | 30 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs_elf.h: 31 | 32 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/api-level.h: 33 | 34 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/types.h: 35 | 36 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdint.h: 37 | 38 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_types.h: 39 | 40 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/_types.h: 41 | 42 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_wchar_limits.h: 43 | 44 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/posix_types.h: 45 | 46 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/stddef.h: 47 | 48 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/compiler.h: 49 | 50 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/posix_types.h: 51 | 52 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/types.h: 53 | 54 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/types.h: 55 | 56 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/kernel.h: 57 | 58 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/sysmacros.h: 59 | 60 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/string.h: 61 | 62 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/malloc.h: 63 | 64 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/log.h: 65 | 66 | jni/com_jinlin_util_MD5.h: 67 | 68 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/jni.h: 69 | 70 | jni/md5.h: 71 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/armeabi/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi/objs/md5/md5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/armeabi/objs/md5/md5.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi/objs/md5/md5.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/md5/md5.o: jni/md5.c jni/md5.h 2 | 3 | jni/md5.h: 4 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi/objs/md5/md5_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/armeabi/objs/md5/md5_util.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/armeabi/objs/md5/md5_util.o.d: -------------------------------------------------------------------------------- 1 | obj/local/armeabi/objs/md5/md5_util.o: jni/md5_util.c \ 2 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdio.h \ 3 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs.h \ 4 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs_elf.h \ 5 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/api-level.h \ 6 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/types.h \ 7 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdint.h \ 8 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_types.h \ 9 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/_types.h \ 10 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_wchar_limits.h \ 11 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/posix_types.h \ 12 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/stddef.h \ 13 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/compiler.h \ 14 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/posix_types.h \ 15 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/types.h \ 16 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/types.h \ 17 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/kernel.h \ 18 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/sysmacros.h \ 19 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/string.h \ 20 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/malloc.h \ 21 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/log.h \ 22 | jni/com_jinlin_util_MD5.h \ 23 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/jni.h \ 24 | jni/md5.h 25 | 26 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdio.h: 27 | 28 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs.h: 29 | 30 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/cdefs_elf.h: 31 | 32 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/api-level.h: 33 | 34 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/types.h: 35 | 36 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/stdint.h: 37 | 38 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_types.h: 39 | 40 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/_types.h: 41 | 42 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/_wchar_limits.h: 43 | 44 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/posix_types.h: 45 | 46 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/stddef.h: 47 | 48 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/compiler.h: 49 | 50 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/posix_types.h: 51 | 52 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/asm/types.h: 53 | 54 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/linux/types.h: 55 | 56 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/machine/kernel.h: 57 | 58 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/sys/sysmacros.h: 59 | 60 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/string.h: 61 | 62 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/malloc.h: 63 | 64 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/android/log.h: 65 | 66 | jni/com_jinlin_util_MD5.h: 67 | 68 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-arm/usr/include/jni.h: 69 | 70 | jni/md5.h: 71 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/mips/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips/objs/md5/md5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/mips/objs/md5/md5.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips/objs/md5/md5.o.d: -------------------------------------------------------------------------------- 1 | obj/local/mips/objs/md5/md5.o: jni/md5.c jni/md5.h 2 | 3 | jni/md5.h: 4 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips/objs/md5/md5_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/mips/objs/md5/md5_util.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips/objs/md5/md5_util.o.d: -------------------------------------------------------------------------------- 1 | obj/local/mips/objs/md5/md5_util.o: jni/md5_util.c \ 2 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/stdio.h \ 3 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/cdefs.h \ 4 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/cdefs_elf.h \ 5 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/android/api-level.h \ 6 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/types.h \ 7 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/stdint.h \ 8 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/_types.h \ 9 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/machine/_types.h \ 10 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/_wchar_limits.h \ 11 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/posix_types.h \ 12 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/stddef.h \ 13 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/compiler.h \ 14 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/asm/posix_types.h \ 15 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/asm/sgidefs.h \ 16 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/asm/types.h \ 17 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/types.h \ 18 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/machine/kernel.h \ 19 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/sysmacros.h \ 20 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/string.h \ 21 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/malloc.h \ 22 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/android/log.h \ 23 | jni/com_jinlin_util_MD5.h \ 24 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/jni.h \ 25 | jni/md5.h 26 | 27 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/stdio.h: 28 | 29 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/cdefs.h: 30 | 31 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/cdefs_elf.h: 32 | 33 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/android/api-level.h: 34 | 35 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/types.h: 36 | 37 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/stdint.h: 38 | 39 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/_types.h: 40 | 41 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/machine/_types.h: 42 | 43 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/_wchar_limits.h: 44 | 45 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/posix_types.h: 46 | 47 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/stddef.h: 48 | 49 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/compiler.h: 50 | 51 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/asm/posix_types.h: 52 | 53 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/asm/sgidefs.h: 54 | 55 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/asm/types.h: 56 | 57 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/linux/types.h: 58 | 59 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/machine/kernel.h: 60 | 61 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/sys/sysmacros.h: 62 | 63 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/string.h: 64 | 65 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/malloc.h: 66 | 67 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/android/log.h: 68 | 69 | jni/com_jinlin_util_MD5.h: 70 | 71 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-mips/usr/include/jni.h: 72 | 73 | jni/md5.h: 74 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips64/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/mips64/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips64/objs/md5/md5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/mips64/objs/md5/md5.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips64/objs/md5/md5.o.d: -------------------------------------------------------------------------------- 1 | obj/local/mips64/objs/md5/md5.o: jni/md5.c jni/md5.h 2 | 3 | jni/md5.h: 4 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips64/objs/md5/md5_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/mips64/objs/md5/md5_util.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/mips64/objs/md5/md5_util.o.d: -------------------------------------------------------------------------------- 1 | obj/local/mips64/objs/md5/md5_util.o: jni/md5_util.c \ 2 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/stdio.h \ 3 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/cdefs.h \ 4 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/cdefs_elf.h \ 5 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/android/api-level.h \ 6 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/types.h \ 7 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/stdint.h \ 8 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/machine/wchar_limits.h \ 9 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/types.h \ 10 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/types.h \ 11 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm-generic/int-l64.h \ 12 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/bitsperlong.h \ 13 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm-generic/bitsperlong.h \ 14 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/posix_types.h \ 15 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/stddef.h \ 16 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/compiler.h \ 17 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/posix_types.h \ 18 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/sgidefs.h \ 19 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm-generic/posix_types.h \ 20 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/sysmacros.h \ 21 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/string.h \ 22 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/malloc.h \ 23 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/xlocale.h \ 24 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/android/log.h \ 25 | jni/com_jinlin_util_MD5.h \ 26 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/jni.h \ 27 | jni/md5.h 28 | 29 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/stdio.h: 30 | 31 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/cdefs.h: 32 | 33 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/cdefs_elf.h: 34 | 35 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/android/api-level.h: 36 | 37 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/types.h: 38 | 39 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/stdint.h: 40 | 41 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/machine/wchar_limits.h: 42 | 43 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/types.h: 44 | 45 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/types.h: 46 | 47 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm-generic/int-l64.h: 48 | 49 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/bitsperlong.h: 50 | 51 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm-generic/bitsperlong.h: 52 | 53 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/posix_types.h: 54 | 55 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/stddef.h: 56 | 57 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/linux/compiler.h: 58 | 59 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/posix_types.h: 60 | 61 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm/sgidefs.h: 62 | 63 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/asm-generic/posix_types.h: 64 | 65 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/sys/sysmacros.h: 66 | 67 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/string.h: 68 | 69 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/malloc.h: 70 | 71 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/xlocale.h: 72 | 73 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/android/log.h: 74 | 75 | jni/com_jinlin_util_MD5.h: 76 | 77 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-mips64/usr/include/jni.h: 78 | 79 | jni/md5.h: 80 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/x86/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86/objs/md5/md5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/x86/objs/md5/md5.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86/objs/md5/md5.o.d: -------------------------------------------------------------------------------- 1 | obj/local/x86/objs/md5/md5.o: jni/md5.c jni/md5.h 2 | 3 | jni/md5.h: 4 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86/objs/md5/md5_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/x86/objs/md5/md5_util.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86/objs/md5/md5_util.o.d: -------------------------------------------------------------------------------- 1 | obj/local/x86/objs/md5/md5_util.o: jni/md5_util.c \ 2 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/stdio.h \ 3 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/cdefs.h \ 4 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/cdefs_elf.h \ 5 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/android/api-level.h \ 6 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/types.h \ 7 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/stdint.h \ 8 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/_types.h \ 9 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/machine/_types.h \ 10 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/_wchar_limits.h \ 11 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/posix_types.h \ 12 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/stddef.h \ 13 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/compiler.h \ 14 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/asm/posix_types.h \ 15 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/asm/posix_types_32.h \ 16 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/asm/types.h \ 17 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/types.h \ 18 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/machine/kernel.h \ 19 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/sysmacros.h \ 20 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/string.h \ 21 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/malloc.h \ 22 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/android/log.h \ 23 | jni/com_jinlin_util_MD5.h \ 24 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/jni.h \ 25 | jni/md5.h 26 | 27 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/stdio.h: 28 | 29 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/cdefs.h: 30 | 31 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/cdefs_elf.h: 32 | 33 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/android/api-level.h: 34 | 35 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/types.h: 36 | 37 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/stdint.h: 38 | 39 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/_types.h: 40 | 41 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/machine/_types.h: 42 | 43 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/_wchar_limits.h: 44 | 45 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/posix_types.h: 46 | 47 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/stddef.h: 48 | 49 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/compiler.h: 50 | 51 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/asm/posix_types.h: 52 | 53 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/asm/posix_types_32.h: 54 | 55 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/asm/types.h: 56 | 57 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/linux/types.h: 58 | 59 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/machine/kernel.h: 60 | 61 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/sys/sysmacros.h: 62 | 63 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/string.h: 64 | 65 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/malloc.h: 66 | 67 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/android/log.h: 68 | 69 | jni/com_jinlin_util_MD5.h: 70 | 71 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-9/arch-x86/usr/include/jni.h: 72 | 73 | jni/md5.h: 74 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86_64/libmd5.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/x86_64/libmd5.so -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86_64/objs/md5/md5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/x86_64/objs/md5/md5.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86_64/objs/md5/md5.o.d: -------------------------------------------------------------------------------- 1 | obj/local/x86_64/objs/md5/md5.o: jni/md5.c jni/md5.h 2 | 3 | jni/md5.h: 4 | -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86_64/objs/md5/md5_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/obj/local/x86_64/objs/md5/md5_util.o -------------------------------------------------------------------------------- /jni-md5-ec/obj/local/x86_64/objs/md5/md5_util.o.d: -------------------------------------------------------------------------------- 1 | obj/local/x86_64/objs/md5/md5_util.o: jni/md5_util.c \ 2 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/stdio.h \ 3 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/cdefs.h \ 4 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/cdefs_elf.h \ 5 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/android/api-level.h \ 6 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/types.h \ 7 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/stdint.h \ 8 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/machine/wchar_limits.h \ 9 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/types.h \ 10 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/types.h \ 11 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/types.h \ 12 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/int-ll64.h \ 13 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/bitsperlong.h \ 14 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/bitsperlong.h \ 15 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/posix_types.h \ 16 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/stddef.h \ 17 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/compiler.h \ 18 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/posix_types.h \ 19 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/posix_types_64.h \ 20 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/posix_types.h \ 21 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/sysmacros.h \ 22 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/string.h \ 23 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/malloc.h \ 24 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/xlocale.h \ 25 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/android/log.h \ 26 | jni/com_jinlin_util_MD5.h \ 27 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/jni.h \ 28 | jni/md5.h 29 | 30 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/stdio.h: 31 | 32 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/cdefs.h: 33 | 34 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/cdefs_elf.h: 35 | 36 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/android/api-level.h: 37 | 38 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/types.h: 39 | 40 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/stdint.h: 41 | 42 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/machine/wchar_limits.h: 43 | 44 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/types.h: 45 | 46 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/types.h: 47 | 48 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/types.h: 49 | 50 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/int-ll64.h: 51 | 52 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/bitsperlong.h: 53 | 54 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/bitsperlong.h: 55 | 56 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/posix_types.h: 57 | 58 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/stddef.h: 59 | 60 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/linux/compiler.h: 61 | 62 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/posix_types.h: 63 | 64 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm/posix_types_64.h: 65 | 66 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/asm-generic/posix_types.h: 67 | 68 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/sys/sysmacros.h: 69 | 70 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/string.h: 71 | 72 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/malloc.h: 73 | 74 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/xlocale.h: 75 | 76 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/android/log.h: 77 | 78 | jni/com_jinlin_util_MD5.h: 79 | 80 | /Users/2015-249-pc/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/include/jni.h: 81 | 82 | jni/md5.h: 83 | -------------------------------------------------------------------------------- /jni-md5-ec/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /jni-md5-ec/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-23 15 | -------------------------------------------------------------------------------- /jni-md5-ec/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5peak2me/jni-encrypt/76023c4dc118c140f11e6b801c6d38ba8d6e28f6/jni-md5-ec/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /jni-md5-ec/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | 17 | 18 | 23 | 24 | -------------------------------------------------------------------------------- /jni-md5-ec/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jni-md5-ec/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /jni-md5-ec/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jni-md5-ec 5 | Hello world! 6 | 7 | 8 | -------------------------------------------------------------------------------- /jni-md5-ec/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /jni-md5-ec/src/com/jinlin/md5/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.md5; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.text.Editable; 6 | import android.text.TextWatcher; 7 | import android.widget.EditText; 8 | import android.widget.TextView; 9 | 10 | import com.jinlin.jni_md5.R; 11 | import com.jinlin.util.MD5; 12 | 13 | public class MainActivity extends Activity { 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | 19 | // 待加密 20 | String strText = "J!nl!n"; 21 | EditText et = (EditText) findViewById(R.id.et); 22 | et.setText(strText); 23 | 24 | // java 25 | final TextView tv2 = (TextView) findViewById(R.id.tv2); 26 | tv2.setText("java: " + MD5.getMD5(strText)); 27 | // ndk c 28 | final TextView tv3 = (TextView) findViewById(R.id.tv3); 29 | tv3.setText("ndk c: " + MD5.encryptByMD5(strText)); 30 | 31 | et.addTextChangedListener(new TextWatcher() { 32 | @Override 33 | public void onTextChanged(CharSequence s, int start, int before, int count) { 34 | } 35 | 36 | @Override 37 | public void beforeTextChanged(CharSequence s, int start, int count, int after) { 38 | } 39 | 40 | @Override 41 | public void afterTextChanged(Editable s) { 42 | tv2.setText("java: " + MD5.getMD5(s.toString())); 43 | tv3.setText("ndk c: " + MD5.encryptByMD5(s.toString())); 44 | } 45 | }); 46 | } 47 | 48 | static { 49 | System.loadLibrary("md5"); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /jni-md5-ec/src/com/jinlin/util/MD5.java: -------------------------------------------------------------------------------- 1 | package com.jinlin.util; 2 | 3 | import java.security.MessageDigest; 4 | 5 | public class MD5 { 6 | 7 | public static native String encryptByMD5(String str); 8 | 9 | public static String getMD5(String info) { 10 | try { 11 | MessageDigest md5 = MessageDigest.getInstance("MD5"); 12 | md5.update(info.getBytes("UTF-8")); 13 | byte[] encryption = md5.digest(); 14 | 15 | StringBuffer strBuf = new StringBuffer(); 16 | for (int i = 0; i < encryption.length; i++) { 17 | if (Integer.toHexString(0xff & encryption[i]).length() == 1) { 18 | strBuf.append("0").append(Integer.toHexString(0xff & encryption[i])); 19 | } else { 20 | strBuf.append(Integer.toHexString(0xff & encryption[i])); 21 | } 22 | } 23 | return strBuf.toString(); 24 | } catch (Exception e) { 25 | return ""; 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /jni-md5-ec/src/com_jinlin_util_MD5.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_jinlin_util_MD5 */ 4 | 5 | #ifndef _Included_com_jinlin_util_MD5 6 | #define _Included_com_jinlin_util_MD5 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_jinlin_util_MD5 12 | * Method: encryptByMD5 13 | * Signature: (Ljava/lang/String;)Ljava/lang/String; 14 | */ 15 | JNIEXPORT jstring JNICALL Java_com_jinlin_util_MD5_encryptByMD5 16 | (JNIEnv *, jclass, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | --------------------------------------------------------------------------------