Skip to content

Commit

Permalink
ACardEmulator: upgraded dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmorgner committed Nov 29, 2024
1 parent 24802c7 commit cd52697
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ jobs:
remote-reader/app/build/outputs/apk

ACardEmulator-ubuntu:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: .github/build-ACardEmulator.sh
- uses: actions/upload-artifact@v4
with:
Expand Down
39 changes: 16 additions & 23 deletions ACardEmulator/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
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
compileSdkVersion 34
defaultConfig {
applicationId "com.vsmartcard.acardemulator"
minSdkVersion 19
targetSdkVersion 29
minSdkVersion 21
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 30
versionCode 8
versionName "3.5"
}
Expand All @@ -24,6 +16,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
buildConfig true
}
flavorDimensions "distribution"
productFlavors {
full {
Expand Down Expand Up @@ -51,9 +46,6 @@ android {
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 ->
Expand All @@ -77,16 +69,17 @@ android.applicationVariants.all { variant ->
}
}

dependencies {
shadow localGroovy()
shadow gradleApi()
repositories {
mavenCentral()
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:23.0.1'
implementation 'com.android.support:support-v4:23.0.1'
implementation 'com.android.support:design:23.2.1'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
implementation 'com.google.zxing:core:3.2.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
implementation 'com.google.zxing:core:3.4.1'
implementation 'org.bouncycastle:bcprov-jdk14:1.46'
fullImplementation files('libs/sdk-v1.0.0.jar')
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

import android.app.IntentService;
import android.content.Intent;
import android.support.annotation.Nullable;

import androidx.annotation.Nullable;

public class SmartcardProviderService extends IntentService {
public SmartcardProviderService () {
Expand Down
6 changes: 3 additions & 3 deletions ACardEmulator/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vsmartcard.acardemulator" >

<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.NFC" />

<uses-feature android:name="android.hardware.nfc.hce" android:required="true" />

<uses-permission android:name="android.permission.BLUETOOTH" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.Toolbar;

import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import android.content.Intent;
import android.nfc.cardemulation.HostApduService;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.util.Log;

import com.vsmartcard.acardemulator.emulators.EmulatorSingleton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.vsmartcard.acardemulator;

import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
Expand All @@ -30,19 +29,23 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
import com.vsmartcard.acardemulator.emulators.EmulatorSingleton;

import ACardEmulator.BuildConfig;
import ACardEmulator.R;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

public class MainActivity extends AppCompatActivity {

Expand Down Expand Up @@ -135,26 +138,25 @@ public boolean onCreateOptionsMenu(Menu menu) {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle presses on the action bar items
switch (item.getItemId()) {
case R.id.action_copy:
// Code to Copy the content of Text View to the Clip board.
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("simple text", textViewVPCDStatus.getText());
clipboard.setPrimaryClip(clip);
Toast.makeText(getApplicationContext(), "Log copied to clipboard.",
Toast.LENGTH_LONG).show();
return true;
case R.id.action_delete:
if (item.getItemId() == R.id.action_copy) {
// Code to Copy the content of Text View to the Clip board.
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("simple text", textViewVPCDStatus.getText());
clipboard.setPrimaryClip(clip);
Toast.makeText(getApplicationContext(), "Log copied to clipboard.",
Toast.LENGTH_LONG).show();
return true;
} else if (item.getItemId() == R.id.action_delete) {
textViewVPCDStatus.setText("");
return true;
case R.id.action_help:
showStartupMessage();
return true;
case R.id.action_settings:
startActivity(new Intent(this, SettingsActivity.class));
return true;
default:
return super.onOptionsItemSelected(item);
return true;
} else if (item.getItemId() == R.id.action_help) {
showStartupMessage();
return true;
} else if (item.getItemId() == R.id.action_settings) {
startActivity(new Intent(this, SettingsActivity.class));
return true;
} else {
return super.onOptionsItemSelected(item);
}
}

Expand All @@ -175,4 +177,4 @@ protected void onPause() {
dialog.dismiss();
super.onPause();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.preference.SwitchPreference;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBar;
import com.google.android.material.snackbar.Snackbar;
import android.view.MenuItem;

import androidx.appcompat.app.ActionBar;

import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import com.vsmartcard.acardemulator.emulators.VICCEmulator;

import ACardEmulator.BuildConfig;
import ACardEmulator.R;

/**
* A {@link PreferenceActivity} that presents a set of application settings. On
* handset devices, settings are presented as a single list. On tablets,
Expand All @@ -65,7 +69,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

/**
* Set up the {@link android.app.ActionBar}, if the API is available.
* Set up the {@link ActionBar}, if the API is available.
*/
private void setupActionBar() {
ActionBar actionBar = getSupportActionBar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.nfc.NfcAdapter;
import android.nfc.cardemulation.CardEmulation;
import android.preference.PreferenceManager;
import android.support.annotation.XmlRes;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;

import com.vsmartcard.acardemulator.R;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.vsmartcard.acardemulator.Util;

import org.xmlpull.v1.XmlPullParser;
Expand All @@ -41,6 +37,8 @@
import java.util.ArrayList;
import java.util.List;

import ACardEmulator.R;

public class EmulatorSingleton {
public static final String TAG = "com.vsmartcard.acardemulator.EmulatorService";
public static final String EXTRA_CAPDU = "MSG_CAPDU";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

import android.content.Context;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;

import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.licel.jcardsim.base.Simulator;
import com.licel.jcardsim.base.SimulatorRuntime;
import com.licel.jcardsim.utils.AIDUtil;
import com.mysmartlogon.gidsApplet.GidsApplet;
import com.vsmartcard.acardemulator.R;
import com.vsmartcard.acardemulator.Util;

import net.pwendland.javacard.pki.isoapplet.IsoApplet;
import net.cooperi.pivapplet.PivApplet;

import ACardEmulator.R;
import openpgpcard.OpenPGPApplet;
import pkgYkneoOath.YkneoOath;

Expand Down
20 changes: 10 additions & 10 deletions ACardEmulator/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.vsmartcard.acardemulator.MainActivity">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.design.widget.CollapsingToolbarLayout
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>

<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
Expand All @@ -44,9 +44,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/textViewLog" />
</android.support.v4.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -55,4 +55,4 @@
app:layout_anchor="@id/app_bar"
app:layout_anchorGravity="bottom|end" />

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Loading

0 comments on commit cd52697

Please sign in to comment.