Updated on 2026-08-14

This commit is contained in:
Tangem 2019-08-27 13:54:42 +03:00
commit 465fe9f6fc
14 changed files with 123 additions and 55 deletions

View file

@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
static def generateVersionName() {
def gitCommitsCount = "git rev-list HEAD --count".execute().text.trim()
@ -9,6 +10,9 @@ static def generateVersionName() {
return gitCommitsCount.toInteger() + 831// + "\\n" + gitCurrentBranch
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
android {
compileSdkVersion 28
defaultConfig {
@ -25,12 +29,23 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
buildConfigField 'boolean', 'CRASHLYTICS', 'Boolean.parseBoolean("false")'
ext.enableCrashlytics = false
}
debug {
debuggable true
minifyEnabled false
applicationIdSuffix ".debug"
signingConfig signingConfigs.debug
buildConfigField 'boolean', 'CRASHLYTICS', 'Boolean.parseBoolean("false")'
ext.enableCrashlytics = false
}
debug_beta {
initWith debug
versionNameSuffix "-beta"
applicationIdSuffix ".debug_beta"
buildConfigField 'boolean', 'CRASHLYTICS', 'Boolean.parseBoolean("true")'
manifestPlaceholders = [fabric_api_key: properties.getProperty('fabric_api_key')]
}
}
flavorDimensions ""
@ -65,6 +80,7 @@ android {
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
}
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
@ -119,6 +135,9 @@ dependencies {
// implementation 'com.github.stellar:java-stellar-sdk:0.4.1'
implementation 'net.i2p.crypto:eddsa:0.3.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9') { transitive = true }
implementation('io.fabric.sdk.android:fabric:1.4.0@aar') { transitive = true }
implementation files('libs/ripple-core-0.0.1.jar')
//4 dependencies for ripple-core TODO: move to module?
implementation 'net.i2p.crypto:eddsa:0.3.0'

View file

@ -2,5 +2,6 @@
<resources>
<string name="app_name">DEBUG</string>
<string name="log_file_provider_authorities">com.tangem.debug.data.LogFileProvider</string>
</resources>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.tangem.wallet">
<application
tools:ignore="GoogleAppIndexingWarning">
<meta-data
android:name="io.fabric.ApiKey"
android:value="${fabric_api_key}" />
<provider
android:name="com.tangem.data.LogFileProvider"
android:authorities="@string/log_file_provider_authorities"
android:enabled="true"
android:exported="false"
android:grantUriPermissions="true" />
</application>
</manifest>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">TangemBeta</string>
</resources>

View file

@ -2,16 +2,18 @@ package com.tangem
import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import com.crashlytics.android.Crashlytics
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.tangem.data.local.PendingTransactionsStorage
import com.tangem.card_android.android.data.Firmwares
import com.tangem.card_android.android.data.PINStorage
import com.tangem.card_common.data.Issuer
import com.tangem.data.dp.PrefsManager
import com.tangem.data.local.PendingTransactionsStorage
import com.tangem.di.*
import com.tangem.server_android.data.LocalStorage
import com.tangem.wallet.BuildConfig
import io.fabric.sdk.android.Fabric
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets
@ -73,6 +75,7 @@ class App : Application() {
}
}
)
if (BuildConfig.CRASHLYTICS) Fabric.with(this, Crashlytics())
}
}

View file

