From ff024393f97c3d1d2e3b265ff7d5ceb2cbc97bb6 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 17 Dec 2025 15:20:04 +0500 Subject: [PATCH] Updated on 2026-08-14 --- app/build.gradle.kts | 5 ++--- app/libs/dexprotector-annotations.jar | Bin 0 -> 3531 bytes .../DefaultDeviceSecurityInfoProvider.kt | 13 ++++++++++++ .../tap/di/core/security/SecurityModule.kt | 20 ++++++++++++++++++ core/security/.gitignore | 1 + core/security/build.gradle.kts | 4 ++++ .../security/DeviceSecurityInfoProvider.kt | 7 ++++++ settings.gradle.kts | 15 +++++++------ 8 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 app/libs/dexprotector-annotations.jar create mode 100644 app/src/main/java/com/tangem/tap/core/security/DefaultDeviceSecurityInfoProvider.kt create mode 100644 app/src/main/java/com/tangem/tap/di/core/security/SecurityModule.kt create mode 100644 core/security/.gitignore create mode 100644 core/security/build.gradle.kts create mode 100644 core/security/src/main/kotlin/com/tangem/security/DeviceSecurityInfoProvider.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index bb2b8ab488..d4fb854892 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -179,6 +179,7 @@ dependencies { implementation(projects.core.utils) implementation(projects.core.decompose) implementation(projects.core.error.ext) + implementation(projects.core.security) implementation(projects.libs.crypto) implementation(projects.libs.auth) implementation(projects.libs.blockchainSdk) @@ -353,7 +354,6 @@ dependencies { /** DI */ implementation(deps.hilt.android) - kapt(deps.hilt.kapt) kapt(deps.hilt.compilerx) @@ -385,10 +385,10 @@ dependencies { implementation(deps.prettyLogger) implementation(deps.decompose.ext.compose) implementation(deps.moshi.adapters) - implementation(deps.moshi.kotlin) ksp(deps.moshi.kotlin.codegen) kaptForObfuscatingVariants(deps.retrofit.response.type.keeper) + implementation(files("libs/dexprotector-annotations.jar")) /** Testing libraries */ testImplementation(projects.common.test) @@ -418,7 +418,6 @@ dependencies { implementation(deps.camera.camera2) implementation(deps.camera.lifecycle) implementation(deps.camera.view) - implementation(deps.listenableFuture) implementation(deps.mlKit.barcodeScanning) diff --git a/app/libs/dexprotector-annotations.jar b/app/libs/dexprotector-annotations.jar new file mode 100644 index 0000000000000000000000000000000000000000..3f2f98f07fec15899e07325897e3ff62efca8203 GIT binary patch literal 3531 zcmai$2|U#4AIIIf*_lBoIfpRLCUS(4b6kz1WCzo@b2T%_l^AEPwF)UA$3Kc#u_i}I z*%b5S5GF(@r4jho}>Bm1Mn!s@as>@O496D|=h5omVWqxsq%rK9i0 zK$)R^yuLrcKRtf==HcXg$rs~;b4KHQFh6lWyq`PD+uH|+!nyl+V}BCLvtK9%hyEV2 zt*#Q+3H&>Xt1m4L4P?KN-PH`;ot$;hXlE=|4(*A;VxuewX7q~Op{b?{kzy=|d8}v! zs&ewLGBAtFK@3v5mpEHf(0P?A5e|8i^y^a1kr4&jcMf(5)}i%3EN!fEPIBL5)r_id zx{@wQ5cvi!4U~KQpR{;$}t$02-SHLBLzk2j?xGei<0sc+G+u zjI_01?!fW@Zi0#(h#4v|fKR5YADyJnHLYgPXU@kkz~FB`vw6V;58p_0YA0I2AZ(r} zM&#T)ti-saydiOqa_#qxBv&blg;11J{x9V$aTs@RS3PeuCeWAq=63W`htunDlfmiL z0uFJGr~>O=*n_f%fCS<7mv?yQj;AYn4lP92)j5(gqqG{1NOap?5{-DOF!5f~C1703 zeuC!Kc>|PPZeFj1lz)&@pot-8a&+V(0ekYTTW!sxD{>?wHinrLF0b32PEZ<#> zibH4Jc|grFvLzAv+#wfFUd7$)kP%Bo7miKn7qhhB@Nb+#jTJoR@ zP0J8s$ZA#!$8t4G$W{pW`xm@O?r1=_!QsRJ*UfymAaIF0H}p-1=o>8hMp>wbA2WSA zU%ah^X67sbyx>$2@6w(OKFCs%M~8a%2UWy3R$)MQVhS?KjJbqRRgk|%P8konupD*J zYSlM1>>^b7(9Gq`qzz}A_13_Zr(9^mu)4I~BEA<1;Pb)@WI_cQmaOe&7&?|`+)>Lr%Hi-_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q$*<1E_LBw=|)L z?bfz96+1m;?L;8(x3g^QCT%@s^K^}q>ud{)^L9c)4fFSsHvPDF-pdxM@f_)ax$1-3i+taH-Bz%MX{NjNij{;qLCjR7C#j{%xQ#=(bS{ z6DiYeBHgLEKa>85nEe*9hfx1LoXV)%MlHxk`5UJe{9E{LhWuIYRA&8=3b9|RZGzqD zW`Bm=Ns=EPwO@+e-RvdWAKh)I-V1p@Qa`5qj|bf!`Supri$6aKFj3y*PnFykhW6&) hO9nsk!zsM*kNo>^f(4wBi5kU9`OHury65YH|35;FYkU9z literal 0 HcmV?d00001 diff --git a/app/src/main/java/com/tangem/tap/core/security/DefaultDeviceSecurityInfoProvider.kt b/app/src/main/java/com/tangem/tap/core/security/DefaultDeviceSecurityInfoProvider.kt new file mode 100644 index 0000000000..7463e33236 --- /dev/null +++ b/app/src/main/java/com/tangem/tap/core/security/DefaultDeviceSecurityInfoProvider.kt @@ -0,0 +1,13 @@ +package com.tangem.tap.core.security + +import com.dexprotector.rtc.RtcStatus +import com.tangem.security.DeviceSecurityInfoProvider + +internal class DefaultDeviceSecurityInfoProvider : DeviceSecurityInfoProvider { + override val isRooted: Boolean + get() = RtcStatus.getRtcStatus().root + override val isBootloaderUnlocked: Boolean + get() = RtcStatus.getRtcStatus().unlockedBootloader + override val isXposed: Boolean + get() = RtcStatus.getRtcStatus().xposed +} \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/di/core/security/SecurityModule.kt b/app/src/main/java/com/tangem/tap/di/core/security/SecurityModule.kt new file mode 100644 index 0000000000..b4e64ccb37 --- /dev/null +++ b/app/src/main/java/com/tangem/tap/di/core/security/SecurityModule.kt @@ -0,0 +1,20 @@ +package com.tangem.tap.di.core.security + +import com.tangem.security.DeviceSecurityInfoProvider +import com.tangem.tap.core.security.DefaultDeviceSecurityInfoProvider +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +internal object SecurityModule { + + @Provides + @Singleton + fun provideDeviceSecurityInfoProvider(): DeviceSecurityInfoProvider { + return DefaultDeviceSecurityInfoProvider() + } +} \ No newline at end of file diff --git a/core/security/.gitignore b/core/security/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/core/security/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/core/security/build.gradle.kts b/core/security/build.gradle.kts new file mode 100644 index 0000000000..7ff7fb7522 --- /dev/null +++ b/core/security/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + alias(deps.plugins.kotlin.jvm) + id("configuration") +} \ No newline at end of file diff --git a/core/security/src/main/kotlin/com/tangem/security/DeviceSecurityInfoProvider.kt b/core/security/src/main/kotlin/com/tangem/security/DeviceSecurityInfoProvider.kt new file mode 100644 index 0000000000..5be549d653 --- /dev/null +++ b/core/security/src/main/kotlin/com/tangem/security/DeviceSecurityInfoProvider.kt @@ -0,0 +1,7 @@ +package com.tangem.security + +interface DeviceSecurityInfoProvider { + val isRooted: Boolean + val isBootloaderUnlocked: Boolean + val isXposed: Boolean +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 6a05fead77..50802ec815 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -153,19 +153,20 @@ include(":test:core") include(":test:mock") // region Core modules +include(":core:ab-tests") include(":core:analytics") include(":core:analytics:models") -include(":core:datasource") include(":core:config-toggles") -include(":core:ab-tests") -include(":core:navigation") -include(":core:res") -include(":core:ui") -include(":core:utils") +include(":core:datasource") include(":core:decompose") -include(":core:pagination") include(":core:error") include(":core:error:ext") +include(":core:navigation") +include(":core:pagination") +include(":core:res") +include(":core:security") +include(":core:ui") +include(":core:utils") // endregion Core modules // region Common modules