Skip to content

Commit b96bbe5

Browse files
authored
Merge pull request #1 from bluegene1/0.3.0
frist add, support wallet、shared wallet、Sophia Smart Contracts
2 parents 3bcf600 + 18b7337 commit b96bbe5

File tree

1,204 files changed

+79818
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,204 files changed

+79818
-2
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Gradle files
2+
.gradle/
3+
build/
4+
*/build
5+
6+
# Local configuration file (sdk path, etc)
7+
local.properties
8+
9+
# IntelliJ project files
10+
*.iml
11+
.idea/
12+
13+
# Android Studio captures folder
14+
captures/
15+
16+
# Misc
17+
.DS_Store
18+
19+
# svn temp directory
20+
tmp_commit/
21+
wallet/src/test/
22+
framework/src/test/
23+

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
# ATON-Android
2-
PlatON Wallet app for Android device
1+
# Overview
2+
> ATON is PlatOn's open source graphical android wallet client, supporting basic common wallet management, shared wallet management based on multi-signature technology, and providing developers with the deployment and operation of Sophia Smart Contracts.
3+
4+
# Build
5+
6+
```
7+
https://github.com/PlatONnetwork/ATON-Android.git
8+
9+
cd ATON-Android
10+
11+
gradle assembleReleaseX
12+
or
13+
./gradlew assembleReleaseX
14+
15+
```
16+
17+
# Other
18+
[more reference wiki](https://github.com/PlatONnetwork/wiki/wiki)

biometric/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

biometric/build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion rootProject.ext.android.compileSdkVersion
5+
6+
defaultConfig {
7+
minSdkVersion rootProject.ext.android.minSdkVersion
8+
targetSdkVersion rootProject.ext.android.targetSdkVersion
9+
versionCode 1
10+
versionName '1.0.2'
11+
vectorDrawables.useSupportLibrary = true
12+
}
13+
14+
buildTypes{
15+
debug {
16+
17+
}
18+
releaseC {
19+
20+
}
21+
releaseX {
22+
23+
}
24+
}
25+
26+
compileOptions {
27+
sourceCompatibility JavaVersion.VERSION_1_8
28+
targetCompatibility JavaVersion.VERSION_1_8
29+
}
30+
}
31+
32+
dependencies {
33+
implementation rootProject.ext.dependencies.support_annotations
34+
implementation rootProject.ext.dependencies.support_vector_drawable
35+
implementation rootProject.ext.dependencies.support_animated_vector_drawable
36+
}

