Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.2.21 #368

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/helpers/identifiers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { machineId } from 'node-machine-id';
import { settingsStorage } from './storageHelper';

export async function getMachineId() {
const settings = settingsStorage.getItems(['machineId']);

if (!settings?.machineId) {
const _machineId = await machineId();

settingsStorage.setItems({
machineId: _machineId,
});

return _machineId;
}

return settings.machineId;
}
4 changes: 2 additions & 2 deletions app/services/analytics/mixpanelAnalytics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isObject } from 'nice-utils';
import mixpanel from 'mixpanel-browser';
import { machineId } from 'node-machine-id';
import { release } from 'os';
import { log } from '../../utils/log';
import { isEmpty } from '../../utils/funcs';
Expand All @@ -15,6 +14,7 @@ import { unixTimestampNow } from '../../utils/date';
import { getCurrentWindowHash } from '../../helpers/windowHelper';
import { getPlatform } from '../../utils/getPlatform';
import { APP_VERSION } from '../../constants/meta';
import { getMachineId } from '../../helpers/identifiers';

export class MixpanelAnalytics {
constructor() {
Expand Down Expand Up @@ -48,7 +48,7 @@ export class MixpanelAnalytics {
}

// this is a hashed value (sha-256)
this.machineId = await machineId();
this.machineId = await getMachineId();

if (ENV_FLAVOR.enableMixpanelAnalytics) {
mixpanel.init(SERVICE_KEYS.mixpanelAnalytics);
Expand Down
4 changes: 2 additions & 2 deletions app/services/sentry/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as Sentry from '@sentry/electron';
import { machineId } from 'node-machine-id';
import { ENV_FLAVOR } from '../../constants/env';
import { SERVICE_KEYS } from '../../constants/serviceKeys';
import { getDeviceInfo } from '../../helpers/deviceInfo';
import { isEmpty } from '../../utils/funcs';
import { pkginfo } from '../../utils/pkginfo';
import { checkIf } from '../../utils/checkIf';
import { MTP_MODE } from '../../enums';
import { getMachineId } from '../../helpers/identifiers';

class SentryService {
constructor() {
Expand All @@ -25,7 +25,7 @@ class SentryService {
release: pkginfo.version,
});

this.machineId = await machineId();
this.machineId = await getMachineId();
}

async report({ error, title, mtpMode }) {
Expand Down
4 changes: 2 additions & 2 deletions app/utils/log.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import clp from 'console-log-plus';
import os, { EOL } from 'os';
import { machineId } from 'node-machine-id';
import { IS_PROD } from '../constants/env';
import { APP_NAME, APP_VERSION } from '../constants/meta';
import { PATHS } from '../constants/paths';
Expand All @@ -12,6 +11,7 @@ import { isEmpty } from './funcs';
import { getMtpModeSetting } from '../helpers/settings';
import { redactHomeDirectory } from '../helpers/logs';
import { isConsoleError } from './errors';
import { getMachineId } from '../helpers/identifiers';

const { logFile } = PATHS;

Expand Down Expand Up @@ -121,7 +121,7 @@ export const log = {
let _deviceInfoStrigified = '';
const deviceInfo = getDeviceInfo();
const mtpMode = getMtpModeSetting();
const uuid = await machineId();
const uuid = await getMachineId();

if (!isEmpty(deviceInfo)) {
Object.keys(deviceInfo).forEach((a) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openmtp",
"productName": "OpenMTP",
"version": "3.2.20",
"version": "3.2.21",
"description": "OpenMTP | Android File Transfer for macOS",
"scripts": {
"build": "yarn lint && concurrently \"yarn build-main\" \"yarn build-renderer\"",
Expand Down
3 changes: 3 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
APPLEID="<value>"
APPLE_APP_SPECIFIC_PASSWORD="<value>"
APPLE_TEAM_ID="<value>"
Loading