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

fix: some fix #1408

Merged
merged 7 commits into from
Mar 29, 2023
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
25 changes: 16 additions & 9 deletions build/afterSignHook.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require('dotenv').config()
const { notarize } = require('electron-notarize')
const { join } = require('path');
const { notarize } = require('@electron/notarize')
const { appId } = require('../electron-builder.json')

exports.default = async function (context) {
Expand All @@ -10,18 +11,24 @@ exports.default = async function (context) {

const skipNotarize = process.env.SKIP_NOTARIZE
if (skipNotarize === 'true') {
console.log('skipping notarize')
console.log('Skipping notarize')
return
}

const appBundleId = appId
const appName = context.packager.appInfo.productFilename
const appPath = join(appOutDir, `${appName}.app`);

return await notarize({
appBundleId,
appPath: `${appOutDir}/${appName}.app`,
ascProvider: process.env.TEAM_ID,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PWD
})
try {
await notarize({
appBundleId,
appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD
})
} catch (error) {
console.error(error);
}

console.log(`Done notarizing ${appId}`);
}
2 changes: 1 addition & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"productName": "Motrix",
"appId": "app.motrix.desktop",
"afterPack": "./build/afterPackHook.js",
"afterSign": "electron-builder-notarize",
"afterSign": "./build/afterSignHook.js",
"fileAssociations": [
{
"ext": "torrent",
Expand Down
6 changes: 3 additions & 3 deletions extra/darwin/arm64/engine/aria2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ max-tries=5
# aria2 does not split less than 2*SIZE byte range.
min-split-size=1M
# Set user agent for HTTP(S) downloads.
user-agent=Transmission/2.94
user-agent=Transmission/3.00
# Send Accept: deflate, gzip request header
http-accept-gzip=true

Expand Down Expand Up @@ -70,6 +70,6 @@ enable-dht6=true
# Enable Peer Exchange extension.
enable-peer-exchange=true
# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
peer-agent=Transmission/3.00
# Specify the prefix of peer ID.
peer-id-prefix=-TR2940-
peer-id-prefix=-TR3000-
4 changes: 2 additions & 2 deletions extra/darwin/x64/engine/aria2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ max-tries=5
# aria2 does not split less than 2*SIZE byte range.
min-split-size=1M
# Set user agent for HTTP(S) downloads.
user-agent=Transmission/2.94
user-agent=Transmission/3.00
# Send Accept: deflate, gzip request header
http-accept-gzip=true

Expand Down Expand Up @@ -70,6 +70,6 @@ enable-dht6=true
# Enable Peer Exchange extension.
enable-peer-exchange=true
# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
peer-agent=Transmission/3.00
# Specify the prefix of peer ID.
peer-id-prefix=-TR2940-
4 changes: 2 additions & 2 deletions extra/linux/engine/aria2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ max-tries=5
# aria2 does not split less than 2*SIZE byte range.
min-split-size=1M
# Set user agent for HTTP(S) downloads.
user-agent=Transmission/2.94
user-agent=Transmission/3.00
# Send Accept: deflate, gzip request header
http-accept-gzip=true

Expand Down Expand Up @@ -70,6 +70,6 @@ enable-dht6=true
# Enable Peer Exchange extension.
enable-peer-exchange=true
# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
peer-agent=Transmission/3.00
# Specify the prefix of peer ID.
peer-id-prefix=-TR2940-
4 changes: 2 additions & 2 deletions extra/win32/ia32/engine/aria2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ max-tries=5
# aria2 does not split less than 2*SIZE byte range.
min-split-size=1M
# Set user agent for HTTP(S) downloads.
user-agent=Transmission/2.94
user-agent=Transmission/3.00
# Send Accept: deflate, gzip request header
http-accept-gzip=true

Expand Down Expand Up @@ -70,6 +70,6 @@ enable-dht6=true
# Enable Peer Exchange extension.
enable-peer-exchange=true
# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
peer-agent=Transmission/3.00
# Specify the prefix of peer ID.
peer-id-prefix=-TR2940-
4 changes: 2 additions & 2 deletions extra/win32/x64/engine/aria2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ max-tries=5
# aria2 does not split less than 2*SIZE byte range.
min-split-size=1M
# Set user agent for HTTP(S) downloads.
user-agent=Transmission/2.94
user-agent=Transmission/3.00
# Send Accept: deflate, gzip request header
http-accept-gzip=true

Expand Down Expand Up @@ -70,6 +70,6 @@ enable-dht6=true
# Enable Peer Exchange extension.
enable-peer-exchange=true
# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
peer-agent=Transmission/3.00
# Specify the prefix of peer ID.
peer-id-prefix=-TR2940-
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Motrix",
"version": "1.7.0",
"version": "1.7.2",
"description": "A full-featured download manager",
"homepage": "https://motrix.app",
"author": {
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@babel/runtime": "^7.21.0",
"@motrix/nat-api": "^0.3.2",
"@motrix/nat-api": "^0.3.3",
"@panter/vue-i18next": "^0.15.2",
"axios": "^1.3.4",
"bittorrent-peerid": "^1.3.6",
Expand Down Expand Up @@ -63,6 +63,8 @@
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/register": "^7.21.0",
"@electron/notarize": "^1.2.3",
"@electron/osx-sign": "^1.0.4",
"@electron/remote": "^2.0.9",
"@motrix/multispinner": "^0.2.2",
"@vue/eslint-config-standard": "^6.1.0",
Expand All @@ -79,10 +81,7 @@
"del": "^6.1.1",
"electron": "^22.3.3",
"electron-builder": "^23.6.0",
"electron-builder-notarize": "^1.5.1",
"electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.2.1",
"electron-osx-sign": "^0.6.0",
"eslint": "^7.32.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.27.5",
Expand Down
2 changes: 1 addition & 1 deletion src/main/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default class Application extends EventEmitter {
try {
await Promise.allSettled(promises)
} catch (e) {
logger.warn('[Motrix] start UPnP mapping fail', e)
logger.warn('[Motrix] start UPnP mapping fail', e.message)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/core/ConfigManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class ConfigManager {
'seed-ratio': 1,
'seed-time': 60,
'split': getMaxConnectionPerServer(),
'user-agent': 'Transmission/2.94'
'user-agent': 'Transmission/3.00'
}
/* eslint-enable quote-props */
})
Expand Down
2 changes: 1 addition & 1 deletion src/main/core/UPnPManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class UPnPManager {
try {
client.map(port, (err) => {
if (err) {
logger.warn(`[Motrix] UPnPManager map ${port} failed, error: `, err)
logger.warn(`[Motrix] UPnPManager map ${port} failed, error: `, err.message)
reject(err.message)
return
}
Expand Down
14 changes: 8 additions & 6 deletions src/main/ui/DockManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
APP_RUN_MODE
} from '@shared/constants'

const isMac = is.macOS()
const enabled = is.macOS()

export default class DockManager extends EventEmitter {
constructor (options) {
Expand All @@ -20,7 +20,7 @@ export default class DockManager extends EventEmitter {
}
}

show = isMac
show = enabled
? () => {
if (app.dock.isVisible()) {
return
Expand All @@ -30,7 +30,7 @@ export default class DockManager extends EventEmitter {
}
: () => {}

hide = isMac
hide = enabled
? () => {
if (!app.dock.isVisible()) {
return
Expand All @@ -40,21 +40,23 @@ export default class DockManager extends EventEmitter {
}
: () => {}

setBadge = isMac
// macOS setBadge not working
// @see https://github.com/electron/electron/issues/25745#issuecomment-702826143
setBadge = enabled
? (text) => {
app.dock.setBadge(text)
}
: (text) => {}

handleSpeedChange = isMac
handleSpeedChange = enabled
? (speed) => {
const { downloadSpeed } = speed
const text = downloadSpeed > 0 ? `${bytesToSize(downloadSpeed)}/s` : ''
this.setBadge(text)
}
: (text) => {}

openDock = isMac
openDock = enabled
? (path) => {
app.dock.downloadFinished(path)
}
Expand Down
16 changes: 8 additions & 8 deletions src/shared/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export const NGOSANG_TRACKERS_BEST_IP_URL = 'https://raw.githubusercontent.com/n
export const NGOSANG_TRACKERS_ALL_URL = 'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt'
export const NGOSANG_TRACKERS_ALL_IP_URL = 'https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_ip.txt'

export const NGOSANG_TRACKERS_BEST_URL_CDN = 'https://cdn.jsdelivr.net/gh/ngosang/trackerslist/trackers_best.txt'
export const NGOSANG_TRACKERS_BEST_IP_URL_CDN = 'https://cdn.jsdelivr.net/gh/ngosang/trackerslist/trackers_best_ip.txt'
export const NGOSANG_TRACKERS_ALL_URL_CDN = 'https://cdn.jsdelivr.net/gh/ngosang/trackerslist/trackers_all.txt'
export const NGOSANG_TRACKERS_ALL_IP_URL_CDN = 'https://cdn.jsdelivr.net/gh/ngosang/trackerslist/trackers_all_ip.txt'
export const NGOSANG_TRACKERS_BEST_URL_CDN = 'https://fastly.jsdelivr.net/gh/ngosang/trackerslist/trackers_best.txt'
export const NGOSANG_TRACKERS_BEST_IP_URL_CDN = 'https://fastly.jsdelivr.net/gh/ngosang/trackerslist/trackers_best_ip.txt'
export const NGOSANG_TRACKERS_ALL_URL_CDN = 'https://fastly.jsdelivr.net/gh/ngosang/trackerslist/trackers_all.txt'
export const NGOSANG_TRACKERS_ALL_IP_URL_CDN = 'https://fastly.jsdelivr.net/gh/ngosang/trackerslist/trackers_all_ip.txt'

/**
* @see https://github.com/XIU2/TrackersListCollection
Expand All @@ -66,12 +66,12 @@ export const XIU2_TRACKERS_BEST_URL = 'https://raw.githubusercontent.com/XIU2/Tr
export const XIU2_TRACKERS_ALL_URL = 'https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/all.txt'
export const XIU2_TRACKERS_HTTP_URL = 'https://raw.githubusercontent.com/XIU2/TrackersListCollection/master/http.txt'

export const XIU2_TRACKERS_BEST_URL_CDN = 'https://cdn.jsdelivr.net/gh/XIU2/TrackersListCollection/best.txt'
export const XIU2_TRACKERS_ALL_URL_CDN = 'https://cdn.jsdelivr.net/gh/XIU2/TrackersListCollection/all.txt'
export const XIU2_TRACKERS_HTTP_URL_CDN = 'https://cdn.jsdelivr.net/gh/XIU2/TrackersListCollection/http.txt'
export const XIU2_TRACKERS_BEST_URL_CDN = 'https://fastly.jsdelivr.net/gh/XIU2/TrackersListCollection/best.txt'
export const XIU2_TRACKERS_ALL_URL_CDN = 'https://fastly.jsdelivr.net/gh/XIU2/TrackersListCollection/all.txt'
export const XIU2_TRACKERS_HTTP_URL_CDN = 'https://fastly.jsdelivr.net/gh/XIU2/TrackersListCollection/http.txt'

// For bt-exclude-tracker
export const XIU2_TRACKERS_BLACK_URL = 'https://cdn.jsdelivr.net/gh/XIU2/TrackersListCollection/blacklist.txt'
export const XIU2_TRACKERS_BLACK_URL = 'https://fastly.jsdelivr.net/gh/XIU2/TrackersListCollection/blacklist.txt'

export const trackerSourceOptions = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/locales/en-US/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default {
'bt-download-complete-message': 'Completed downloading {{taskName}}, seeding',
'bt-download-complete-notify': 'BT Download Completed, seeding...',
'bt-download-complete-tips': 'Tips: You can stop a task to end its seeding',
'bt-stopping-seeding-tip': 'Stopping seeding, it will take some time to disconnect, please wait...',
'bt-stopping-seeding-tip': 'Stopping seeding, it will take some time to disconnect, please wait patiently',
'download-fail-message': 'Failed to download {{taskName}}',
'download-fail-notify': 'Download Failed'
}
6 changes: 3 additions & 3 deletions src/shared/ua.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
aria2: 'aria2/1.35.0',
transmission: 'Transmission/2.94',
chrome: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36',
aria2: 'aria2/1.36.0',
transmission: 'Transmission/3.00',
chrome: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
du: 'netdisk;6.0.0.12;PC;PC-Windows;10.0.16299;WindowsBaiduYunGuanJia'
}
Loading