Skip to content

Commit

Permalink
Merge branch v1.50.5
Browse files Browse the repository at this point in the history
  • Loading branch information
rhrusha committed Feb 11, 2022
2 parents be8fc54 + 42b9664 commit 15d927e
Show file tree
Hide file tree
Showing 189 changed files with 6,332 additions and 1,352 deletions.
19 changes: 2 additions & 17 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import React from 'react'

import { Provider } from 'react-redux'
import { AppearanceProvider } from 'react-native-appearance'
import { Platform, UIManager, Linking } from 'react-native'
import { enableScreens } from 'react-native-screens'
import appsFlyer from 'react-native-appsflyer'

import store from '@app/store'

Expand All @@ -16,10 +16,6 @@ import { ThemeProvider } from '@app/theme/ThemeProvider'

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

import appsFlyer from 'react-native-appsflyer'

import { SendReceiveDeepLinking } from '@app/appstores/Stores/Send/SendReceiveDeepLinking'


appsFlyer.initSdk(
{
Expand All @@ -34,25 +30,14 @@ appsFlyer.initSdk(

enableScreens()

const handler = ({ url }) => {
SendReceiveDeepLinking.receiveDeepLink(url)
}

export default class App extends React.Component {

componentDidMount() {
Application.init({ source: 'App.mount', onMount : true })

if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true)
}
}
Linking.addEventListener('url', handler)
}

componentWillUnmount() {
Linking.removeEventListener('url', handler)
Application.willUnmount()
}

render() {
Expand Down
4 changes: 3 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.50.4"
versionName "1.50.5"

missingDimensionStrategy 'react-native-camera', 'general'
multiDexEnabled true
Expand Down Expand Up @@ -246,6 +246,8 @@ dependencies {

implementation "com.facebook.react:react-native:+" // From node_modules

implementation("com.squareup.okhttp3:okhttp-urlconnection:4.4.1")

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
Expand Down
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ allprojects {
includeModule("com.github.florent37", "singledateandtimepicker") // Required by fioprotocol_fiosdk
includeModule("com.jraska", "console") // Required by fioprotocol_fiosdk
includeModule("com.eightbitlab", "blurview") // Required by react-native-community_blur
includeGroup("com.google.android.exoplayer")
}
}
maven { url 'https://jitpack.io' }
Expand Down
32 changes: 25 additions & 7 deletions app/appstores/Actions/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @version 0.9
*/
import '@app/services/GlobalExceptionHandler/GlobalExceptionHandler'
import { Text } from 'react-native'
import { Text, Platform, UIManager } from 'react-native'

import Orientation from 'react-native-orientation'

Expand Down Expand Up @@ -34,6 +34,7 @@ import UpdateAccountListDaemon from '@app/daemons/view/UpdateAccountListDaemon'
import config from '@app/config/config'
import currencyBasicActions from '@app/appstores/Stores/CurrencyBasic/CurrencyBasicActions'
import trusteeAsyncStorage from '@appV2/services/trusteeAsyncStorage/trusteeAsyncStorage'
import AppDeepLinking from '@app/services/AppDeepLinking/AppDeepLinking'

if (Text.defaultProps == null) Text.defaultProps = {}
Text.defaultProps.allowFontScaling = false
Expand Down Expand Up @@ -85,6 +86,16 @@ class App {

return
}

AppLockScreenIdleTime.init()

this.initStatus = 'AppLockScreenIdleTime.init()'

this.addSupportUiMananger()

AppDeepLinking.init()

this.initStatus = 'AppDeepLinking.init()'
}

this.initHasWallets = true
Expand All @@ -105,13 +116,8 @@ class App {

this.initStatus = 'await this.refreshWalletsStore(true)'

AppLockScreenIdleTime.init()

this.initStatus = 'AppLockScreenIdleTime.init()'

if (UpdateAppNewsDaemon.isGoToNotifications('AFTER_APP')) {
// NavStore.reset('HomeScreen', { screen: 'NotificationsScreen' }) - not working
NavStore.reset('NotificationsScreen')
NavStore.reset('TabBar', { screen: 'HomeScreen', params: { screen: 'NotificationsScreen', initial: false }})
} else {
UpdateAppNewsDaemon.goToNotifications('INITED_APP')
}
Expand Down Expand Up @@ -202,6 +208,18 @@ class App {
await setFilter(filter)
}

addSupportUiMananger = () => {
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true)
}
}
}

willUnmount = () => {
AppDeepLinking.willUnmount()
AppLockScreenIdleTime.willUnmount()
}

}

Expand Down
10 changes: 8 additions & 2 deletions app/appstores/Actions/TransactionActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,19 @@ const transactionActions = {
}