biometric/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name toAddress the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this toAddress preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this toAddress
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.juzix.biometric">
3+
4+
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
5+
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
6+
7+
</manifest>
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
package com.juzix.biometric;
2+
3+
import android.app.Dialog;
4+
import android.app.DialogFragment;
5+
import android.content.DialogInterface;
6+
import android.os.Build;
7+
import android.os.Bundle;
8+
import android.os.CancellationSignal;
9+
import android.support.annotation.NonNull;
10+
import android.support.annotation.Nullable;
11+
import android.support.annotation.RequiresApi;
12+
13+
@RequiresApi(api = Build.VERSION_CODES.M)
14+
public abstract class AbstractBiometricPromptDialogFragment extends DialogFragment {
15+
16+
public static final String ARG_TITLE = "title";
17+
public static final String ARG_SUBTITLE = "subtitle";
18+
public static final String ARG_DESCRIPTION = "description";
19+
public static final String ARG_NEGATIVE_BUTTON_TEXT = "negative_button_text";
20+
21+
private boolean shouldNotifyClose = true;
22+
23+
private BiometricPromptApi23Impl biometricPromptApi23;
24+
25+
public AbstractBiometricPromptDialogFragment() {
26+
setRetainInstance(false);
27+
}
28+
29+
@Override
30+
public void onCreate(Bundle savedInstanceState) {
31+
super.onCreate(savedInstanceState);
32+
33+
if (BiometricPromptCompat.isApiPSupported()) {
34+
throw new UnsupportedOperationException("AbstractBiometricPromptDialogFragment " +
35+
"is only designed for old versions which SDK is under 28 (not included).");
36+
}
37+
38+
if (getArguments() == null) {
39+
throw new IllegalArgumentException("Arguments cannot be null or empty.");
40+
}
41+
42+
String title = getArguments().getString(ARG_TITLE);
43+
String subtitle = getArguments().getString(ARG_SUBTITLE);
44+
String description = getArguments().getString(ARG_DESCRIPTION);
45+
String negativeButtonText = getArguments().getString(ARG_NEGATIVE_BUTTON_TEXT);
46+
47+
if (title == null) {
48+
throw new IllegalArgumentException("You should set a title for BiometricPrompt.");
49+
}
50+
51+
biometricPromptApi23 = new BiometricPromptApi23Impl(
52+
getActivity(), title, subtitle, description, negativeButtonText,
53+
(dialog, which) -> onNegativeButtonClick()
54+
);
55+
}
56+
57+
@Override
58+
public final Dialog onCreateDialog(Bundle savedInstanceState) {
59+
return biometricPromptApi23.getAuthenticateDialogForFragment(
60+
getCryptoObject(), getCancellationSignal(), new AuthCallback());
61+
}
62+
63+
@Override
64+
public void onDismiss(DialogInterface dialog) {
65+
if (shouldNotifyClose &&
66+
getCancellationSignal() != null && !getCancellationSignal().isCanceled()) {
67+
getCancellationSignal().cancel();
68+
shouldNotifyClose = false;
69+
}
70+
dismiss();
71+
}
72+
73+
@Override
74+
public void onCancel(DialogInterface dialog) {
75+
if (shouldNotifyClose &&
76+
getCancellationSignal() != null && !getCancellationSignal().isCanceled()) {
77+
getCancellationSignal().cancel();
78+
shouldNotifyClose = false;
79+
}
80+
dismiss();
81+
}
82+
83+
@Nullable
84+
public BiometricPromptCompat.ICryptoObject getCryptoObject() {
85+
return null;
86+
}
87+
88+
@Nullable
89+
public CancellationSignal getCancellationSignal() {
90+
return null;
91+
}
92+
93+
public abstract void onAuthenticationSucceeded(
94+
@NonNull BiometricPromptCompat.IAuthenticationResult result);
95+
96+
public void onAuthenticationHelp(int helpCode, @Nullable CharSequence helpString) {
97+
98+
}
99+
100+
public void onAuthenticationError(int errorCode, @Nullable CharSequence errString) {
101+
102+
}
103+
104+
public void onAuthenticationFailed() {
105+
106+
}
107+
108+
public void onNegativeButtonClick() {
109+
110+
}
111+
112+
private class AuthCallback implements BiometricPromptCompat.IAuthenticationCallback {
113+
114+
@Override
115+
public void onAuthenticationSucceeded(
116+
@NonNull BiometricPromptCompat.IAuthenticationResult result) {
117+
shouldNotifyClose = false;
118+
AbstractBiometricPromptDialogFragment.this.onAuthenticationSucceeded(result);
119+
}
120+
121+
@Override
122+
public void onAuthenticationHelp(int helpCode, @Nullable CharSequence helpString) {
123+
AbstractBiometricPromptDialogFragment.this.onAuthenticationHelp(helpCode, helpString);
124+
}
125+
126+
@Override
127+
public void onAuthenticationError(int errorCode, @Nullable CharSequence errString) {
128+
AbstractBiometricPromptDialogFragment.this.onAuthenticationError(errorCode, errString);
129+
}
130+
131+
@Override
132+
public void onAuthenticationFailed() {
133+
AbstractBiometricPromptDialogFragment.this.onAuthenticationFailed();
134+
}
135+
136+
}
137+
138+
}

0 commit comments

Comments
 (0)