OPS: remove amplitude tracking (yay privacy\!)

This commit is contained in:
Overtorment 2021-08-12 14:09:32 +01:00
parent 8a73925c40
commit 9db381bcf9
4 changed files with 2 additions and 81 deletions

View File

@ -1,7 +1,5 @@
import * as Sentry from '@sentry/react-native';
import amplitude from 'amplitude-js';
import { getVersion, getSystemName, getUniqueId } from 'react-native-device-info';
import { Platform } from 'react-native';
import { getUniqueId } from 'react-native-device-info';
const BlueApp = require('../BlueApp');
if (process.env.NODE_ENV !== 'development') {
@ -11,25 +9,11 @@ if (process.env.NODE_ENV !== 'development') {
Sentry.setUser({ id: getUniqueId() });
}
amplitude.getInstance().init('8b7cf19e8eea3cdcf16340f5fbf16330', null, {
useNativeDeviceInfo: true,
platform: getSystemName().toLocaleLowerCase().includes('mac') ? getSystemName() : Platform.OS,
});
amplitude.getInstance().setVersionName(getVersion());
amplitude.getInstance().options.apiEndpoint = 'api2.amplitude.com';
BlueApp.isDoNotTrackEnabled().then(value => {
if (value) Sentry.close();
amplitude.getInstance().setOptOut(value);
});
const A = async event => {
console.log('posting analytics...', event);
try {
amplitude.getInstance().logEvent(event);
} catch (err) {
console.log(err);
}
};
const A = async event => {};
A.ENUM = {
INIT: 'INIT',
@ -43,7 +27,6 @@ A.ENUM = {
A.setOptOut = value => {
if (value) Sentry.close();
return amplitude.getInstance().setOptOut(value);
};
module.exports = A;

52
package-lock.json generated
View File

@ -4,25 +4,6 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@amplitude/types": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/@amplitude/types/-/types-1.5.4.tgz",
"integrity": "sha512-+e+wqlO5E4lNTM19lATf+lJldV+VD2RGzrDEy45cPEtfpXxHJUHwhfOKZkKg/zlx+YAubcpNhWLm2NSPpHUs9A=="
},
"@amplitude/ua-parser-js": {
"version": "0.7.24",
"resolved": "https://registry.npmjs.org/@amplitude/ua-parser-js/-/ua-parser-js-0.7.24.tgz",
"integrity": "sha512-VbQuJymJ20WEw0HtI2np7EdC3NJGUWi8+Xdbc7uk8WfMIF308T0howpzkQ3JFMN7ejnrcSM/OyNGveeE3TP3TA=="
},
"@amplitude/utils": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/@amplitude/utils/-/utils-1.5.4.tgz",
"integrity": "sha512-VAd/ibhwBBeL8pKqCz8tjCnSx8epOvUa+Je6sA3AB4R8855xl+bdrDjYwMmOWOILvEH3Pltq2jVJCE2thBoFdQ==",
"requires": {
"@amplitude/types": "^1.5.4",
"tslib": "^1.9.3"
}
},
"@apocentre/alias-sampling": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/@apocentre/alias-sampling/-/alias-sampling-0.5.3.tgz",
@ -4452,34 +4433,6 @@
"uri-js": "^4.2.2"
}
},
"amplitude-js": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/amplitude-js/-/amplitude-js-7.4.4.tgz",
"integrity": "sha512-3Ojj1draRcXvfxi5P+Ye/6Y4roxtf1lQEjczcLDnHU9vxbPtT4fDblC9+cdJy7XmlJkGoq+KvnItlWfLuHV9GQ==",
"requires": {
"@amplitude/ua-parser-js": "0.7.24",
"@amplitude/utils": "^1.0.5",
"blueimp-md5": "^2.10.0",
"query-string": "5"
},
"dependencies": {
"query-string": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz",
"integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==",
"requires": {
"decode-uri-component": "^0.2.0",
"object-assign": "^4.1.0",
"strict-uri-encode": "^1.0.0"
}
},
"strict-uri-encode": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM="
}
}
},
"anser": {
"version": "1.4.10",
"resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz",
@ -5821,11 +5774,6 @@
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
},
"blueimp-md5": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.18.0.tgz",
"integrity": "sha512-vE52okJvzsVWhcgUHOv+69OG3Mdg151xyn41aVQN/5W5S+S43qZhxECtYLAEHMSFWX6Mv5IZrzj3T5+JqXfj5Q=="
},
"bn.js": {
"version": "4.12.0",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",

View File

@ -108,7 +108,6 @@
"@remobile/react-native-qrcode-local-image": "https://github.com/BlueWallet/react-native-qrcode-local-image",
"@sentry/react-native": "2.6.0",
"aez": "1.0.1",
"amplitude-js": "7.4.4",
"assert": "2.0.0",
"base-x": "3.0.8",
"bc-bech32": "file:blue_modules/bc-bech32",

View File

@ -8,15 +8,6 @@ import * as BlueElectrum from '../../blue_modules/BlueElectrum';
jest.mock('react-native-qrcode-svg', () => 'Video');
jest.mock('amplitude-js', () => ({
getInstance: function () {
return {
init: jest.fn(),
logEvent: jest.fn(),
};
},
}));
beforeAll(async () => {
// awaiting for Electrum to be connected. For RN Electrum would naturally connect
// while app starts up, but for tests we need to wait for it