Skip to content

Commit

Permalink
Merge branch 'develop' into release/v2.11.2
Browse files Browse the repository at this point in the history
Signed-off-by: Gleb Levinkov (p2p) <[email protected]>
  • Loading branch information
gslevinkov authored Feb 6, 2024
2 parents bf7dde1 + 042db53 commit 52bd9f4
Show file tree
Hide file tree
Showing 131 changed files with 2,890 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# In this example, those users owns any file in an checking directory
# anywhere in your repository.

* @1sakov @Davran331122 @kabramovp2p @gslevinkov @eduardmaximovich
* @gslevinkov @eduardmaximovich
11 changes: 11 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@
android:scheme="keyapp" />
</intent-filter>

<intent-filter android:autoVerify="true" android:label="Referral deeplink">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="r.key.app"
android:scheme="https" />
</intent-filter>

<intent-filter android:label="Key App website deeplink">
<action android:name="android.intent.action.VIEW" />

Expand Down
19 changes: 19 additions & 0 deletions app/src/main/assets/referral_bridge_provider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

// we need this JS code to inject the ReferralBridge object into the global namespace
// and parse the result data into a JSON object instead of raw string
window.ReferralBridge = {
getUserPublicKeyAsync: async function() {
const result = await AndroidReferralBridge.getUserPublicKeyAsync();
return JSON.parse(result)
},
nativeLog: function(info) {
AndroidReferralBridge.nativeLog(info);
},
showShareDialog: function(link) {
AndroidReferralBridge.showShareDialog(link);
},
signMessageAsync: async function(message) {
const result = AndroidReferralBridge.signMessageAsync(message);
return JSON.parse(result)
}
}
4 changes: 4 additions & 0 deletions app/src/main/java/org/p2p/wallet/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ import org.p2p.wallet.infrastructure.transactionmanager.TransactionManagerModule
import org.p2p.wallet.jupiter.JupiterSwapModule
import org.p2p.wallet.moonpay.MoonpayModule
import org.p2p.wallet.moonpay.ui.BuyModule
import org.p2p.wallet.pnl.PnlModule
import org.p2p.wallet.push_notifications.PushNotificationsModule
import org.p2p.wallet.qr.ScanQrModule
import org.p2p.wallet.receive.ReceiveModule
import org.p2p.wallet.referral.ReferralModule
import org.p2p.wallet.restore.RestoreModule
import org.p2p.wallet.root.RootModule
import org.p2p.wallet.rpc.RpcModule
Expand Down Expand Up @@ -87,6 +89,7 @@ object AppModule {
TokenServiceModule.create(),
HomeEventsModule.create(),
EthereumModule.create(),
PnlModule.create(),
// feature screens
AuthModule.create(),
BridgeModule.create(),
Expand All @@ -109,6 +112,7 @@ object AppModule {
SettingsModule.create(),
StrigaModule.create(),
SwapModule.create(),
ReferralModule.create(),
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.p2p.wallet.infrastructure.security.SecureStorageContract.Key.KEY_PIN_
import org.p2p.wallet.infrastructure.security.SecureStorageContract.Key.KEY_PIN_CODE_HASH
import org.p2p.wallet.infrastructure.security.SecureStorageContract.Key.KEY_PIN_CODE_SALT
import org.p2p.wallet.push_notifications.interactor.PushNotificationsInteractor
import org.p2p.wallet.referral.repository.ReferralRepository

/**
* The secure storage now includes the hash which is encrypted in two ways
Expand All @@ -35,6 +36,7 @@ class AuthInteractor(
private val pushNotificationsInteractor: PushNotificationsInteractor,
private val appLoaderFacade: AppLoaderFacade,
private val dispatchers: CoroutineDispatchers,
private val referralRepository: ReferralRepository,
private val appScope: AppScope
) {

Expand Down Expand Up @@ -162,5 +164,8 @@ class AuthInteractor(
appScope.launch {
pushNotificationsInteractor.updateDeviceToken()
}
appScope.launch {
referralRepository.registerReferent()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import android.content.SharedPreferences
import android.graphics.Bitmap
import timber.log.Timber
import java.io.File
import org.p2p.core.crashlytics.CrashLogger
import org.p2p.core.crypto.Base58String
import org.p2p.core.crypto.toBase58Instance
import org.p2p.wallet.auth.model.Username
import org.p2p.wallet.auth.repository.UserSignUpDetailsStorage
import org.p2p.wallet.auth.username.repository.UsernameRepository
import org.p2p.wallet.auth.username.repository.model.UsernameDetails
import org.p2p.core.crashlytics.CrashLogger
import org.p2p.wallet.common.feature_toggles.toggles.remote.RegisterUsernameEnabledFeatureToggle
import org.p2p.wallet.common.feature_toggles.toggles.remote.UsernameDomainFeatureToggle
import org.p2p.wallet.common.storage.FileRepository
import org.p2p.wallet.infrastructure.network.provider.TokenKeyProvider
import org.p2p.wallet.restore.interactor.KEY_IS_AUTH_BY_SEED_PHRASE
import org.p2p.core.crypto.Base58String
import org.p2p.core.crypto.toBase58Instance

const val KEY_USERNAME = "KEY_USERNAME"
const val KEY_USERNAME_DOMAIN = "KEY_USERNAME_DOMAIN"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/org/p2p/wallet/common/InAppFeatureFlags.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.p2p.wallet.common.feature_toggles.toggles.inapp.DebugTogglesFeatureFl
import org.p2p.wallet.common.feature_toggles.toggles.inapp.DevNetFeatureFlag
import org.p2p.wallet.common.feature_toggles.toggles.inapp.InAppFeatureFlag
import org.p2p.wallet.common.feature_toggles.toggles.inapp.PollingFeatureFlag
import org.p2p.wallet.common.feature_toggles.toggles.inapp.ReferralRewardTxMockFlag
import org.p2p.wallet.common.feature_toggles.toggles.inapp.StrigaEnableEmailFieldFlag
import org.p2p.wallet.common.feature_toggles.toggles.inapp.StrigaKycBannerMockFlag
import org.p2p.wallet.common.feature_toggles.toggles.inapp.StrigaSimulateIbanNotFilledFlag
Expand All @@ -16,6 +17,7 @@ import org.p2p.wallet.common.feature_toggles.toggles.inapp.StrigaSmsVerification
class InAppFeatureFlags(prefs: SharedPreferences) {
val isPollingEnabled = PollingFeatureFlag(prefs)
var isDevNetEnabled = DevNetFeatureFlag(prefs)
val referralRewardTxMockEnabled = ReferralRewardTxMockFlag(prefs)
val strigaSimulateWeb3Flag = StrigaSimulateWeb3Flag(prefs)
val strigaSimulateUserCreateFlag = StrigaSimulateUserCreateFlag(prefs)
val strigaSmsVerificationMockFlag = StrigaSmsVerificationMockFlag(prefs)
Expand All @@ -33,13 +35,16 @@ class InAppFeatureFlags(prefs: SharedPreferences) {
isPollingEnabled,
isDevNetEnabled,
isDebugRemoteConfigEnabled,
referralRewardTxMockEnabled,
/*
strigaSimulateWeb3Flag,
strigaSimulateUserCreateFlag,
strigaSmsVerificationMockFlag,
strigaKycBannerMockFlag,
strigaSimulateMobileAlreadyVerifiedFlag,
strigaEnableEmailFieldFlag,
strigaSimulateIbanNotFilledFlag,
*/
)

fun findFeatureFlagByName(featureName: String): InAppFeatureFlag? {
Expand Down
Loading

0 comments on commit 52bd9f4

Please sign in to comment.