Skip to content

Commit 5fa0120

Browse files
committed
Merge branch v1.51.2
2 parents ca36a30 + 79ef792 commit 5fa0120

File tree

201 files changed

+4955
-2929
lines changed

Some content is hidden

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

201 files changed

+4955
-2929
lines changed

.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ include:
1818
- project: 'Trustee/walletinternals'
1919
ref: master
2020
file: '/gitlabcicd/wallet-gitlab-ci.yml'
21-
- project: 'Trustee/walletinternals'
22-
ref: master
23-
file: '/githubcicd/wallet-github-ci.yml'
21+
# - project: 'Trustee/walletinternals'
22+
# ref: master
23+
# file: '/githubcicd/wallet-github-ci.yml'
2424

App.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import React from 'react'
77
import { Provider } from 'react-redux'
88
import { AppearanceProvider } from 'react-native-appearance'
99
import { enableScreens } from 'react-native-screens'
10-
import appsFlyer from 'react-native-appsflyer'
1110

1211
import store from '@app/store'
1312

@@ -16,18 +15,6 @@ import { ThemeProvider } from '@app/theme/ThemeProvider'
1615

1716
import Application from '@app/appstores/Actions/App/App'
1817

19-
20-
appsFlyer.initSdk(
21-
{
22-
devKey: 'qUa6hSzjW3RDsTgEYQh4oT',
23-
isDebug: false,
24-
appId: '1462924276',
25-
onInstallConversionDataListener: true, // Optional
26-
onDeepLinkListener: true, // Optional
27-
timeToWaitForATTUserAuthorization: 10 // for iOS 14.5
28-
}
29-
);
30-
3118
enableScreens()
3219