if (transaction.transactionDirection === 'income' && typeof exchangeOrder.requestedOutAmount !== 'undefined' && typeof exchangeOrder.requestedOutAmount.amount !== 'undefined') {
transaction.addressAmountPretty = exchangeOrder.requestedOutAmount.amount
if (!transaction?.addressAmountPretty || transaction?.addressAmountPretty === '?') {
const res = BlocksoftPrettyNumbers.makeCut(exchangeOrder.requestedOutAmount.amount)
transaction.addressAmountPretty = res.cutted
}
if (!transaction.currencyCode) {
transaction.currencyCode = exchangeOrder.requestedOutAmount.currencyCode
}
}
if (transaction.transactionDirection === 'outcome' && typeof exchangeOrder.requestedInAmount !== 'undefined' && typeof exchangeOrder.requestedInAmount.amount !== 'undefined') {
transaction.addressAmountPretty = exchangeOrder.requestedInAmount.amount
if (!transaction?.addressAmountPretty || transaction?.addressAmountPretty === '?') {
const res = BlocksoftPrettyNumbers.makeCut(exchangeOrder.requestedInAmount.amount)
transaction.addressAmountPretty = res.cutted
}
if (!transaction.currencyCode) {
transaction.currencyCode = exchangeOrder.requestedInAmount.currencyCode
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export default function getTableQueries() {
wallet_is_hide_transaction_for_fee INTEGER NULL,
wallet_number INTEGER NULL,
wallet_to_send_status INTEGER NULL
wallet_to_send_status INTEGER NULL,
wallet_is_created_here INTEGER NULL
)`
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import axios from 'axios'
import VersionCheck from 'react-native-version-check'

import axios from 'axios';
import VersionCheck from 'react-native-version-check';

import BlocksoftDict from '@crypto/common/BlocksoftDict';
import BlocksoftDict from '@crypto/common/BlocksoftDict'
import BlocksoftKeysStorage from '@crypto/actions/BlocksoftKeysStorage/BlocksoftKeysStorage'

import currencyActions from '@app/appstores/Stores/Currency/CurrencyActions';
import { SettingsKeystore } from '@app/appstores/Stores/Settings/SettingsKeystore';
import currencyActions from '@app/appstores/Stores/Currency/CurrencyActions'
import { SettingsKeystore } from '@app/appstores/Stores/Settings/SettingsKeystore'

import Log from '@app/services/Log/Log';
import Log from '@app/services/Log/Log'

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

import settingsActions from '@app/appstores/Stores/Settings/SettingsActions'

export default function getTableUpdateQueries() {
return {
maxVersion: 130,
maxVersion: 136,
updateQuery: {
1: {
queryString: `ALTER TABLE account ADD COLUMN transactions_scan_time INTEGER NULL`,
Expand Down Expand Up @@ -762,36 +761,36 @@ export default function getTableUpdateQueries() {
queryString: `ALTER TABLE card ADD COLUMN card_check_status VARCHAR(256) NULL`
},

111: {
111: {
queryString: `ALTER TABLE card ADD COLUMN card_to_send_status INTEGER NULL`
},

112: {
112: {
queryString: `ALTER TABLE card ADD COLUMN card_create_wallet_hash VARCHAR(256) NULL`
},

113: {
113: {
queryString: `ALTER TABLE wallet ADD COLUMN wallet_to_send_status INTEGER NULL`
},

114 : {
queryString: `ALTER TABLE wallet ADD COLUMN wallet_number INTEGER NULL`
},
114: {
queryString: `ALTER TABLE wallet ADD COLUMN wallet_number INTEGER NULL`
},

115: {
115: {
afterFunction: async (dbInterface) => {
const wallets = await dbInterface.query('SELECT wallet_hash FROM wallet')
let index = 0
let index = 0
if (typeof wallets.array !== 'undefined' && wallets.array) {
for (const row of wallets.array) {
index++
await await dbInterface.query(`UPDATE wallet SET wallet_number=${index} WHERE wallet_hash='${row.wallet_hash}'`)
index++
await await dbInterface.query(`UPDATE wallet SET wallet_number=${index} WHERE wallet_hash='${row.wallet_hash}'`)
}
}
}
},
},

116: {
116: {
queryString: `ALTER TABLE card ADD COLUMN card_to_send_id INTEGER NULL`
},

Expand All @@ -808,7 +807,7 @@ export default function getTableUpdateQueries() {
}
},

118 : {
118: {
queryString: `CREATE TABLE IF NOT EXISTS custom_nfts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
Expand Down Expand Up @@ -930,6 +929,54 @@ export default function getTableUpdateQueries() {
await dbInterface.query(`DELETE FROM account WHERE wallet_hash NOT LIKE '2863e6c80b4d287969d91f74ac974df9' AND address='0xf1Cff704c6E6ce459e3E1544a9533cCcBDAD7B99'`)
}
},

131: {
afterFunction: async (dbInterface) => {
await dbInterface.query(`DELETE FROM transactions_scanners_tmp WHERE currency_code='XRP'`)
}
},

132: {
queryString: `ALTER TABLE wallet ADD COLUMN wallet_is_created_here INTEGER NULL`
},

133: {
afterFunction: async (dbInterface) => {
await dbInterface.query(`DELETE FROM account WHERE wallet_hash NOT LIKE '0c9a28aa7f4b7ae79a99bf56a92a80b8' AND address='7q6PYSw2dCYfw74igJtDB4iodhCrGBvUg78TnScK6kZj'`)
}
},

134: {
afterFunction: async (dbInterface) => {
await dbInterface.query(`DELETE FROM account WHERE wallet_hash NOT LIKE '0c9a28aa7f4b7ae79a99bf56a92a80b8' AND address='GsBTrAGNbY2Fgya1F48rAjPXNNLB88JwMM7fM93Waqkp'`)
}
},

135: {
afterFunction: async (dbInterface) => {
await dbInterface.query(`DELETE FROM account WHERE wallet_hash NOT LIKE '0c9a28aa7f4b7ae79a99bf56a92a80b8' AND address='GAVEX22PIDJDXDYMP6P4JU6NUCLE7YRK4WJGCSAC4STCY5E35VAFYNCG'`)
}
},

136: {
afterFunction: async (dbInterface) => {
const addresses = [
'ekXU6sCbHxDmTip1JafikRgCnNUWbGV3MjFAiiMbrB3UCXyBkHvPt44KiA6EBVTB6HAUgDrTPB2KtuZggnQfKMx',
'5XmFi1jP8MDPtRje64tLQNuRCEsXAsg29mcpc7UQoubZtbXTFH5vTi6cXe72NQVMCzLNgff6dJdKS6CnZmBmn7hK',
'ekXU6sCbHxDmTip1JafikRgCnNUWbGV3MjFAiiMbrB3UCXyBkHvPt44KiA6EBVTB6HAUgDrTPB2KtuZggnQfKMx',
'5XmFi1jP8MDPtRje64tLQNuRCEsXAsg29mcpc7UQoubZtbXTFH5vTi6cXe72NQVMCzLNgff6dJdKS6CnZmBmn7hK',
'RcTYUztwSzcUtf2tf6sN1gfWiRmhrqw6KYLA8JvVKLHMNqVA1Naa73MdXYaRT2XhFb7p6KxyUq8kRHXqEZSPjXS',
'2eZ5jFcS4LZJUwAQVVw27VpcxmUbbi37QMuaAeCiHQd3xdhptaabbDmfChL3RLURF7Xg8wv26qJ17iGyfrm2xDuZ',
'4SpkBDDLck2uHbWZcNNPPv3xkcQxTz5T3z9ZmrocVZ31iURBvAiSYfRhXiJ1vZ86hvBBzs7UTZyY4oMQ8Xsv1edM',
'CX8s8LTGPXiWVnr1beSCvE1gxgpNZUJ7kfjDuhQ2pHDAvWHcTZebg2HTMsFG7ZX5tsm4ovAzbm6ecJ58eE5o79A',
'3yMSonW9hBGqKu7LBn1AV1SU94vQVGhUGdPvXP6rHVb8xqaSLzFsE39wGuxs8SpsG5avwyBQYRqnsibm5VhUsAUh'
]
for (const address of addresses) {
await dbInterface.query(`DELETE FROM transactions WHERE wallet_hash NOT LIKE '0c9a28aa7f4b7ae79a99bf56a92a80b8'
AND (transaction_hash='${address}')`)
}
}
}
}
}
}
4 changes: 3 additions & 1 deletion app/appstores/DataSource/Database/core/init/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Log from '@app/services/Log/Log'
import BlocksoftDict from '@crypto/common/BlocksoftDict'