@ -8,9 +8,9 @@ import androidx.appcompat.app.AppCompatActivity
import com.tangem.App
import com.tangem.Constant
import com.tangem.di.Navigator
import com.tangem.wallet.TangemContext
import com.tangem.wallet.BuildConfig
import com.tangem.wallet.R
import com.tangem.wallet.TangemContext
import kotlinx.android.synthetic.main.activity_logo.*
import javax.inject.Inject
@ -34,7 +34,7 @@ class LogoActivity : AppCompatActivity() {
App.navigatorComponent.inject(this)
ivLogo.setOnClickListener { hide() }
clLogoContainer.setOnClickListener { hide() }
}
override fun onPostCreate(savedInstanceState: Bundle?) {

View file

@ -41,14 +41,17 @@ class MainActivity : AppCompatActivity() {
// private var onNfcReaderCallback: NfcAdapter.ReaderCallback? = null
// override fun onNewIntent(intent: Intent?) {
// super.onNewIntent(intent)
// if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED == intent.action || NfcAdapter.ACTION_NDEF_DISCOVERED == intent.action)) {
// val tag = intent.getParcelableExtra<Tag>(NfcAdapter.EXTRA_TAG)
// if (tag != null && onNfcReaderCallback != null)
// onNfcReaderCallback?.onTagDiscovered(tag)
// }
// }
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED == intent.action || NfcAdapter.ACTION_NDEF_DISCOVERED == intent.action)) {
val tag = intent.getParcelableExtra<Tag>(NfcAdapter.EXTRA_TAG)
if (tag != null) {
val activeFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment)
?.childFragmentManager?.primaryNavigationFragment
(activeFragment as? NfcAdapter.ReaderCallback)?.onTagDiscovered(tag)
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

View file

@ -1,4 +1,5 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clLogoContainer"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -17,7 +18,7 @@
android:fontFamily="@font/maax"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/holo_red_light"
android:textColor="@android:color/black"
android:textSize="@dimen/text_size_small"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
@ -47,7 +48,7 @@
android:text="@string/beta"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/holo_red_light"
android:textColor="@android:color/black"
android:textSize="@dimen/text_size_small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View file

@ -102,8 +102,8 @@
<string name="erase_wallet">Erase wallet</string>
<!-- LogoActivity -->
<string name="version_name_debug">BETA v.%1$s \n dev \n build %2$s</string>
<string name="version_name_release">BETA v.%1$s</string>
<string name="version_name_debug">ALPHA v.%1$s \n dev build %2$s</string>
<string name="version_name_release">v.%1$s</string>
<string name="welcome_messages">Hello, %1$s! You have %2$d new messages.</string>

View file

@ -3,11 +3,13 @@ buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'io.fabric.tools:gradle:1.27.1'
}
}

View file

@ -20,6 +20,10 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug_beta {
initWith debug
versionNameSuffix "-beta"
}
}
buildToolsVersion '28.0.3'

View file

@ -16,46 +16,53 @@
default_platform(:android)
platform :android do
desc "Runs all the tests"
lane :test do
gradle(
task: "test",
flavor: "tangemAccess",
build_type: "Debug")
task: "test",
flavor: "tangemAccess",
build_type: "DebugUnitTest")
end
desc "Build a release APK"
lane :release do
gradle(
task: "clean assemble",
flavor: "tangemAccess",
build_type: "Release")
desc "Build a signed release APK"
lane :release do |options|
gradle(
task: "clean assemble",
flavor: "tangemAccess",
build_type: "Release",
properties: {
"android.injected.signing.store.file" => options[:keystore],
"android.injected.signing.store.password" => options[:store_password],
"android.injected.signing.key.alias" => options[:key_alias],
"android.injected.signing.key.password" => options[:key_password],
})
end
desc "Build a debug APK"
lane :debug do
gradle(task: "clean assemble",
flavor: "tangemAccess",
build_type: "Debug")
end
desc "Build debug and release APKs"
lane :build do |options|
gradle(
task: "clean assemble",
flavor: "tangemAccess",
build_type: "Debug_beta")
gradle(
task: "assemble",
flavor: "tangemAccess",
build_type: "Release",
properties: {
"android.injected.signing.store.file" => options[:keystore],
"android.injected.signing.store.password" => options[:store_password],
"android.injected.signing.key.alias" => options[:key_alias],
"android.injected.signing.key.password" => options[:key_password],
})
end
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
gradle(task: "clean assemble",
flavor: "tangemAccess",
build_type: "Debug")
crashlytics
# sh "your_script.sh"
# You can also use other beta testing services here
lane :beta do |options|
crashlytics(
api_token: options[:api_token],
build_secret: options[:build_secret],
apk_path: options[:apk_path])
end
desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(
task: "clean assemble",
flavor: "tangemAccess",
build_type: "Release")
upload_to_play_store
end
end

View file

@ -25,22 +25,17 @@ Runs all the tests
```
fastlane android release
```
Build a release APK
### android debug
Build a signed release APK
### android build
```
fastlane android debug
fastlane android build
```
Build a debug APK
Build debug and release APKs
### android beta
```
fastlane android beta
```
Submit a new Beta Build to Crashlytics Beta
### android deploy
```
fastlane android deploy
```
Deploy a new version to the Google Play
----

View file

@ -20,6 +20,10 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug_beta {
initWith debug
versionNameSuffix "-beta"
}
}
productFlavors {
}