Skip to content

Commit c00e08f

Browse files
authored
Merge pull request #1131 from soramitsu/staging
staging
2 parents cad8840 + ca57983 commit c00e08f

File tree

322 files changed

+16778
-2268
lines changed

Some content is hidden

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

322 files changed

+16778
-2268
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def jobParams = [
99
def pipeline = new org.android.AppPipeline(
1010
steps: this,
1111
sonar: true,
12-
sonarCommand: './gradlew sonar -x :core-db:compileDebugUnitTestKotlin -x :core-db:compileDebugAndroidTestKotlin -x :feature-crowdloan-impl:compileDebugAndroidTestKotlin -x :runtime:compileDebugUnitTestKotlin -x :app:kaptDebugAndroidTestKotlin -x :app:compileDebugAndroidTestKotlin -Dsonar.coverage.jacoco.xmlReportPaths=**/coverage/*.xml',
12+
sonarCmd: 'sonar -x :core-db:compileDebugUnitTestKotlin -x :core-db:compileDebugAndroidTestKotlin -x :feature-crowdloan-impl:compileDebugAndroidTestKotlin -x :runtime:compileDebugUnitTestKotlin -x :app:kaptDebugAndroidTestKotlin -x :app:compileDebugAndroidTestKotlin -Dsonar.coverage.jacoco.xmlReportPaths=**/coverage/*.xml',
1313
sonarProjectName: 'fearless-android',
1414
sonarProjectKey: 'fearless:fearless-android',
1515
pushReleaseNotes: false,

app/build.gradle

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ android {
4848
signingConfig signingConfigs.debug
4949
}
5050
release {
51-
minifyEnabled shouldEnableR8D8
52-
shrinkResources shouldEnableR8D8
51+
minifyEnabled true
52+
shrinkResources true
5353
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
5454
signingConfig signingConfigs.ci
5555
}
@@ -108,14 +108,14 @@ android {
108108
}
109109

110110
compileOptions {
111-
sourceCompatibility 11
112-
targetCompatibility 11
111+
sourceCompatibility = JavaVersion.VERSION_17
112+
targetCompatibility = JavaVersion.VERSION_17
113113
}
114114

115115
kotlinOptions {
116116
freeCompilerArgs = ["-Xallow-result-return-type"]
117117

118-
jvmTarget = '11'
118+
jvmTarget = '17'
119119
}
120120
composeOptions {
121121
kotlinCompilerExtensionVersion composeCompilerVersion
@@ -176,58 +176,61 @@ dependencies {
176176
implementation project(':feature-walletconnect-api')
177177
implementation project(':feature-walletconnect-impl')
178178

179-
implementation kotlinDep
179+
implementation project(':feature-nft-api')
180+
implementation project(':feature-nft-impl')
181+
182+
implementation libs.kotlin.stdlib.jdk7
180183

181-
implementation androidDep
182-
implementation constraintDep
184+
implementation libs.appcompat
185+
implementation libs.constraintlayout
183186

184-
implementation zXingEmbeddedDep
187+
implementation libs.zxing.embedded
185188

186-
implementation navigationFragmentDep
187-
implementation navigationUiDep
189+
implementation libs.navigation.fragment.ktx
190+
implementation libs.navigation.ui.ktx
188191

189-
implementation roomDep
192+
implementation libs.room.runtime
190193

191-
implementation daggerDep
192-
kapt daggerKapt
194+
implementation libs.hilt.android
195+
kapt libs.hilt.compiler
193196

194-
implementation lifecycleProcessDep
195-
kapt lifecycleKapt
197+
implementation libs.lifecycle.process
198+
kapt libs.lifecycle.compiler
196199

197-
implementation lifeCycleKtxDep
200+
implementation libs.lifecycle.runtime.ktx
198201

199-
implementation gsonConvertedDep
202+
implementation libs.converter.gson
200203

201-
implementation gifDep
204+
// implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.25"
202205

203-
compileOnly wsDep
206+
compileOnly libs.nv.websocket.client
204207

205-
implementation coroutinesDep
208+
implementation libs.coroutines.core
206209

207210
testImplementation project(':test-shared')
208211

209-
implementation insetterDep
212+
implementation libs.insetter.widgets
210213

211-
implementation liveDataKtxDep
214+
implementation libs.lifecycle.livedata.ktx
212215

213-
implementation jnaDep
214-
implementation beaconDep, withoutJna
216+
implementation libs.jna
217+
implementation libs.beacon.android.sdk, withoutJna
215218

216-
kaptAndroidTest daggerKapt
217-
implementation storiesDep
219+
kaptAndroidTest libs.hilt.compiler
220+
implementation libs.storiesProgressView
218221

219-
implementation compose
220-
debugImplementation composeDebug
222+
implementation libs.bundles.compose
223+
debugImplementation libs.bundles.composeDebug
221224

222-
implementation soraUiCoreDep
225+
implementation libs.sora.ui
223226

224-
implementation(platform(libs.walletconnectBomDep))
225-
implementation(libs.walletconnectCoreDep)
226-
implementation(libs.walletconnectWeb3WalletDep)
227+
implementation platform(libs.walletconnectBomDep)
228+
implementation libs.walletconnectCoreDep
229+
implementation libs.walletconnectWeb3WalletDep
227230

228-
androidTestImplementation androidTestRunnerDep
229-
androidTestImplementation androidTestRulesDep
230-
androidTestImplementation androidJunitDep
231+
androidTestImplementation libs.runner
232+
androidTestImplementation libs.rules
233+
androidTestImplementation libs.ext.junit
231234
}
232235

233236
task printVersion {

app/proguard-rules.pro

Lines changed: 155 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
## General
2+
3+
# Application classes that will be serialized/deserialized over Gson (Web3j Jackson)
4+
-keep, allowobfuscation class jp.co.soramitsu.nft.data.models.** { public <init>(*); }
5+
-keep, allowobfuscation class jp.co.soramitsu.nft.impl.data.model.** { public <init>(*); }
6+
-keep class jp.co.soramitsu.nft.impl.domain.utils.** { *; }
7+
28
#-keep class ** { *; }
39
#-dontobfuscate
410
-keep class jp.co.soramitsu.shared_utils.** { *; }
@@ -37,6 +43,22 @@
3743
-keep class net.jpountz.** { *; }
3844
-keep class org.web3j.** { *; }
3945

46+
# Jackson (serializer used in web3j lib) tries to get Enum classes from the whole application (not only its packages)
47+
# by doing so it tries to find Enums that are defined inside its packages :/
48+
# So, if this keep rule is not enabled, R8 removes (obfucates, etc..) all application enums to its liking
49+
# leaving Jackson unaware of it is looking for, and thus an exception will be thrown
50+
# Actual exception is: ExceptionInInitializerError(), but it happens in static code of Enum classes
51+
# while searching for the needed Jackson defined enum
52+
-keepclassmembers,allowoptimization enum com.fasterxml.jackson.databind.** {
53+
public static **[] values();
54+
public static ** valueOf(java.lang.String);
55+
**[] $VALUES;
56+
public *;
57+
}
58+
59+
-keep class jp.co.soramitsu.backup.** { *; }
60+
-keep class com.google.api.** { *; }
61+
-keep class io.opencensus.trace.** { *; }
4062
#for beacon sdk
4163

4264
-keep class it.airgap.beaconsdk.** { *; }
@@ -99,4 +121,136 @@
99121

100122
# Needed by google-play-services when linking against an older platform version
101123

102-
-dontwarn com.google.android.gms.**
124+
-dontwarn com.google.android.gms.**
125+
126+
# This is generated automatically by the Android Gradle plugin.
127+
-dontwarn org.slf4j.impl.StaticLoggerBinder
128+
-dontwarn org.slf4j.impl.StaticMDCBinder
129+
-dontwarn org.w3c.dom.events.DocumentEvent
130+
-dontwarn org.w3c.dom.events.Event
131+
-dontwarn org.w3c.dom.events.EventException
132+
-dontwarn org.w3c.dom.events.EventListener
133+
-dontwarn org.w3c.dom.events.EventTarget
134+
-dontwarn org.w3c.dom.events.MutationEvent
135+
-dontwarn org.w3c.dom.ls.LSSerializerFilter
136+
-dontwarn org.w3c.dom.ranges.DocumentRange
137+
-dontwarn org.w3c.dom.ranges.Range
138+
-dontwarn org.w3c.dom.traversal.DocumentTraversal
139+
-dontwarn org.w3c.dom.traversal.NodeFilter
140+
-dontwarn org.w3c.dom.traversal.NodeIterator
141+
142+
-dontwarn org.jetbrains.kotlin.compiler.plugin.CliOption
143+
-dontwarn org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
144+
-dontwarn org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
145+
-dontwarn org.jetbrains.kotlin.diagnostics.DiagnosticFactory0
146+
-dontwarn org.jetbrains.kotlin.diagnostics.DiagnosticFactory1
147+
-dontwarn org.jetbrains.kotlin.diagnostics.DiagnosticFactory2
148+
-dontwarn org.jetbrains.kotlin.diagnostics.DiagnosticFactory3
149+
-dontwarn org.jetbrains.kotlin.diagnostics.Errors$Initializer
150+
-dontwarn org.jetbrains.kotlin.diagnostics.PositioningStrategies
151+
-dontwarn org.jetbrains.kotlin.diagnostics.PositioningStrategy
152+
-dontwarn org.jetbrains.kotlin.diagnostics.Severity
153+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.CommonRenderers
154+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.ContextIndependentParameterRenderer
155+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages$Extension
156+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.DiagnosticFactoryToRendererMap
157+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.DiagnosticParameterRenderer
158+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.Renderers
159+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.SmartDescriptorRenderer
160+
-dontwarn org.jetbrains.kotlin.diagnostics.rendering.SmartTypeRenderer
161+
162+
-dontwarn javax.naming.InvalidNameException
163+
-dontwarn javax.naming.NamingException
164+
-dontwarn javax.naming.directory.Attribute
165+
-dontwarn javax.naming.directory.Attributes
166+
-dontwarn javax.naming.ldap.LdapName
167+
-dontwarn javax.naming.ldap.Rdn
168+
-dontwarn org.ietf.jgss.GSSContext
169+
-dontwarn org.ietf.jgss.GSSCredential
170+
-dontwarn org.ietf.jgss.GSSException
171+
-dontwarn org.ietf.jgss.GSSManager
172+
-dontwarn org.ietf.jgss.GSSName
173+
-dontwarn org.ietf.jgss.Oid
174+
175+
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
176+
# EnclosingMethod is required to use InnerClasses.
177+
-keepattributes Signature, InnerClasses, EnclosingMethod
178+
179+
# Retrofit does reflection on method and parameter annotations.
180+
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
181+
182+
# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
183+
-keepattributes AnnotationDefault
184+
185+
# Retain service method parameters when optimizing.
186+
-keepclassmembers,allowshrinking,allowobfuscation interface * {
187+
@retrofit2.http.* <methods>;
188+
}
189+
190+
# Ignore annotation used for build tooling.
191+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
192+
193+
# Ignore JSR 305 annotations for embedding nullability information.
194+
-dontwarn javax.annotation.**
195+
196+
# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
197+
-dontwarn kotlin.Unit
198+
199+
# Top-level functions that can only be used by Kotlin.
200+
-dontwarn retrofit2.KotlinExtensions
201+
-dontwarn retrofit2.KotlinExtensions$*
202+
203+
# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
204+
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
205+
-if interface * { @retrofit2.http.* <methods>; }
206+
-keep,allowobfuscation interface <1>
207+
208+
# Keep inherited services.
209+
-if interface * { @retrofit2.http.* <methods>; }
210+
-keep,allowobfuscation interface * extends <1>
211+
212+
# With R8 full mode generic signatures are stripped for classes that are not
213+
# kept. Suspend functions are wrapped in continuations where the type argument
214+
# is used.
215+
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
216+
217+
# R8 full mode strips generic signatures from return types if not kept.
218+
-if interface * { @retrofit2.http.* public *** *(...); }
219+
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
220+
221+
# With R8 full mode generic signatures are stripped for classes that are not kept.
222+
-keep,allowobfuscation,allowshrinking class retrofit2.Response
223+
224+
# Gson uses generic type information stored in a class file when working with fields. Proguard
225+
# removes such information by default, so configure it to keep all of it.
226+
-keepattributes Signature
227+
228+
# For using GSON @Expose annotation
229+
-keepattributes *Annotation*
230+
231+
# Gson specific classes
232+
-dontwarn sun.misc.**
233+
#-keep class com.google.gson.stream.** { *; }
234+
235+
# Application classes that will be serialized/deserialized over Gson
236+
-keep class com.google.gson.examples.android.model.** { <fields>; }
237+
238+
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
239+
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
240+
-keep class * extends com.google.gson.TypeAdapter
241+
-keep class * implements com.google.gson.TypeAdapterFactory
242+
-keep class * implements com.google.gson.JsonSerializer
243+
-keep class * implements com.google.gson.JsonDeserializer
244+
245+
# Prevent R8 from leaving Data object members always null
246+
-keepclassmembers,allowobfuscation class * {
247+
@com.google.gson.annotations.SerializedName <fields>;
248+
}
249+
250+
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
251+
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
252+
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
253+
254+
-keepclassmembers class * {
255+
@com.google.api.client.util.Key <fields>;
256+
}

app/src/main/java/jp/co/soramitsu/app/App.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.walletconnect.android.relay.ConnectionType
99
import com.walletconnect.web3.wallet.client.Wallet
1010
import com.walletconnect.web3.wallet.client.Web3Wallet
1111
import dagger.hilt.android.HiltAndroidApp
12+
import jp.co.soramitsu.common.BuildConfig
1213
import jp.co.soramitsu.common.data.network.OptionsProvider
1314
import jp.co.soramitsu.common.resources.ContextManager
1415
import jp.co.soramitsu.common.resources.LanguagesHolder
@@ -32,7 +33,7 @@ open class App : Application() {
3233
override fun onCreate() {
3334
super.onCreate()
3435

35-
OptionsProvider.APPLICATION_ID = BuildConfig.APPLICATION_ID
36+
OptionsProvider.APPLICATION_ID = BuildConfig.LIBRARY_PACKAGE_NAME
3637
OptionsProvider.CURRENT_VERSION_CODE = BuildConfig.VERSION_CODE
3738
OptionsProvider.CURRENT_VERSION_NAME = BuildConfig.VERSION_NAME
3839
OptionsProvider.CURRENT_BUILD_TYPE = BuildConfig.BUILD_TYPE
@@ -42,7 +43,7 @@ open class App : Application() {
4243

4344
private fun setupWalletConnect() {
4445
val connectionType = ConnectionType.AUTOMATIC // ConnectionType.AUTOMATIC or ConnectionType.MANUAL
45-
val projectId = jp.co.soramitsu.common.BuildConfig.WALLET_CONNECT_PROJECT_ID // Project ID at https://cloud.walletconnect.com/
46+
val projectId = BuildConfig.WALLET_CONNECT_PROJECT_ID // Project ID at https://cloud.walletconnect.com/
4647
val relayUrl = "relay.walletconnect.com"
4748
val serverUrl = "wss://$relayUrl?projectId=${projectId}"
4849

app/src/main/java/jp/co/soramitsu/app/di/app/NavigationModule.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import javax.inject.Singleton
99
import jp.co.soramitsu.account.impl.presentation.AccountRouter
1010
import jp.co.soramitsu.app.root.navigation.Navigator
1111
import jp.co.soramitsu.crowdloan.impl.presentation.CrowdloanRouter
12+
import jp.co.soramitsu.nft.navigation.NFTRouter
1213
import jp.co.soramitsu.onboarding.impl.OnboardingRouter
1314
import jp.co.soramitsu.polkaswap.api.presentation.PolkaswapRouter
1415
import jp.co.soramitsu.soracard.api.presentation.SoraCardRouter
@@ -64,4 +65,8 @@ class NavigationModule {
6465
@Singleton
6566
@Provides
6667
fun provideWalletConnectRouter(navigator: Navigator): WalletConnectRouter = navigator
68+
69+
@Singleton
70+
@Provides
71+
fun provideNFTRouter(navigator: Navigator): NFTRouter = navigator
6772
}

app/src/main/java/jp/co/soramitsu/app/root/domain/RootInteractor.kt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ import jp.co.soramitsu.core.updater.UpdateSystem
1212
import jp.co.soramitsu.core.updater.Updater
1313
import jp.co.soramitsu.wallet.impl.data.buyToken.ExternalProvider
1414
import jp.co.soramitsu.wallet.impl.domain.interfaces.WalletRepository
15+
import kotlinx.coroutines.Dispatchers
1516
import kotlinx.coroutines.flow.Flow
1617
import kotlinx.coroutines.flow.flowOf
18+
import kotlinx.coroutines.withContext
1719

1820
class RootInteractor(
1921
private val updateSystem: UpdateSystem,
@@ -35,20 +37,22 @@ class RootInteractor(
3537
}
3638

3739
suspend fun getRemoteConfig(): Result<AppConfig> {
38-
val remoteVersion = walletRepository.getRemoteConfig()
39-
40-
return if (remoteVersion.isSuccess) {
41-
preferences.appConfig = remoteVersion.requireValue()
42-
remoteVersion
43-
} else {
44-
val localVersion = preferences.appConfig
45-
Result.success(localVersion)
46-
}.map { it.toDomain() }
40+
return withContext(Dispatchers.Default) {
41+
val remoteVersion = walletRepository.getRemoteConfig()
42+
43+
if (remoteVersion.isSuccess) {
44+
preferences.appConfig = remoteVersion.requireValue()
45+
remoteVersion
46+
} else {
47+
val localVersion = preferences.appConfig
48+
Result.success(localVersion)
49+
}.map { it.toDomain() }
50+
}
4751
}
4852

4953
fun chainRegistrySyncUp() = walletRepository.chainRegistrySyncUp()
5054

51-
suspend fun fetchFeatureToggle() = pendulumPreInstalledAccountsScenario.fetchFeatureToggle()
55+
suspend fun fetchFeatureToggle() = withContext(Dispatchers.Default){ pendulumPreInstalledAccountsScenario.fetchFeatureToggle() }
5256

53-
fun getPendingListOfSessionRequests(topic: String) = Web3Wallet.getPendingListOfSessionRequests(topic)
57+
suspend fun getPendingListOfSessionRequests(topic: String) = withContext(Dispatchers.Default){ Web3Wallet.getPendingListOfSessionRequests(topic) }
5458
}

0 commit comments

Comments
 (0)