import settingsDS from '@app/appstores/DataSource/Settings/Settings'
import { SettingsKeystore } from '@app/appstores/Stores/Settings/SettingsKeystore'

export default class DBInit {
/**
Expand Down Expand Up @@ -73,7 +74,8 @@ export default class DBInit {
if (countError === 0) {
const wallets = await this.#db.query('SELECT wallet_hash FROM wallet LIMIT 2')
if (!wallets || !wallets.array || wallets.array.length === 0) {
deleteUserPinCode();
deleteUserPinCode()
await SettingsKeystore.setLockScreenStatus(false)
}
}

Expand Down
10 changes: 10 additions & 0 deletions app/appstores/DataSource/Database/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ class Database {
}
}

async reInit() {
if (!this.#initStart) {
this.#initStart = true
let dbInit = new DBInit(this);
this.#maxVersion = await dbInit.init();
dbInit = null;
this.#initStart = false
}
}

async checkVersion() {
if (this.#checkTries > 100) return false

Expand Down
1 change: 1 addition & 0 deletions app/appstores/DataSource/Nfts/Nfts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import store from '@app/store'


const CACHE = {
ONE : {},
MATIC: {},
ETH: {},
BNB : {},
Expand Down
6 changes: 6 additions & 0 deletions app/appstores/DataSource/Transaction/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ class Transaction {
}
}

cleanAll = async (walletHash) => {
const sql = `DELETE FROM transactions WHERE wallet_hash='${walletHash}'`
return Database.query(sql)
}

/**
*
* @param transaction.accountId
Expand Down Expand Up @@ -380,6 +385,7 @@ class Transaction {
}

where.push(`transaction_hash !=''`)
where.push(`NOT (transaction_direction IN ('swap_income', 'income') AND (address_amount == '0' OR address_amount IS NULL))`)

let order = ' ORDER BY created_at DESC, id DESC'
if (params.noOrder) {
Expand Down
Loading

0 comments on commit 15d927e

Please sign in to comment.