diff --git a/.gitmodules b/.gitmodules
index 50821d26..71f82324 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -9,7 +9,7 @@
url = https://github.com/philipWendland/IsoApplet.git
[submodule "ACardEmulator/app/src/main/external/jcardsim"]
path = ACardEmulator/app/src/main/external/jcardsim
- url = https://github.com/frankmorgner/jcardsim.git
+ url = https://github.com/licel/jcardsim
[submodule "ACardEmulator/app/src/main/external/MuscleApplet"]
path = ACardEmulator/app/src/main/external/MuscleApplet
url = https://github.com/martinpaljak/MuscleApplet.git
@@ -25,3 +25,6 @@
[submodule "ACardEmulator/app/src/main/external/PivApplet"]
path = ACardEmulator/app/src/main/external/PivApplet
url = https://github.com/frankmorgner/PivApplet
+[submodule "ACardEmulator/app/src/main/external/vJCRE"]
+ path = ACardEmulator/app/src/main/external/vJCRE
+ url = https://github.com/martinpaljak/vJCRE
diff --git a/ACardEmulator/ACardEmulator.iml b/ACardEmulator/ACardEmulator.iml
index 8d5ac928..3313c7c1 100644
--- a/ACardEmulator/ACardEmulator.iml
+++ b/ACardEmulator/ACardEmulator.iml
@@ -13,7 +13,7 @@
-
+
\ No newline at end of file
diff --git a/ACardEmulator/app/app.iml b/ACardEmulator/app/app.iml
index 2a937019..3966ed62 100644
--- a/ACardEmulator/app/app.iml
+++ b/ACardEmulator/app/app.iml
@@ -8,38 +8,73 @@
-
-
-
+
+
+
- generateDebugSources
+ generateFullDebugSources
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -59,6 +94,8 @@
+
+
@@ -85,7 +122,6 @@
-
@@ -105,6 +141,7 @@
+
@@ -119,9 +156,8 @@
-
-
+
\ No newline at end of file
diff --git a/ACardEmulator/app/build.gradle b/ACardEmulator/app/build.gradle
index 03b1dbd1..5b12d82c 100644
--- a/ACardEmulator/app/build.gradle
+++ b/ACardEmulator/app/build.gradle
@@ -1,4 +1,13 @@
apply plugin: 'com.android.application'
+apply plugin: 'com.github.johnrengelman.shadow'
+
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+task shadowJar(type: ShadowJar) {
+ configurations = [project.configurations.shadow]
+}
+tasks.withType(JavaCompile) {
+ compileTask -> compileTask.dependsOn shadowJar
+}
android {
compileSdkVersion 23
@@ -16,25 +25,43 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
+ flavorDimensions "distribution"
+ productFlavors {
+ full {
+ dimension "distribution"
+ }
+ fdroid {
+ dimension "distribution"
+ applicationIdSuffix ".fdroid"
+ }
+ }
sourceSets {
+ main.java.srcDirs += 'src/main/external/vJCRE/src'
+ main.java.exclude('pro/javacard/vre/VJCREProvider*')
+ main.java.exclude('visa/*')
main.java.srcDirs += 'src/main/external/jcardsim/src/main/java'
- main.java.exclude('**/APDUScriptTool.java')
- main.java.exclude('**/JavaxSmartCardInterface.java')
- main.java.exclude('**/CardTerminalSimulator.java')
- main.java.exclude('**/JCSCard*.java')
- main.java.exclude('**/JCSTerminal.java')
- main.java.exclude('**/JCSFactory.java')
- main.java.exclude('**/CardSimulator.java')
- main.java.exclude('**/CAD.java')
- main.java.exclude('**/CardTerminalSimulator.java')
+ main.java.exclude('com/licel/jcardsim/smartcardio/*')
+ main.java.exclude('com/licel/jcardsim/remote/*')
+ main.java.exclude('com/licel/jcardsim/utils/APDUScriptTool*')
+ main.java.exclude('com/licel/jcardsim/io/JavaxSmartCardInterface*')
+ main.java.exclude('com/licel/jcardsim/io/CAD*')
+ main.java.exclude('javacard/framework/service/CardRemoteObject*')
+ main.java.exclude('javacard/framework/service/RMIService*')
+ main.java.exclude('com/licel/jcardsim/utils/JavaCardApiProcessor*')
+ main.java.exclude('com/licel/jcardsim/framework/service/*')
+ main.java.exclude('com/licel/jcardsim/samples/*')
+ main.java.exclude('com/licel/jcardsim/crypto/*')
main.java.srcDirs += 'src/main/external/GidsApplet/src'
- main.java.exclude('**/gidsAppletTests/*.java')
+ main.java.exclude('com/mysmartlogon/gidsAppletTests/*')
main.java.srcDirs += 'src/main/external/IsoApplet/src'
main.java.srcDirs += 'src/main/external/PivApplet/src'
main.java.srcDirs += 'src/main/external/android-scio/src/main'
main.java.srcDirs += 'src/main/external/ykneo-openpgp/applet/src'
main.java.srcDirs += 'src/main/external/ykneo-oath/applet/src'
}
+ shadowJar {
+ relocate 'org.bouncycastle', 'com.vsmartcard.acardemulator.org.bouncycastle'
+ }
}
android.applicationVariants.all { variant ->
@@ -59,12 +86,15 @@ android.applicationVariants.all { variant ->
}
dependencies {
+ shadow localGroovy()
+ shadow gradleApi()
+
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:design:23.2.1'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'com.google.zxing:core:3.2.1'
- compile 'com.madgag.spongycastle:core:1.51.0.0'
- compile files('libs/sdk-v1.0.0.jar')
+ compile 'org.bouncycastle:bcprov-jdk14:1.49'
+ fullCompile files('libs/sdk-v1.0.0.jar')
}
diff --git a/ACardEmulator/app/src/fdroid/java/com/vsmartcard/acardemulator/SmartcardProviderService.java b/ACardEmulator/app/src/fdroid/java/com/vsmartcard/acardemulator/SmartcardProviderService.java
new file mode 100644
index 00000000..78c0f7ca
--- /dev/null
+++ b/ACardEmulator/app/src/fdroid/java/com/vsmartcard/acardemulator/SmartcardProviderService.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019 Frank Morgner
+ *
+ * This file is part of RemoteSmartCardReader.
+ *
+ * RemoteSmartCardReader is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at your
+ * option) any later version.
+ *
+ * RemoteSmartCardReader is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * RemoteSmartCardReader. If not, see .
+ */
+
+package com.vsmartcard.acardemulator;
+
+import android.app.IntentService;
+import android.content.Intent;
+import android.support.annotation.Nullable;
+
+public class SmartcardProviderService extends IntentService {
+ public SmartcardProviderService () {
+ super("SmartcardProviderService");
+ }
+
+ @Override
+ protected void onHandleIntent(@Nullable Intent intent) {
+ }
+}
diff --git a/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/SmartcardProviderService.java b/ACardEmulator/app/src/full/java/com/vsmartcard/acardemulator/SmartcardProviderService.java
similarity index 100%
rename from ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/SmartcardProviderService.java
rename to ACardEmulator/app/src/full/java/com/vsmartcard/acardemulator/SmartcardProviderService.java
diff --git a/ACardEmulator/app/src/main/external/jcardsim b/ACardEmulator/app/src/main/external/jcardsim
index 73cc1871..48c258ea 160000
--- a/ACardEmulator/app/src/main/external/jcardsim
+++ b/ACardEmulator/app/src/main/external/jcardsim
@@ -1 +1 @@
-Subproject commit 73cc18710c79365fae8e12652ff174226a9dac1e
+Subproject commit 48c258ea35001b5edc3af62fb69653e2ae4763b8
diff --git a/ACardEmulator/app/src/main/external/vJCRE b/ACardEmulator/app/src/main/external/vJCRE
new file mode 160000
index 00000000..58650d98
--- /dev/null
+++ b/ACardEmulator/app/src/main/external/vJCRE
@@ -0,0 +1 @@
+Subproject commit 58650d986cac64c79ce6f5a93e2bb39a392eb851
diff --git a/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/MainActivity.java b/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/MainActivity.java
index 17de26a9..d88f4708 100644
--- a/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/MainActivity.java
+++ b/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/MainActivity.java
@@ -175,4 +175,4 @@ protected void onPause() {
dialog.dismiss();
super.onPause();
}
-}
\ No newline at end of file
+}
diff --git a/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/SettingsActivity.java b/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/SettingsActivity.java
index b60d50e4..1d1fc043 100644
--- a/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/SettingsActivity.java
+++ b/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/SettingsActivity.java
@@ -214,18 +214,22 @@ public boolean onPreferenceClick(Preference preference) {
}
});
- Preference gear_nfc = findPreference("gear_nfc");
- gear_nfc.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
- public boolean onPreferenceClick(Preference preference) {
- String gearPackage = "com.samsung.android.gearoplugin";
- try {
- startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("market://details?id="+gearPackage)));
- } catch (android.content.ActivityNotFoundException e) {
- startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id="+gearPackage)));
+ final Preference gear_nfc = findPreference("gear_nfc");
+ if (BuildConfig.FLAVOR.equals("fdroid")) {
+ gear_nfc.setSummary("Samsung Gear integration is disabled in F-Droid");
+ } else {
+ gear_nfc.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ public boolean onPreferenceClick(Preference preference) {
+ String gearPackage = "com.samsung.android.gearoplugin";
+ try {
+ startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("market://details?id="+gearPackage)));
+ } catch (android.content.ActivityNotFoundException e) {
+ startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id="+gearPackage)));
+ }
+ return true;
}
- return true;
- }
- });
+ });
+ }
}
@Override
@@ -288,4 +292,4 @@ public void onNewIntent(Intent intent) {
// onResume gets called after this to handle the intent
setIntent(intent);
}
-}
\ No newline at end of file
+}
diff --git a/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/emulators/JCEmulator.java b/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/emulators/JCEmulator.java
index 90bfbce9..8f6dddcf 100644
--- a/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/emulators/JCEmulator.java
+++ b/ACardEmulator/app/src/main/java/com/vsmartcard/acardemulator/emulators/JCEmulator.java
@@ -6,7 +6,6 @@
import com.licel.jcardsim.base.Simulator;
import com.licel.jcardsim.base.SimulatorRuntime;
-import com.licel.jcardsim.samples.HelloWorldApplet;
import com.licel.jcardsim.utils.AIDUtil;
import com.mysmartlogon.gidsApplet.GidsApplet;
import com.vsmartcard.acardemulator.R;
@@ -33,18 +32,6 @@ public JCEmulator(
String aid, name, extra_install = "", extra_error = "";
simulator = new Simulator(new SimulatorRuntime());
- if (activate_helloworld) {
- name = context.getResources().getString(R.string.applet_helloworld);
- aid = context.getResources().getString(R.string.aid_helloworld);
- try {
- simulator.installApplet(AIDUtil.create(aid), HelloWorldApplet.class);
- extra_install += "\n" + name + " (AID: " + aid + ")";
- } catch (Exception e) {
- e.printStackTrace();
- extra_error += "\n" + "Could not install " + name + " (AID: " + aid + ")";
- }
- }
-
if (activate_openpgp) {
name = context.getResources().getString(R.string.applet_openpgp);
aid = context.getResources().getString(R.string.aid_openpgp);
diff --git a/ACardEmulator/app/src/main/res/values/strings.xml b/ACardEmulator/app/src/main/res/values/strings.xml
index 4aa8b571..fa2b09a5 100644
--- a/ACardEmulator/app/src/main/res/values/strings.xml
+++ b/ACardEmulator/app/src/main/res/values/strings.xml
@@ -26,8 +26,6 @@
A00000030800
A000000308
Alex Wilson\'s PIV Applet
- F000000001
- jCardSim Team\'s Hello World Applet
D27600012401
D2760001240102000000000000010000
Yubico\'s OpenPGP Applet
@@ -36,7 +34,6 @@
Tap To Emulate!
The following smart card applets are supported:\n
\n
- Hello World Applet (AID F000000001)\n
OpenPGP Applet (AID D2760001240102000000000000010000)\n
OATH Applet (AID A000000527210101)\n
PIV Applet (AID A00000030800001000)\n
diff --git a/ACardEmulator/app/src/main/res/xml/aid_list.xml b/ACardEmulator/app/src/main/res/xml/aid_list.xml
index e72c5a1e..8863bd9b 100644
--- a/ACardEmulator/app/src/main/res/xml/aid_list.xml
+++ b/ACardEmulator/app/src/main/res/xml/aid_list.xml
@@ -4,10 +4,6 @@
android:description="@string/app_name"
android:requireDeviceUnlock="false">
-
-
-
-
diff --git a/ACardEmulator/app/src/main/res/xml/settings.xml b/ACardEmulator/app/src/main/res/xml/settings.xml
index 5cd4c596..ce829b12 100644
--- a/ACardEmulator/app/src/main/res/xml/settings.xml
+++ b/ACardEmulator/app/src/main/res/xml/settings.xml
@@ -13,12 +13,6 @@
android:key="jc_settings"
>
-
diff --git a/ACardEmulator/build.gradle b/ACardEmulator/build.gradle
index 59660130..a516455c 100644
--- a/ACardEmulator/build.gradle
+++ b/ACardEmulator/build.gradle
@@ -6,6 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
+ classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files