Skip to content

Commit

Permalink
Merge from develop to main (#70)
Browse files Browse the repository at this point in the history
* Update .gitignore to ignore all .idea files and all build directories. (#20)

* Turn on Gradle parallel execution and caching.

* Add "app_deployment" key (#21)

* Add "app_deployment" key

* Lint

* Initial setup of StrictMode - only logging in debug. (#22)

* Initial setup of StrictMode - only logging in debug.

* Revert injection changes

* Use limitedParallelism and MainScope() in AbacusThreadingImp. (#25)

* Handle exception with invalid URLs (#26)

* MOB-348 Show Squid routing error on deposit/withdrawal (#28)

* Update AppModule.kt and used dependencies to follow Dagger Best Practices guide (in Notion). (#27)

* Correlate x-request-id to correlate route requests from Squid transactions (#23)

* Fix build (#29)

* MOB-362: Some url links don't work with the deployment build (#31)

* Test

* Check for deeplink path during routing

* Clean up

* Clean up

* Update rest of Dagger modules to follow best practices. (#30)

* Remove network selector from settings for release build (#33)

* MOB-363: Android: "System" theme setting not working (#32)

* Observe system theme

* Recompose when theme changes

* Fix a crash on url tapping (#34)

* Remove hardcoded scheme in the setting links. (#35)

* Add Firebase Performance monitoring. (#37)

* Bump Abacus and update the system link. (#36)

* Fix the release build issue of wallet amount not showing up on deposit (#38)

* Fix Subaccount transfer for France (#39)

* Fix Subaccount transfer for France

* Lint

* Update function name to be consistent with iOS

* Clean up the start-up sequence (#41)

* Clean up the start-up sequence

* Lint

* Update Cartera and WalletConnnect to the latest version (#40)

* Update Cartera

* Lint

* Add comments

* MOB-285: Call startTrade() after setMarket() (#43)

* Update the v4-native-client.js to replace # with ___ (#42)

* Add script

* Update v4-client.js

* Safer replacement

* Safer replacement

* Move startWorkers back to Activity.onCreate() (#44)

* Move startWorkers back to Activity.start()

* Comment

* MOB-410 Add tracking for onboarding, transfer, wallet connection (#46)

* Adding Onboarding/Transfer/Wallet events

* Add userID and userProperties

* Optimiazation

* Add link to send logcat messages via email (#45)

* Add link to send logcat messages via email

* Clean up

* Error handling

* Make file provider depending on applicationId

* MOB-432 previous branch was based on a wrong branch (#48)

* MOB-432 previous branch was based on a wrong branch

* PR

* Bump Abacus (#50)

* Bump Abacus

* Revert

* MOB-421 add settings control to turn in-app notifications on/off completely  (#49)

* MOB-421 add settings control to turn in-app notifications on/off completely

* MOB-421 add settings control to turn in-app notifications on/off completely

* Clean up

* Feature/mob 396 position cell with margin type (#51)

* MOB-432 previous branch was based on a wrong branch

* PR

* MOB-396 skeleton for position cell

* Better layout for place holder views (when there is no position, fill or transfers)

* Convert AbacusState flows into StateFlows. (#52)

* MOB-422 Withdrawal gating (#53)

* Withdrawal Gating

* Clean up

* Doing the paddings better. (#56)

* Update Android Gradle Plugin (#55)

* MOB-446  create new add price triggers panel screen  (#58)

* SL/TP Routing and  price triggers panel screen

* Update deeplink to match iOS

* Renaming

* MOB-443 add limit price to price triggers screen (#60)

* Feature/mob 356 trade input (#57)

* Margin type and leverage screens skeleton

* MOB-356 MOB-358 Margin mode screen

* Change bg color

* move modifier to param

* Feature/mob 257 weekly dates (#61)

* Added end time to rewards date range

* lint

* Update SharingStarted usages from Lazily to WhileSubscribed(). (#62)

* Fix issue of text input losing calculated value when not focused (#64)

* Inject coroutine scopes and dispatchers instead of hardcoding. (#65)

* Revert "Update SharingStarted usages from Lazily to WhileSubscribed(). (#62)" (#66)

This reverts commit de98092.

* Fix margin issues with portfolio position items (#67)

* Fix threading issue (#68)

* Bump Abacus and v4-client (#69)

---------

Co-authored-by: prashanDYDX <163016611+prashanDYDX@users.noreply.github.com>
Co-authored-by: Prashan Dharmasena <prashan@dydx.exchange>
Co-authored-by: John Huang <johnqh@yahoo.com>
  • Loading branch information
4 people authored Apr 11, 2024
1 parent 0b04cf6 commit f78405a
Show file tree
Hide file tree
Showing 159 changed files with 7,637 additions and 2,725 deletions.
25 changes: 2 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,9 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/copilot
/.idea/libraries
/.idea/dictionaries
/.idea/misc.xml
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/deploymentTargetDropDown.xml
/.idea
.DS_Store
**/build/*.compiler.options
**/build/.transforms
**/build/generated
**/build/intermediates
**/build/kotlin
**/build/kotlinToolingMetadata/
**/build/outputs
**/build/spotless
**/build/test-results
**/build/tmp
**/build/gmpAppId.txt
**/build/reports/*
!**/build/reports/lint-results-debug.txt
build/
captures
.externalNativeBuild
.cxx
Expand Down
1 change: 1 addition & 0 deletions .idea/.name

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

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext.ktlintVersion = '0.48.0'
ext.kotlinVersion = '1.9.20'
ext.androidApplicationVersion = '8.2.2'
ext.androidApplicationVersion = '8.3.1'

repositories {
google()
Expand Down
12 changes: 5 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

org.gradle.parallel=true
org.gradle.caching=true

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Manually configure analysis per project
dependency.analysis.autoapply=false
systemProp.dependency.analysis.test.analysis=false


android.enableR8.fullMode = false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jan 30 10:45:32 PST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
85 changes: 85 additions & 0 deletions scripts/replace_hash_sign.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/sh

# This script replaces the private function and property names in a file with a new name
# so that Android devices with browsers that supports old javascript syntax can run the code

# Check if filename is provided as argument
if [ $# -ne 1 ]; then
echo "Usage: $0 <filename>"
exit 1
fi

filename="$1"

# Check if the file exists
if [ ! -f "$filename" ]; then
echo "Error: File '$filename' not found."
exit 1
fi

# create an empty array to store the names
functionNames=()
propertyNames=()

# Read the file line by line and print each line
while IFS= read -r line; do
# " #name(....) {"
if [[ $line =~ ^\ \ \ \ \#.*\{$ ]]; then
# extract the string beween # and (, and remove the rest
name=`echo "${line#*#}" | sed 's/(.*//'`
# add the name to the names array
functionNames+=("$name")
fi

# " async #name(....) {"
if [[ $line =~ ^\ \ \ \ \async\ #.*\{$ ]]; then
# extract the string beween # and (, and remove the rest
name=`echo "${line#*#}" | sed 's/(.*//'`
# add the name to the names array
functionNames+=("$name")
fi

# " static async #name(....) {"
if [[ $line =~ ^\ \ \ \ \static\ async\ #.*\{$ ]]; then
# extract the string beween # and (, and remove the rest
name=`echo "${line#*#}" | sed 's/(.*//'`
# add the name to the names array
functionNames+=("$name")
fi

if [[ $line =~ ^\ \ \ \ \static\ #.*\{$ ]]; then
# extract the string beween # and (, and remove the rest
name=`echo "${line#*#}" | sed 's/(.*//'`
# add the name to the names array
functionNames+=("$name")
fi

if [[ $line =~ ^\ \ \ \ \#.*\;$ ]]; then
# extract the string beween # and ;, and remove the rest
name=`echo "${line#*#}" | sed 's/;.*//'`
propertyNames+=("$name")
fi
done < "$filename"

# remove duplicates from the array
functionNames=($(echo "${functionNames[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
propertyNames=($(echo "${propertyNames[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' '))

# replace the names in the file
for name in "${functionNames[@]}"; do
echo "Replacing function name: #$name"
before="#$name("
after="___$name("
# replace the before string with the after string in the file
sed -i '' "s/$before/$after/g" $filename
done

for name in "${propertyNames[@]}"; do
echo "Replacing property name: #$name"
before="\ #$name"
after="\ ___$name"
sed -i '' "s/$before/$after/g" $filename
before="\.#$name"
after="\.___$name"
sed -i '' "s/$before/$after/g" $filename
done
3 changes: 3 additions & 0 deletions scripts/update_client_api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ if [ -d "$TARGET_DIR" ]; then
else
echo "Target directory $TARGET_DIR does not exist. File not copied."
fi

# Replace private functions and properties that start with #
${ORIG_DIR}/replace_hash_sign.sh "$TARGET_DIR/v4-native-client.js"
6 changes: 5 additions & 1 deletion v4/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id 'dagger.hilt.android.plugin'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
id 'com.google.firebase.firebase-perf' version '1.4.2'
}


Expand Down Expand Up @@ -96,7 +97,9 @@ android {

configurations {
all {
// Exclude libraries to resolve duplicate dependencies
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15to18'
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
}
}

Expand Down Expand Up @@ -163,9 +166,10 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion"

// Import the Firebase BoM
implementation platform ("com.google.firebase:firebase-bom:$firebaseBomVersion")
implementation platform("com.google.firebase:firebase-bom:$firebaseBomVersion")
implementation 'com.google.firebase:firebase-analytics'
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-perf")


// Add the dependencies for any other desired Firebase products
Expand Down
1 change: 1 addition & 0 deletions v4/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@com.google.gson.annotations.SerializedName <fields>;
}

-keep class org.web3j.** { *; }

# cartera
-keep interface com.walletconnect.foundation.network.data.service.RelayService
Expand Down
13 changes: 13 additions & 0 deletions v4/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<!-- <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>-->

<application
Expand Down Expand Up @@ -165,6 +168,16 @@
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="qr_code, data_matrix" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

</application>

<queries>
Expand Down
60 changes: 60 additions & 0 deletions v4/app/src/main/assets/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,66 @@
}
]
}
},
{
"title":{
"text":"Isolated Market"
},
"field":{
"field":"enable_isolated_market",
"optional":true,
"type" : "text",
"options" : [
{
"text": "yes",
"value" : "1"
},
{
"text": "no",
"value" : "0"
}
]
}
},
{
"title":{
"text":"Abacus V2"
},
"field":{
"field":"enable_abacus_v2",
"optional":true,
"type" : "text",
"options" : [
{
"text": "yes",
"value" : "1"
},
{
"text": "no",
"value" : "0"
}
]
}
},
{
"title":{
"text":"SL/TP Trigger"
},
"field":{
"field":"enable_sl_tp_trigger",
"optional":true,
"type" : "text",
"options" : [
{
"text": "yes",
"value" : "1"
},
{
"text": "no",
"value" : "0"
}
]
}
}
]
}
Expand Down
24 changes: 12 additions & 12 deletions v4/app/src/main/assets/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"text": "APP.LANGUAGE.LANGUAGE"
},
"link": {
"text": "dydxv4://open/settings/language"
"text": "settings/language"
},
"field": {
"field": "language"
Expand All @@ -17,40 +17,40 @@
"text" : "APP.V4.THEME"
},
"link" : {
"text" : "dydxv4://open/settings/theme"
"text" : "settings/theme"
},
"field":{
"field":"v4_theme"
}
},
{
"title" : {
"text" : "APP.V4.TRADING_NETWORK"
"text" : "APP.V4.NOTIFICATIONS"
},
"link" : {
"text" : "dydxv4://open/settings/env"
"text" : "settings/notifications"
},
"field":{
"field":"env"
"field":"should_display_in_app_notifications"
}
},
{
"title" : {
"text" : "APP.V4.SYSTEM_STATUS"
"text" : "APP.V4.DIRECTION_COLOR_PREFERENCE"
},
"link" : {
"text" : "dydxv4://open/settings/status"
"text" : "settings/direction_color_preference"
},
"field":{
"field":"direction_color_preference"
}
},
{
"title" : {
"text" : "APP.V4.DIRECTION_COLOR_PREFERENCE"
"text" : "APP.V4.SYSTEM_STATUS"
},
"link" : {
"text" : "dydxv4://open/settings/direction_color_preference"
},
"field":{
"field":"direction_color_preference"
"text" : "settings/status"
}
}
]
Expand Down
Loading

0 comments on commit f78405a

Please sign in to comment.