3320
export default class App extends React.Component {

android/app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def enableProguardInReleaseBuilds = false
109109
* give correct results when using with locales other than en-US. Note that
110110
* this variant is about 6MiB larger per architecture than default.
111111
*/
112-
def jscFlavor = 'org.webkit:android-jsc:+'
112+
// def jscFlavor = 'org.webkit:android-jsc:+'
113+
def jscFlavor = 'org.webkit:android-jsc-intl:+'
113114

114115
/**
115116
* Whether to enable the Hermes VM.
@@ -133,7 +134,7 @@ android {
133134
minSdkVersion rootProject.ext.minSdkVersion
134135
targetSdkVersion rootProject.ext.targetSdkVersion
135136
versionCode 1
136-
versionName "1.50.8"
137+
versionName "1.51.2"
137138

138139
missingDimensionStrategy 'react-native-camera', 'general'
139140
multiDexEnabled true

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
3636
android:windowSoftInputMode="adjustResize"
3737
android:screenOrientation="portrait"
38-
android:launchMode="singleTask">
38+
android:launchMode="singleTask"
39+
android:exported="true">
3940
<intent-filter>
4041
<action android:name="android.intent.action.MAIN" />
4142
<category android:name="android.intent.category.LAUNCHER" />
5.86 KB
Binary file not shown.

android/build.gradle

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ buildscript {
55
firebaseMessagingVersion = "21.1.0"
66
buildToolsVersion = "30.0.3"
77
minSdkVersion = 21
8-
compileSdkVersion = 30
9-
targetSdkVersion = 30
8+
compileSdkVersion = 31
9+
targetSdkVersion = 31
10+
kotlinVersion = "1.6.0"
1011
}
1112
repositories {
1213
google()
@@ -28,6 +29,21 @@ buildscript {
2829

2930
allprojects {
3031
repositories {
32+
exclusiveContent {
33+
// https://github.com/facebook/react-native/issues/35210
34+
// We get React Native's Android binaries exclusively through npm,
35+
// from a local Maven repo inside node_modules/react-native/.
36+
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
37+
// and potentially getting a wrong version.)
38+
filter {
39+
includeGroup "com.facebook.react"
40+
}
41+
forRepository {
42+
maven {
43+
url "$rootDir/../node_modules/react-native/android"
44+
}
45+
}
46+
}
3147
mavenLocal()
3248
maven {
3349
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm

app/appstores/DataSource/Account/AccountScanning.js

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class AccountScanning {
2020
let where = []
2121
let limit = 3
2222

23-
//where.push(`account.currency_code='ETH_UAX'`)
24-
2523
if (typeof params.force === 'undefined' || !params.force) {
2624
const now = Math.round(new Date().getTime() / 1000) - 30 // 1 minute before
2725
where.push(`(account_balance.balance_scan_time IS NULL OR account_balance.balance_scan_time < ${now} OR account.transactions_scan_time IS NULL OR account.transactions_scan_time < ${now})`)
@@ -74,39 +72,6 @@ class AccountScanning {
7472
} else {
7573
where = ''
7674
}
77-
78-
const sqlTotal = `
79-
SELECT
80-
account.id,
81-
account.currency_code AS currencyCode,
82-
account.wallet_hash AS walletHash,
83-
account.address,
84-
account.transactions_scan_time AS transactionsScanTime,
85-
account.transactions_scan_log AS transactionsScanLog,
86-
account_balance.balance_provider AS balanceProvider,
87-
account_balance.balance_scan_time AS balanceScanTime,
88-
account_balance.balance_scan_error AS balanceScanError,
89-
account_balance.balance_scan_log AS balanceScanLog,
90-
account_balance.balance_scan_block AS balanceScanBlock
91-
FROM account
92-
LEFT JOIN account_balance ON account_balance.account_id=account.id
93-
LEFT JOIN currency ON currency.currency_code=account.currency_code
94-
LEFT JOIN wallet ON wallet.wallet_hash=account.wallet_hash
95-
ORDER BY account_balance.balance_scan_time ASC, account.currency_code ASC
96-
`
97-
const resTotal = await Database.query(sqlTotal)
98-
let tmp = ''
99-
for (const account1 of resTotal.array) {
100-
tmp += account1.currencyCode + ' ' + account1.address + ' ' + (account1.balanceScanLog ? account1.balanceScanLog.substr(0, 200) : '') + `
101-
`
102-
}
103-
Log.test(`
104-
105-
============================================================================================
106-
${new Date().toISOString()} accounts total
107-
${tmp}
108-
`)
109-
11075
const sql = `
11176
SELECT
11277
account.id,
@@ -141,15 +106,13 @@ class AccountScanning {
141106
ORDER BY account_balance.balance_scan_time ASC, account.currency_code ASC
142107
LIMIT ${limit}
143108
`
144-
Log.daemon('AccountScanning getAccountsForScan where ' + where + ' limit ' + limit)
145109

146110
let res = []
147111
const uniqueAddresses = {}
148112
const idsToRemove = []
149113
try {
150114
res = await Database.query(sql)
151115
if (!res || typeof res.array === 'undefined' || !res.array || !res.array.length) {
152-
Log.daemon('AccountScanning getAccountsForScan finished as empty')
153116
return false
154117
}
155118
res = res.array
@@ -191,7 +154,6 @@ class AccountScanning {
191154
}
192155
}
193156
if (idsToRemove.length > 0) {
194-
Log.daemon('AccountScanning getAccountsForScan unique check finished, found ' + idsToRemove.join(','))
195157
Log.daemon('AccountScanning getAccountsForScan not removed', uniqueAddresses)
196158

197159
await Database.query(`DELETE FROM account WHERE id IN (${idsToRemove.join(',')})`)
@@ -244,7 +206,6 @@ class AccountScanning {
244206
try {
245207
let res = await Database.query(sql)
246208
if (!res || typeof res.array === 'undefined' || !res.array || !res.array.length) {
247-
Log.daemon('AccountScanning getAddresses finished as empty')
248209
return false
249210
}
250211
if (typeof params.limit !== 'undefined') {
@@ -254,7 +215,7 @@ class AccountScanning {
254215
}
255216

256217
res = res.array
257-
218+
258219
res = res.map(e => e.addressName.includes("CREATED") ? {...e, addressName: ''} : e)
259220

260221
let tmp

app/appstores/DataSource/Database/core/init/assets/dbTableUpdateQueries.js

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import currencyActions from '@app/appstores/Stores/Currency/CurrencyActions'
88
import { SettingsKeystore } from '@app/appstores/Stores/Settings/SettingsKeystore'
99

1010
import Log from '@app/services/Log/Log'
11+
import BlocksoftCryptoLog from '@crypto/common/BlocksoftCryptoLog'
1112

1213
import countries from '@assets/jsons/other/country-codes'
1314

1415
import settingsActions from '@app/appstores/Stores/Settings/SettingsActions'
16+
import { FileSystem } from '@app/services/FileSystem/FileSystem'
17+
1518

1619
export default function getTableUpdateQueries() {
1720
return {
18-
maxVersion: 136,
21+
maxVersion: 138,
1922
updateQuery: {
2023
1: {
2124
queryString: `ALTER TABLE account ADD COLUMN transactions_scan_time INTEGER NULL`,
@@ -976,7 +979,47 @@ export default function getTableUpdateQueries() {
976979
AND (transaction_hash='${address}')`)
977980
}
978981
}
979-
}
982+
},
983+
984+
137: {
985+
afterFunction: async (dbInterface) => {
986+
try {
987+
const res = await dbInterface.query(`SELECT is_hidden FROM currency WHERE currency_code='ETH_RSR'`)
988+
if (res && res.array) {
989+
for(const row of res.array) {
990+
console.log(`row old`, row)
991+
const res3 = await dbInterface.query(`SELECT is_hidden FROM currency WHERE currency_code='ETH_RSR_NEW'`)
992+
if (!res3 || !res3.array || !res3.array.length) {
993+
Log.log('DB/Update afterFunction insert RSR_NEW')
994+
await dbInterface.query(`INSERT INTO currency ( currency_code , currency_rate_scan_time , is_hidden ) VALUES ( 'ETH_RSR_NEW' , '0' , ${row.is_hidden})`)
995+
} else {
996+
Log.log('DB/Update afterFunction update RSR_NEW')
997+
await dbInterface.query(`UPDATE currency SET is_hidden=${row.is_hidden} WHERE currency_code='ETH_RSR_NEW'`)
998+
}
999+
}
1000+
}
1001+
} catch (e) {
1002+
Log.err('DB/Update afterFunction - Migration 137 error', e)
1003+
}
1004+
}
1005+
},
1006+
1007+
138: {
1008+
afterFunction: async (dbInterface) => {
1009+
try {
1010+
const zp = new FileSystem({ baseDir: 'zip', fileName: 'logsB', fileExtension: 'zip' })
1011+
await zp.cleanDir()
1012+
await Log.FS.ALL.cleanFile()
1013+
await Log.FS.TEST.cleanFile()
1014+
await Log.FS.DAEMON.cleanFile()
1015+
await BlocksoftCryptoLog.FS.cleanFile()
1016+
await Log.FS.ALL.cleanDir()
1017+
} catch (e) {
1018+
console.log('DB/Update afterFunction - Migration 138 error', e)
1019+
}
1020+
}
1021+
},
1022+
9801023
}
9811024
}
9821025
}

app/appstores/DataSource/Transaction/Transaction.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Log from '@app/services/Log/Log'
66
import BlocksoftUtils from '@crypto/common/BlocksoftUtils'
77
import config from '@app/config/config'
88
import TransactionFilterTypeDict from '@appV2/dicts/transactionFilterTypeDict'
9+
import BlocksoftExternalSettings from '@crypto/common/BlocksoftExternalSettings'
910

1011
class Transaction {
1112

@@ -238,6 +239,7 @@ class Transaction {
238239
* @param {string} params.filterTypeHideSwap
239240
* @param {string} params.filterTypeHideStake
240241
* @param {string} params.filterTypeHideWalletConnect
242+
* @param {string} params.filterTypeShowSpam
241243
* @returns {Promise<[{createdAt, updatedAt, blockTime, blockHash, blockNumber, blockConfirmations, transactionHash, addressFrom, addressAmount, addressTo, transactionFee, transactionStatus, transactionDirection, accountId, walletHash, currencyCode, transactionOfTrusteeWallet, transactionJson}]>}
242244
*/
243245
getTransactions = async (params, source = '?') => {
@@ -340,6 +342,17 @@ class Transaction {
340342
`)
341343
}
342344

345+
if (typeof params.filterTypeShowSpam !== 'undefined' && params.filterTypeShowSpam) {
346+
// do nothing
347+
} else {
348+
const spamLimit = BlocksoftExternalSettings.getStatic('TRX_SPAM_LIMIT') * 1
349+
if (spamLimit > 1) {
350+
where.push(`
351+
NOT(currency_code='TRX' AND transaction_direction = 'income' AND address_amount<${spamLimit})
352+
`)
353+
}
354+
}
355+
343356

344357
// other categories
345358
if (typeof params.filterTypeHideSwap !== 'undefined' && params.filterTypeHideSwap) {
@@ -385,7 +398,10 @@ class Transaction {
385398
}
386399

387400
where.push(`transaction_hash !=''`)
388-
where.push(`NOT (transaction_direction IN ('swap_income', 'income') AND (address_amount == '0' OR address_amount IS NULL))`)
401+
402+
// trx fee somehow marked as "swap_income"
403+
where.push(`NOT (currency_code != 'TRX' AND transaction_direction IN ('swap_income', 'income') AND (address_amount == '0' OR address_amount IS NULL))`)
404+
where.push(`NOT (currency_code = 'TRX' AND address_from !='' AND (address_amount == '0' OR address_amount IS NULL))`)
389405

390406
let order = ' ORDER BY created_at DESC, id DESC'
391407
if (params.noOrder) {
@@ -394,8 +410,7 @@ class Transaction {
394410
where.push(`(hidden_at IS NULL OR hidden_at='null')`)
395411
}
396412

397-
// where.push(`(address_from OR adress_to OR transaction_hash) LIKE ('d2884dd42808150753d')`)
398-
// where.push(`'${source}' = '${source})
413+
399414

400415
if (where.length > 0) {
401416
where = ' WHERE (' + where.join(') AND (') + ')'

app/appstores/DataSource/Wallet/Wallet.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* @version 0.9
2+
* @version 0.77
33
*/
44
import Database from '@app/appstores/DataSource/Database'
55

66
import BlocksoftKeysUtils from '@crypto/actions/BlocksoftKeys/BlocksoftKeysUtils'
7-
import Log from '@app/services/Log/Log'
87
import CashBackUtils from '@app/appstores/Stores/CashBack/CashBackUtils'
98
import UpdateWalletsDaemon from '@app/daemons/back/UpdateWalletsDaemon'
109

1110
import store from '@app/store'
11+
import Validator from '@app/services/UI/Validator/Validator'
1212

1313

1414
const CACHE = []
@@ -66,11 +66,9 @@ class Wallet {
6666
* @returns {Promise<void>}
6767
*/
6868
clearWallet = async (wallet) => {
69-
Log.daemon('DS/Wallet clear wallet called ' + wallet.walletHash)
7069
const sql = `DELETE FROM wallet WHERE wallet_hash='${wallet.walletHash}'`
7170
await Database.query(sql)
7271
CACHE[wallet.walletHash] = false
73-
Log.daemon('DS/Wallet clear wallet finished ' + wallet.walletHash)
7472
}
7573

7674
/**
@@ -192,7 +190,6 @@ class Wallet {
192190
wallet_is_created_here AS walletIsCreatedHere
193191
FROM wallet ORDER BY wallet_number`)
194192
if (!res || !res.array) {
195-
Log.log('DS/Wallet getWallets no result')
196193
return []
197194
}
198195
for (let i = 0, ic = res.array.length; i < ic; i++) {
@@ -215,6 +212,10 @@ class Wallet {
215212
_prepWallet(wallet) {
216213
wallet.walletToSendStatus = wallet.walletToSendStatus * 1
217214
wallet.walletName = Database.unEscapeString(wallet.walletName)
215+
const safeName = Validator.safeWords(wallet.walletName, 10)
216+
if (wallet.walletName !== safeName) {
217+
Database.query(`UPDATE wallet SET wallet_name='${Database.escapeString(safeName)}' WHERE wallet_hash='${wallet.walletHash}'`)
218+
}
218219
wallet.walletNumber = wallet.walletNumber * 1 || 1
219220
wallet.walletIsHd = wallet.walletIsHd * 1 || 0
220221
if (typeof wallet.walletIsBackedUp !== 'undefined') {

0 commit comments

Comments
 (0)