Skip to content

Commit

Permalink
add code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchunlin committed Apr 5, 2020
1 parent 2d06f79 commit 5f43d6a
Show file tree
Hide file tree
Showing 33 changed files with 201 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### 快速集成:
- **Step 1.** Add the JitPack repository to your build file
```groovy
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
- **Step 2.** Add the dependency
```groovy
dependencies {
def version = "0.0.1"
implementation "com.github.andnux:wallet:${version}"
or
implementation "com.github.andnux.wallet:basic:${version}"
implementation "com.github.andnux.wallet:bos:${version}"
implementation "com.github.andnux.wallet:eos:${version}"
implementation "com.github.andnux.wallet:eth:${version}"
implementation "com.github.andnux.wallet:vsys:${version}"
implementation "com.github.andnux.wallet:btc:${version}"
}
```
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
Expand All @@ -7,6 +7,7 @@ android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
applicationId = "top.andnux.wallet"
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
Expand Down Expand Up @@ -48,6 +49,9 @@ dependencies {
for (dep in rootProject.ext.dependencies.test) {
testApi dep
}
for (dep in rootProject.ext.dependencies.androidTest) {
androidTestImplementation dep
}
for (dep in rootProject.ext.dependencies.kapts) {
kapt dep
}
Expand Down
8 changes: 6 additions & 2 deletions bos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.andnux'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
Expand Down Expand Up @@ -34,7 +35,7 @@ android {

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api project(path: ':basic')
api project(path: ':core')
for (dep in rootProject.ext.dependencies.implementation) {
implementation dep
}
Expand All @@ -44,6 +45,9 @@ dependencies {
for (dep in rootProject.ext.dependencies.test) {
testApi dep
}
for (dep in rootProject.ext.dependencies.androidTest) {
androidTestImplementation dep
}
for (dep in rootProject.ext.dependencies.kapts) {
kapt dep
}
Expand Down
8 changes: 6 additions & 2 deletions btc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.andnux'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
Expand Down Expand Up @@ -34,7 +35,7 @@ android {

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api project(path: ':basic')
api project(path: ':core')
for (dep in rootProject.ext.dependencies.implementation) {
implementation dep
}
Expand All @@ -44,6 +45,9 @@ dependencies {
for (dep in rootProject.ext.dependencies.test) {
testApi dep
}
for (dep in rootProject.ext.dependencies.androidTest) {
androidTestImplementation dep
}
for (dep in rootProject.ext.dependencies.kapts) {
kapt dep
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
for (path in rootProject.ext.classpaths) {
classpath path
}
Expand All @@ -17,7 +18,6 @@ allprojects {
repositories {
google()
jcenter()

}
}

Expand Down
10 changes: 7 additions & 3 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ ext.android = [compileSdkVersion: 29,

ext.classpaths = [
'com.android.tools.build:gradle:3.6.1',
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version",
"com.github.dcendents:android-maven-gradle-plugin:1.5"
]

ext.dependencies = [
Expand Down Expand Up @@ -85,11 +86,14 @@ ext.dependencies = [
"androidx.room:room-compiler:$room_version"
],
test : [
'junit:junit:4.13',
'junit:junit:4.13'
],
androidTest : [
'androidx.test.ext:junit:1.1.1',
'androidx.test.espresso:espresso-core:3.2.0',
"androidx.arch.core:core-testing:$arch_version",
"androidx.room:room-testing:$room_version",
"androidx.navigation:navigation-testing:$nav_version",
"androidx.paging:paging-common:$paging_version"
]]
]
]
File renamed without changes.
6 changes: 5 additions & 1 deletion basic/build.gradle → core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.andnux'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
Expand Down Expand Up @@ -49,6 +50,9 @@ dependencies {
for (dep in rootProject.ext.dependencies.test) {
testApi dep
}
for (dep in rootProject.ext.dependencies.androidTest) {
androidTestImplementation dep
}
for (dep in rootProject.ext.dependencies.kapts) {
kapt dep
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions eos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.andnux'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
Expand Down Expand Up @@ -34,7 +35,7 @@ android {

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api project(path: ':basic')
api project(path: ':core')
for (dep in rootProject.ext.dependencies.implementation) {
implementation dep
}
Expand All @@ -44,6 +45,9 @@ dependencies {
for (dep in rootProject.ext.dependencies.test) {
testApi dep
}
for (dep in rootProject.ext.dependencies.androidTest) {
androidTestImplementation dep
}
for (dep in rootProject.ext.dependencies.kapts) {
kapt dep
}
Expand Down
8 changes: 6 additions & 2 deletions eth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

apply plugin: 'com.github.dcendents.android-maven'
group='com.github.andnux'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
Expand Down Expand Up @@ -34,7 +35,7 @@ android {

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api project(path: ':basic')
api project(path: ':core')
for (dep in rootProject.ext.dependencies.implementation) {
implementation dep
}
Expand All @@ -44,6 +45,9 @@ dependencies {
for (dep in rootProject.ext.dependencies.test) {
testApi dep
}
for (dep in rootProject.ext.dependencies.androidTest) {
androidTestImplementation dep
}
for (dep in rootProject.ext.dependencies.kapts) {
kapt dep
}
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
rootProject.name='wallet'
include ':app'
include ':basic'
include ':core'
include ':eos'
include ':btc'
include ':bos'
include ':eth'
include ':vsys'
include ':tron'
1 change: 1 addition & 0 deletions tron/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
54 changes: 54 additions & 0 deletions tron/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.github.dcendents.android-maven'
group='com.github.andnux'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
}
kotlinOptions{
jvmTarget = 1.8
}
viewBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api project(path: ':core')
for (dep in rootProject.ext.dependencies.implementation) {
implementation dep
}
for (dep in rootProject.ext.dependencies.api) {
api dep
}
for (dep in rootProject.ext.dependencies.test) {
testApi dep
}
for (dep in rootProject.ext.dependencies.androidTest) {
androidTestImplementation dep
}
for (dep in rootProject.ext.dependencies.kapts) {
kapt dep
}
}
Empty file added tron/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions tron/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package top.andnux.wallet.tron

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("top.andnux.wallet.tron.test", appContext.packageName)
}
}
2 changes: 2 additions & 0 deletions tron/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="top.andnux.wallet.tron" />
17 changes: 17 additions & 0 deletions tron/src/test/java/top/andnux/wallet/tron/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package top.andnux.wallet.tron

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
Loading

0 comments on commit 5f43d6a

Please sign in to comment.