Skip to content

Commit

Permalink
Release 1.0.8
Browse files Browse the repository at this point in the history
Release 1.0.8
  • Loading branch information
estebanmino authored Dec 3, 2020
2 parents af7c39f + 326df28 commit 8d5bec6
Show file tree
Hide file tree
Showing 31 changed files with 101 additions and 48 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Current Develop Branch

## v1.0.8 - Dec 2 2020
- [#2040](https://github.com/MetaMask/metamask-mobile/pull/2040): Update vault error message (#2040)
- [#2034](https://github.com/MetaMask/metamask-mobile/pull/2034): Fix asyncstorage limit (#2034)
- [#2038](https://github.com/MetaMask/metamask-mobile/pull/2038): metamask wc deeplink (#2038)
- [#2023](https://github.com/MetaMask/metamask-mobile/pull/2023): @metamask/contract-metadata (#2023)
- [#2019](https://github.com/MetaMask/metamask-mobile/pull/2019): bugfix/qr code (#2019)
- [#2008](https://github.com/MetaMask/metamask-mobile/pull/2008): Add Apple Pay correct label (#2008)

## v1.0.7 - Nov 17 2020
- [#2005](https://github.com/MetaMask/metamask-mobile/pull/2005): Fix activeTabUrl (#2005)
- [#2003](https://github.com/MetaMask/metamask-mobile/pull/2003): Bugfix/android choose password (#2003)
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 40
versionName "1.0.7"
versionCode 41
versionName "1.0.8"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
Expand Down
11 changes: 11 additions & 0 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import androidx.multidex.MultiDexApplication;

import android.database.CursorWindow;
import java.lang.reflect.Field;

public class MainApplication extends MultiDexApplication implements ShareApplication, ReactApplication {

Expand Down Expand Up @@ -55,6 +57,15 @@ public ReactNativeHost getReactNativeHost() {
@Override
public void onCreate() {
super.onCreate();

try {
Field field = CursorWindow.class.getDeclaredField("sCursorWindowSize");
field.setAccessible(true);
field.set(null, 10 * 1024 * 1024); //the 10MB is the new size
} catch (Exception e) {
e.printStackTrace();
}

if (BuildConfig.DEBUG)
{ WebView.setWebContentsDebuggingEnabled(true); }
SoLoader.init(this, /* native exopackage */ false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ exports[`RemoteImage should render correctly 1`] = `
height="100%"
source={
Object {
"uri": "https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg",
"uri": "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg",
}
}
uri="https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg"
uri="https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg"
width="100%"
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Base/RemoteImage/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('RemoteImage', () => {
const wrapper = shallow(
<RemoteImage
source={{
uri: `https://raw.githubusercontent.com/MetaMask/eth-contract-metadata/master/images/dai.svg`
uri: `https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/dai.svg`
}}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
import { BN, isValidAddress } from 'ethereumjs-util';
import { isENS, safeToChecksumAddress } from '../../../util/address';
import Logger from '../../../util/Logger';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import MessageSign from '../../UI/MessageSign';
import Approve from '../../Views/ApproveView/Approve';
import TransactionTypes from '../../../core/TransactionTypes';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/ApproveTransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getApproveNavbar } from '../../UI/Navbar';
import { colors, fontStyles, baseStyles } from '../../../styles/common';
import { connect } from 'react-redux';
import { getHost } from '../../../util/browser';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import { safeToChecksumAddress, renderShortAddress } from '../../../util/address';
import Engine from '../../../core/Engine';
import { strings } from '../../../../locales/i18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`AssetIcon should render correctly 1`] = `
}
source={
Object {
"uri": "https://raw.githubusercontent.com/metamask/eth-contract-metadata/v1.16.0/images/metamark.svg",
"uri": "https://raw.githubusercontent.com/metamask/contract-metadata/v1.19.0/images/metamark.svg",
}
}
style={
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AssetIcon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ AssetIcon.propTypes = {
*/
logo: PropTypes.string,
/**
* Whether logo has to be fetched from eth-contract-metadata
* Whether logo has to be fetched from @metamask/contract-metadata
*/
watchedAsset: PropTypes.bool,
/**
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/AssetSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TextInput, View, StyleSheet } from 'react-native';
import { colors, fontStyles } from '../../../styles/common';
import PropTypes from 'prop-types';
import { strings } from '../../../../locales/i18n';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import Fuse from 'fuse.js';
import Icon from 'react-native-vector-icons/FontAwesome';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ const getPaymentDetails = (cryptoCurrency, amount, fee, total) => ({
],
total: {
amount: { currency: USD_CURRENCY_CODE, value: `${total}` },
label: 'Wyre'
label: strings('fiat_on_ramp.wyre_total_label')
}
});

Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/PaymentRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { connect } from 'react-redux';
import { colors, fontStyles, baseStyles } from '../../../styles/common';
import { getPaymentRequestOptionsTitle } from '../../UI/Navbar';
import FeatherIcon from 'react-native-vector-icons/Feather';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import Fuse from 'fuse.js';
import AssetList from './AssetList';
import PropTypes from 'prop-types';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TokenImage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { StyleSheet, View } from 'react-native';
import AssetIcon from '../AssetIcon';
import Identicon from '../Identicon';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import { toChecksumAddress } from 'ethereumjs-util';

const styles = StyleSheet.create({
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Tokens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TokenImage from '../TokenImage';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { colors, fontStyles } from '../../../styles/common';
import { strings } from '../../../../locales/i18n';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import ActionSheet from 'react-native-actionsheet';
import { renderFromTokenMinimalUnit, balanceToFiat } from '../../../util/number';
import Engine from '../../../core/Engine';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TransactionEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getBasicGasEstimates, apiEstimateModifiedToWEI } from '../../../util/cu
import { setTransactionObject } from '../../../actions/transaction';
import Engine from '../../../core/Engine';
import collectiblesTransferInformation from '../../../util/collectibles-transfer';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import PaymentChannelsClient from '../../../core/PaymentChannelsClient';
import { safeToChecksumAddress } from '../../../util/address';
import TransactionTypes from '../../../core/TransactionTypes';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TransactionElement/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
getActionKey,
TRANSACTION_TYPES
} from '../../../util/transactions';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import { toChecksumAddress } from 'ethereumjs-util';

const {
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/TransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '../../../util/number';
import { safeToChecksumAddress } from '../../../util/address';
import Device from '../../../util/Device';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import DefaultTabBar from 'react-native-scrollable-tab-view/DefaultTabBar';
import TransactionReviewInformation from './TransactionReviewInformation';
import TransactionReviewSummary from './TransactionReviewSummary';
Expand Down
28 changes: 17 additions & 11 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1059,12 +1059,10 @@ export const BrowserTab = props => {

props.updateTabInfo(getMaskedUrl(siteInfo.url), props.id);

if (type !== 'start') {
props.addToBrowserHistory({
name: siteInfo.title,
url: getMaskedUrl(siteInfo.url)
});
}
props.addToBrowserHistory({
name: siteInfo.title,
url: getMaskedUrl(siteInfo.url)
});
};

/**
Expand Down Expand Up @@ -1187,6 +1185,7 @@ export const BrowserTab = props => {
* When website finished loading
*/
const onLoadEnd = ({ nativeEvent }) => {
if (nativeEvent.loading) return;
const { current } = webviewRef;

current && current.injectJavaScript(JS_WEBVIEW_URL);
Expand All @@ -1197,7 +1196,9 @@ export const BrowserTab = props => {
const promise = current ? new Promise(promiseResolver) : Promise.resolve(url.current);

promise.then(info => {
if (info.url === nativeEvent.url) {
const { hostname: currentHostname } = new URL(url.current);
const { hostname } = new URL(nativeEvent.url);
if (info.url === nativeEvent.url && currentHostname === hostname) {
changeUrl({ ...nativeEvent, icon: info.icon }, 'end-promise');
}
});
Expand All @@ -1206,7 +1207,9 @@ export const BrowserTab = props => {
/**
* Handle message from website
*/
const onMessage = ({ nativeEvent: { data } }) => {
const onMessage = ({ nativeEvent }) => {
let data = nativeEvent.data;

try {
data = typeof data === 'string' ? JSON.parse(data) : data;
if (!data || (!data.type && !data.name)) {
Expand All @@ -1232,9 +1235,12 @@ export const BrowserTab = props => {
onFrameLoadStarted(url);
break;
}*/
case 'GET_WEBVIEW_URL':
webviewUrlPostMessagePromiseResolve.current &&
webviewUrlPostMessagePromiseResolve.current(data.payload);
case 'GET_WEBVIEW_URL': {
const { url } = data.payload;
if (url === nativeEvent.url)
webviewUrlPostMessagePromiseResolve.current &&
webviewUrlPostMessagePromiseResolve.current(data.payload);
}
}
} catch (e) {
Logger.error(e, `Browser::onMessage on ${url.current}`);
Expand Down
9 changes: 9 additions & 0 deletions app/components/Views/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ const styles = StyleSheet.create({
}
});

/* TODO: we should have translation strings for these */
const PASSCODE_NOT_SET_ERROR = 'Error: Passcode not set.';
const WRONG_PASSWORD_ERROR = 'Error: Decrypt failed';
const WRONG_PASSWORD_ERROR_ANDROID = 'Error: error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT';
const VAULT_ERROR = 'Error: Cannot unlock without a previous vault.';
const CLEAN_VAULT_ERROR =
'MetaMask encountered an error due to reaching a storage limit. The local data has been corrupted. Please reinstall MetaMask and restore with your seed phrase.';

/**
* View where returning users can authenticate
Expand Down Expand Up @@ -234,6 +238,11 @@ class Login extends PureComponent {
'In order to proceed, you need to turn Passcode on or any biometrics authentication method supported in your device (FaceID, TouchID or Fingerprint)'
);
this.setState({ loading: false });
} else if (error.toLowerCase() === VAULT_ERROR.toLowerCase()) {
this.setState({
loading: false,
error: CLEAN_VAULT_ERROR
});
} else {
this.setState({ loading: false, error });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
import { renderAccountName } from '../../../../util/address';
import Identicon from '../../../UI/Identicon';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import AssetIcon from '../../../UI/AssetIcon';
import { getTicker } from '../../../../util/transactions';
import Device from '../../../../util/Device';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/Send/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { resetTransaction, setTransactionObject } from '../../../actions/transac
import { toggleDappTransactionModal } from '../../../actions/modals';
import NotificationManager from '../../../core/NotificationManager';
import NetworkList, { getNetworkTypeById } from '../../../util/networks';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import { showAlert } from '../../../actions/alert';
import Analytics from '../../../core/Analytics';
import { ANALYTICS_EVENT_OPTS } from '../../../util/analytics';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Views/TransactionDirection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { colors, fontStyles } from '../../../styles/common';
import { connect } from 'react-redux';
import { safeToChecksumAddress, renderAccountName } from '../../../util/address';
import { getNormalizedTxState } from '../../../util/transactions';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
import Identicon from '../../UI/Identicon';
import { strings } from '../../../../locales/i18n';
Expand Down
20 changes: 16 additions & 4 deletions app/core/DeeplinkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,20 @@ class DeeplinkManager {
}

const functionName = ethUrl.function_name;
if (!functionName || functionName === 'transfer') {
if (!functionName) {
const txMeta = { ...ethUrl, source: url };
if (ethUrl.parameters?.value || ethUrl.parameters?.uint256) {
if (ethUrl.parameters?.value) {
this.navigation.navigate('SendView', {
txMeta: { ...txMeta, action: !functionName ? 'send-eth' : 'send-token' }
txMeta: { ...txMeta, action: 'send-eth' }
});
} else {
this.navigation.navigate('SendFlowView', { txMeta });
}
} else if (functionName === 'transfer') {
const txMeta = { ...ethUrl, source: url };
this.navigation.navigate('SendView', {
txMeta: { ...txMeta, action: 'send-token' }
});
} else if (functionName === 'approve') {
// add approve transaction
const {
Expand Down Expand Up @@ -92,7 +97,6 @@ class DeeplinkManager {
const handled = () => onHandled?.();

const { MM_UNIVERSAL_LINK_HOST } = AppConstants;

switch (urlObj.protocol.replace(':', '')) {
case 'http':
case 'https':
Expand Down Expand Up @@ -170,6 +174,14 @@ class DeeplinkManager {
// For ex. go to settings
case 'metamask':
handled();
if (urlObj.origin === 'metamask://wc') {
const cleanUrlObj = new URL(urlObj.query.replace('?uri=', ''));
const href = cleanUrlObj.href;
if (!WalletConnect.isValidUri(href)) return;
const redirect = params && params.redirect;
const autosign = params && params.autosign;
WalletConnect.newSession(href, redirect, autosign);
}
break;
default:
return false;
Expand Down
2 changes: 1 addition & 1 deletion app/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import AppConstants from './AppConstants';
import { store } from '../store';
import { renderFromTokenMinimalUnit, balanceToFiatNumber, weiToFiatNumber } from '../util/number';
import NotificationManager from './NotificationManager';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import Logger from '../util/Logger';
import { LAST_INCOMING_TX_BLOCK_INFO } from '../constants/storage';

Expand Down
6 changes: 3 additions & 3 deletions app/util/assets.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Utility function to return corresponding eth-contract-metadata logo
* Utility function to return corresponding @metamask/contract-metadata logo
*
* @param {string} logo - Logo path from eth-contract-metadata
* @param {string} logo - Logo path from @metamask/contract-metadata
*/
export default function getAssetLogoPath(logo) {
if (!logo) return;
const path = 'https://raw.githubusercontent.com/metamask/eth-contract-metadata/v1.16.0/images/';
const path = 'https://raw.githubusercontent.com/metamask/contract-metadata/v1.19.0/images/';
const uri = path + logo;
return uri;
}
2 changes: 1 addition & 1 deletion app/util/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { addHexPrefix, toChecksumAddress, BN } from 'ethereumjs-util';
import { rawEncode, rawDecode } from 'ethereumjs-abi';
import Engine from '../core/Engine';
import { strings } from '../../locales/i18n';
import contractMap from 'eth-contract-metadata';
import contractMap from '@metamask/contract-metadata';
import { safeToChecksumAddress } from './address';
import { util } from '@metamask/controllers';
import { hexToBN } from './number';
Expand Down
Loading

0 comments on commit 8d5bec6

Please sign in to comment.