├── .gitignore
├── .idea
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── release
│ ├── app-release.apk
│ └── output.json
└── src
│ ├── androidTest
│ └── java
│ │ └── bctest
│ │ └── maods
│ │ └── com
│ │ └── bctest
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ ├── com
│ │ │ └── maods
│ │ │ │ └── bctest
│ │ │ │ ├── BCTestApp.java
│ │ │ │ ├── ChainCommonOperations.java
│ │ │ │ ├── EOS
│ │ │ │ ├── Action.java
│ │ │ │ ├── BOSMainNet.java
│ │ │ │ ├── BOSTestNet.java
│ │ │ │ ├── ContextFreeAction.java
│ │ │ │ ├── EOSAbiHelper.java
│ │ │ │ ├── EOSKylinTestNet.java
│ │ │ │ ├── EOSMainNet.java
│ │ │ │ ├── EOSOperations.java
│ │ │ │ ├── EOSUtils.java
│ │ │ │ ├── ForgroundSevice.java
│ │ │ │ ├── MEETONEMainNet.java
│ │ │ │ └── Transaction.java
│ │ │ │ ├── GlobalConstants.java
│ │ │ │ ├── GlobalUtils.java
│ │ │ │ └── UI
│ │ │ │ ├── ChainHomeActivity.java
│ │ │ │ ├── EOSBrowser.java
│ │ │ │ ├── EOSInfoActivity.java
│ │ │ │ ├── EOSListActivity.java
│ │ │ │ ├── EOSRamTradeActivity.java
│ │ │ │ ├── EOSWalletManagerActivity.java
│ │ │ │ └── MainActivity.java
│ │ └── io
│ │ │ └── plactal
│ │ │ └── eoscommander
│ │ │ ├── crypto
│ │ │ ├── Hmac.java
│ │ │ ├── digest
│ │ │ │ ├── GeneralDigest.java
│ │ │ │ ├── Ripemd160.java
│ │ │ │ ├── Sha256.java
│ │ │ │ └── Sha512.java
│ │ │ ├── ec
│ │ │ │ ├── CurveParam.java
│ │ │ │ ├── EcCurve.java
│ │ │ │ ├── EcDsa.java
│ │ │ │ ├── EcFieldElement.java
│ │ │ │ ├── EcPoint.java
│ │ │ │ ├── EcSignature.java
│ │ │ │ ├── EcTools.java
│ │ │ │ ├── EosEcUtil.java
│ │ │ │ ├── EosPrivateKey.java
│ │ │ │ └── EosPublicKey.java
│ │ │ └── util
│ │ │ │ ├── Base58.java
│ │ │ │ ├── BitUtils.java
│ │ │ │ ├── CryptUtil.java
│ │ │ │ └── HexUtils.java
│ │ │ ├── data
│ │ │ ├── EoscDataManager.java
│ │ │ ├── local
│ │ │ │ ├── db
│ │ │ │ │ ├── AppDatabase.java
│ │ │ │ │ ├── EosAccount.java
│ │ │ │ │ └── EosAccountDao.java
│ │ │ │ └── repository
│ │ │ │ │ ├── EosAccountRepository.java
│ │ │ │ │ └── EosAccountRepositoryImpl.java
│ │ │ ├── prefs
│ │ │ │ └── PreferencesHelper.java
│ │ │ ├── remote
│ │ │ │ ├── HostInterceptor.java
│ │ │ │ ├── NodeosApi.java
│ │ │ │ └── model
│ │ │ │ │ ├── abi
│ │ │ │ │ ├── EosAbiAction.java
│ │ │ │ │ ├── EosAbiField.java
│ │ │ │ │ ├── EosAbiMain.java
│ │ │ │ │ ├── EosAbiStruct.java
│ │ │ │ │ ├── EosAbiTable.java
│ │ │ │ │ └── EosAbiTypeDef.java
│ │ │ │ │ ├── api
│ │ │ │ │ ├── AccountInfoRequest.java
│ │ │ │ │ ├── EosChainInfo.java
│ │ │ │ │ ├── GetBalanceRequest.java
│ │ │ │ │ ├── GetCodeRequest.java
│ │ │ │ │ ├── GetCodeResponse.java
│ │ │ │ │ ├── GetRequestForCurrency.java
│ │ │ │ │ ├── GetRequiredKeys.java
│ │ │ │ │ ├── GetTableRequest.java
│ │ │ │ │ ├── JsonToBinRequest.java
│ │ │ │ │ ├── JsonToBinResponse.java
│ │ │ │ │ ├── Key.java
│ │ │ │ │ ├── Permission.java
│ │ │ │ │ ├── PushTxnResponse.java
│ │ │ │ │ ├── RequiredAuth.java
│ │ │ │ │ └── RequiredKeysResponse.java
│ │ │ │ │ ├── chain
│ │ │ │ │ ├── Action.java
│ │ │ │ │ ├── ActionTrace.java
│ │ │ │ │ ├── DataAccessInfo.java
│ │ │ │ │ ├── PackedTransaction.java
│ │ │ │ │ ├── SignedTransaction.java
│ │ │ │ │ ├── Transaction.java
│ │ │ │ │ ├── TransactionHeader.java
│ │ │ │ │ ├── TransactionReceiptHeader.java
│ │ │ │ │ └── TransactionTrace.java
│ │ │ │ │ └── types
│ │ │ │ │ ├── EosByteReader.java
│ │ │ │ │ ├── EosByteWriter.java
│ │ │ │ │ ├── EosNewAccount.java
│ │ │ │ │ ├── EosTransfer.java
│ │ │ │ │ ├── EosType.java
│ │ │ │ │ ├── TypeAccountName.java
│ │ │ │ │ ├── TypeActionName.java
│ │ │ │ │ ├── TypeAsset.java
│ │ │ │ │ ├── TypeAuthority.java
│ │ │ │ │ ├── TypeChainId.java
│ │ │ │ │ ├── TypeExtension.java
│ │ │ │ │ ├── TypeKeyWeight.java
│ │ │ │ │ ├── TypeName.java
│ │ │ │ │ ├── TypePermissionLevel.java
│ │ │ │ │ ├── TypePermissionLevelWeight.java
│ │ │ │ │ ├── TypePermissionName.java
│ │ │ │ │ ├── TypePublicKey.java
│ │ │ │ │ ├── TypeScopeName.java
│ │ │ │ │ ├── TypeSharedLock.java
│ │ │ │ │ ├── TypeSymbol.java
│ │ │ │ │ └── TypeWaitWeight.java
│ │ │ ├── util
│ │ │ │ └── GsonEosTypeAdapterFactory.java
│ │ │ └── wallet
│ │ │ │ ├── EosWallet.java
│ │ │ │ └── EosWalletManager.java
│ │ │ └── util
│ │ │ ├── Consts.java
│ │ │ ├── RefValue.java
│ │ │ ├── StringUtils.java
│ │ │ ├── Utils.java
│ │ │ └── rx
│ │ │ ├── EoscSchedulerProvider.java
│ │ │ └── SchedulerProvider.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── chain_home.xml
│ │ ├── choose_net.xml
│ │ ├── content_main.xml
│ │ ├── eos_browser.xml
│ │ ├── eos_execute_item.xml
│ │ ├── eos_info.xml
│ │ ├── eos_list.xml
│ │ ├── list_item_2.xml
│ │ ├── manage_wallet.xml
│ │ └── ram_trade.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── bctest
│ └── maods
│ └── com
│ └── bctest
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # bctest
2 | This's an android app for learning purpose.
3 | It's for EOS test.
4 | Welcome anybody to clone or contribute to it.
5 | You can just copy it for your develop and test purpose.
6 | The only thing need to pay attention:
7 | In this project, I used many code from EosCommander(https://github.com/plactal/EosCommander), including wallet and transaction related.
8 | you need to comply with EosCommander 's requirements of using the code.
9 | Thanks EosCommander!
10 |
11 | If you wish to use it in your product, you need to copy below folders:
12 | bctest\app\src\main\java\io (this's from EosCommander)
13 | bctest\app\src\main\java\com\maods\bctest\EOS
14 | and the files under bctest\app\src\main\java\com\maods\bctest (not too much ,just for common utilities)
15 |
16 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "bctest.maods.com.bctest"
7 | minSdkVersion 25
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | compileOptions {
13 | sourceCompatibility JavaVersion.VERSION_1_8
14 | targetCompatibility JavaVersion.VERSION_1_8
15 | }
16 | lintOptions {
17 | abortOnError false
18 | }
19 | configurations.all {
20 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
21 | }
22 | }
23 | buildTypes {
24 | release {
25 | minifyEnabled false
26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27 | }
28 | }
29 | }
30 |
31 | //from EosCommander begin
32 | ext{
33 | espressoVer = '2.2.2'
34 | supportLibVer = '27.0.2'
35 | constraintLayoutVer = '1.0.2'
36 | roomVer = '1.0.0'
37 |
38 | rxJavaVer = '2.1.2'
39 | rxAndroidVer='2.0.1'
40 |
41 | retrofitVer = '2.3.0'
42 | okHttpVer = '3.9.0'
43 |
44 | gsonVer = '2.8.1'
45 |
46 | dagger2Ver = '2.11'
47 |
48 | timberVer = '4.5.1'
49 |
50 | fileChooserrVer = '1.3'
51 | singleDateTimePickerVer = '1.2.2'
52 |
53 | consoleViewVer = '0.4.3'
54 |
55 | junitVer = '4.12'
56 | }
57 | //from EosCommander end
58 |
59 | dependencies {
60 | implementation fileTree(dir: 'libs', include: ['*.jar'])
61 | implementation 'com.android.support:appcompat-v7:27.1.1'
62 | implementation 'com.android.support.constraint:constraint-layout:1.1.2'
63 | implementation 'com.android.support:design:27.1.1'
64 | testImplementation 'junit:junit:4.12'
65 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
67 |
68 | //below is from EosCommander
69 | // ReactiveX 설정
70 | implementation "io.reactivex.rxjava2:rxandroid:${rxAndroidVer}"
71 | implementation "io.reactivex.rxjava2:rxjava:${rxJavaVer}"
72 |
73 | // retrofit
74 | implementation "com.squareup.retrofit2:retrofit:${retrofitVer}"
75 | implementation "com.squareup.retrofit2:adapter-rxjava2:${retrofitVer}"
76 | implementation "com.squareup.retrofit2:converter-gson:${retrofitVer}"
77 |
78 | implementation "com.google.code.gson:gson:${gsonVer}"
79 |
80 | // okHttp
81 | implementation "com.squareup.okhttp3:okhttp:${okHttpVer}"
82 | implementation "com.squareup.okhttp3:logging-interceptor:${okHttpVer}"
83 |
84 | // room
85 | implementation "android.arch.persistence.room:runtime:${roomVer}"
86 | annotationProcessor "android.arch.persistence.room:compiler:${roomVer}"
87 | implementation "android.arch.persistence.room:rxjava2:${roomVer}"
88 |
89 |
90 | // Dagger dependencies
91 | implementation "com.google.dagger:dagger:${dagger2Ver}"
92 | implementation "com.google.dagger:dagger-android-support:${dagger2Ver}"
93 | annotationProcessor "com.google.dagger:dagger-android-processor:${dagger2Ver}"
94 | annotationProcessor "com.google.dagger:dagger-compiler:${dagger2Ver}"
95 |
96 | // Timber
97 | implementation "com.jakewharton.timber:timber:${timberVer}"
98 |
99 | // file chooser, https://github.com/MostafaNasiri/AndroidFileChooser
100 | implementation "ir.sohreco.androidfilechooser:android-file-chooser:${fileChooserrVer}"
101 |
102 | // single date time picker
103 | implementation "com.github.florent37:singledateandtimepicker:${singleDateTimePickerVer}"
104 |
105 | implementation "com.jraska:console:${consoleViewVer}"
106 |
107 | // 구글 guava
108 | implementation 'com.google.guava:guava:23.0-android'
109 |
110 | testImplementation "junit:junit:${junitVer}"
111 | }
112 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
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 to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to 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 to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/release/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/maodaishan/bctest/eb303507b8dad46a557f99c9e368b0808db59ca0/app/release/app-release.apk
--------------------------------------------------------------------------------
/app/release/output.json:
--------------------------------------------------------------------------------
1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"bctest.maods.com.bctest","split":"","minSdkVersion":"27"}}]
--------------------------------------------------------------------------------
/app/src/androidTest/java/bctest/maods/com/bctest/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package bctest.maods.com.bctest;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("bctest.maods.com.bctest", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
18 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 |
38 |
41 |
44 |
47 |
48 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/maods/bctest/BCTestApp.java:
--------------------------------------------------------------------------------
1 | package com.maods.bctest;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 |
6 | /**
7 | * Created by MAODS on 2019/1/15.
8 | */
9 |
10 | public class BCTestApp extends Application {
11 | private static Context instance;
12 |
13 | @Override
14 | public void onCreate()
15 | {
16 | super.onCreate();
17 | instance = getApplicationContext();
18 | }
19 |
20 | public static Context getContext()
21 | {
22 | return instance;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/maods/bctest/ChainCommonOperations.java:
--------------------------------------------------------------------------------
1 | package com.maods.bctest;
2 |
3 |
4 | import java.util.List;
5 |
6 | /**
7 | * Created by MAODS on 2018/7/19.
8 | */
9 |
10 | public interface ChainCommonOperations{
11 | public List getServerNode();
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/maods/bctest/EOS/Action.java:
--------------------------------------------------------------------------------
1 | package com.maods.bctest.EOS;
2 |
3 | import org.json.JSONArray;
4 | import org.json.JSONException;
5 | import org.json.JSONObject;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 | import java.util.Map;
10 | import java.util.Map.Entry;
11 | import java.util.Set;
12 |
13 | /**
14 | * Created by MAODS on 2018/8/14.
15 | */
16 |
17 | public class Action {
18 | private static final String ACCOUNT="account";
19 | private static final String NAME="name";
20 | private static final String AUTHORIZATION="authorization";
21 | private static final String DATA="data";
22 | //private static final String HEX_DATA="hex_data";
23 | private static final String ACTOR="actor";
24 | private static final String PERMISSION="permission";
25 |
26 | public String mAccount;
27 | public String mName;
28 | public List mAuth;
29 | public String mData;
30 | //public String mHexData;
31 |
32 | public class Authorization{
33 | public String mActor;
34 | public String mPermission;
35 | }
36 |
37 | public Action(String account,String name,String data,/*String hexData,*/List