├── .classpath ├── .gitignore ├── .project ├── AndroidManifest.xml ├── LICENSE ├── README.md ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ ├── ic_action_search.png │ └── ic_launcher.png ├── drawable-mdpi │ ├── ic_action_search.png │ └── ic_launcher.png ├── drawable-xhdpi │ ├── ic_action_search.png │ └── ic_launcher.png ├── layout │ └── activity_main.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── values │ ├── strings.xml │ └── styles.xml └── src └── org └── nick └── nfc └── seaccess ├── CPLC.java ├── GPCommands.java ├── Hex.java ├── KeyInfo.java ├── MainActivity.java ├── MifareManagerCommands.java ├── PPSE.java ├── SECardResponse.java ├── SEConnection.java ├── SEEMVSession.java ├── SEReceiver.java ├── SETerminal.java ├── SETerminalProvider.java ├── SecurityDomainFCI.java ├── WalletControllerCommands.java └── WalletControllerFCI.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android-se-access 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 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 11 | 12 | 16 | 17 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Nikolay Elenkov 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Android Secure Element (SE) access sample app 2 | ============================================== 3 | 4 | Shows how to access the secure element on Android 4.0.4 and 4.1. 5 | Requires a rooted device to install and run. More details and 6 | background information in related blog posts: 7 | 8 | * http://nelenkov.blogspot.com/2012/08/accessing-embedded-secure-element-in.html 9 | * http://nelenkov.blogspot.com/2012/08/android-secure-element-execution.html 10 | * http://nelenkov.blogspot.com/2012/08/exploring-google-wallet-using-secure.html 11 | 12 | **WARNING** 13 | 14 | While this program doesn't try to modify the SE and doesn't contain any 15 | 'dangerous' SE commands, using and/or modifying it may lock (brick) the secure 16 | element on your phone. Make sure you know what you are doing and use at your 17 | own risk! 18 | 19 | Building 20 | -------- 21 | 22 | 1. Get the source code for the Java EMV Reader library from http://code.google.com/p/javaemvreader/ and build it. 23 | 2. Drop the resulting jar file in `lib/`. 24 | 3. Import the project in Eclipse and build it. 25 | 26 | Installation and running 27 | ------------------------ 28 | 29 | 1. Add the signing certificate to `/etc/nfcee_access.xml` on your device. 30 | This requires root access to remount `/system` as rw. See first blog post 31 | for details on file format. 32 | 2. Sign and install the APK. 33 | 3. Run from launcher or Eclipse. 34 | 4. (Optional) Install Google Wallet to test EMV functionality. 35 | 36 | 37 | Read linked blog posts for more details. 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-16 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nelenkov/android-se-access/d28f28dac1a6d8ba0b55b94003e061308a60b3ac/res/drawable-hdpi/ic_action_search.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nelenkov/android-se-access/d28f28dac1a6d8ba0b55b94003e061308a60b3ac/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nelenkov/android-se-access/d28f28dac1a6d8ba0b55b94003e061308a60b3ac/res/drawable-mdpi/ic_action_search.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nelenkov/android-se-access/d28f28dac1a6d8ba0b55b94003e061308a60b3ac/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nelenkov/android-se-access/d28f28dac1a6d8ba0b55b94003e061308a60b3ac/res/drawable-xhdpi/ic_action_search.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nelenkov/android-se-access/d28f28dac1a6d8ba0b55b94003e061308a60b3ac/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 |