Skip to content

Commit

Permalink
Fix linux icon
Browse files Browse the repository at this point in the history
  • Loading branch information
gavingaozhangmin committed Jul 28, 2023
1 parent 516776e commit d415874
Show file tree
Hide file tree
Showing 13 changed files with 61,734 additions and 23 deletions.
13 changes: 7 additions & 6 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"files": [ "dist" ],
"extraResources": [
{ "from": "./static/engine/aria2.conf", "to": "./engine/aria2.conf"},
{ "from": "./static/engine/ads_block.txt", "to": "./engine/ads_block.txt"},
{ "from": "./static/crx", "to": "./crx"},
{ "from": "./public/images/qrcode_1280.jpg", "to": "./images/qrcode_1280.jpg"},
{ "from": "./static/images/icon_24.png", "to": "./images/icon_24.png"},
{ "from": "./static/images/icon_64.png", "to": "./images/icon_64.png"},
{ "from": "./static/images/icon_256.png", "to": "./images/icon_256.png"}
{ "from": "./static/images/icon_24x24.png", "to": "./images/icon_24x24.png"},
{ "from": "./static/images/icon_64x64.png", "to": "./images/icon_64x64.png"},
{ "from": "./static/images/icon_256x256.png", "to": "./images/icon_256x256.png"}
],
"mac": {
"icon": "./static/images/icon.icns",
Expand All @@ -30,7 +31,7 @@
]
},
"linux": {
"icon": "./static/images/icon_256.png",
"icon": "./static/images/icon_256x256.png",
"category": "Network",
"artifactName": "XBYDriver-${version}-linux-${arch}.${ext}",
"extraResources": [
Expand All @@ -42,12 +43,12 @@
]
},
"win": {
"icon": "./static/images/icon_256.ico",
"icon": "./static/images/icon_256x256.ico",
"artifactName": "XBYDriver-${version}-win-${arch}.${ext}",
"requestedExecutionLevel": "asInvoker",
"extraResources": [
{ "from": "./static/engine/win32/${arch}", "to": "./engine"},
{ "from": "./static/images/icon_256.ico", "to": "./images/icon_256.ico"}
{ "from": "./static/images/icon_256x256.ico", "to": "./images/icon_256x256.ico"}
],
"target": [
{ "target": "nsis", "arch": [ "x64", "ia32" ] }
Expand Down
2 changes: 1 addition & 1 deletion electron/main/core/ipcEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export default class ipcEvent {
center: true,
minWidth: 680,
minHeight: 500,
icon: getStaticPath('icon_256.ico'),
icon: getStaticPath('icon_256x256.ico'),
useContentSize: true,
frame: true,
hasShadow: true,
Expand Down
9 changes: 7 additions & 2 deletions electron/main/core/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getAsarPath, getResourcesPath, getStaticPath, getUserDataPath } from '.
import fs, { existsSync, readFileSync, writeFileSync } from 'fs'
import is from 'electron-is'
import { ShowErrorAndRelaunch } from './dialog'
import { ElectronBlocker } from '@cliqz/adblocker-electron';
import path from 'path'

export const ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.33'
Expand Down Expand Up @@ -195,7 +196,7 @@ export function createTray() {
}
]

const icon = getStaticPath('icon_256.ico')
const icon = getStaticPath('icon_256x256.ico')
AppWindow.appTray = new Tray(icon)
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate)
AppWindow.appTray.setToolTip('阿里云盘小白羊')
Expand All @@ -219,7 +220,7 @@ export function createElectronWindow(width: number, height: number, center: bool
minWidth: width > 680 ? 680 : width,
minHeight: height > 500 ? 500 : height,
center: center,
icon: getStaticPath('icon_256.ico'),
icon: getStaticPath('icon_256x256.ico'),
useContentSize: true,
frame: false,
transparent: false,
Expand All @@ -242,6 +243,10 @@ export function createElectronWindow(width: number, height: number, center: bool
preload: getAsarPath('dist/electron/preload/index.js')
}
})
const adsRulePath: string = path.join(getStaticPath('engine'), 'ads_block.txt')
const blocker =
ElectronBlocker.parse(fs.readFileSync(adsRulePath, 'utf-8'));
blocker.enableBlockingInSession(session.defaultSession);

win.removeMenu()
if (is.dev()) {
Expand Down
2 changes: 1 addition & 1 deletion electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app.setAboutPanelOptions({
applicationName: '小白羊云盘',
copyright: 'Zhangmin Gao',
website: 'https://github.com/gaozhangmin/aliyunpan',
iconPath: getStaticPath('icon_64.png'),
iconPath: getStaticPath('icon_64x64.png'),
applicationVersion: '30'
})

Expand Down
4 changes: 2 additions & 2 deletions electron/main/utils/mainfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export function getStaticPath(fileName: string) {
let basePath = path.resolve(app.getAppPath(), '..')
if (is.dev()) basePath = path.resolve(app.getAppPath(), './static')
if (fileName.startsWith('icon')) {
if (fileName == 'icon_256.ico' && !is.windows()) {
fileName = path.join('images', 'icon_24.png')
if (fileName == 'icon_256x256.ico' && !is.windows()) {
fileName = path.join('images', 'icon_24x24.png')
} else {
fileName = path.join('images', fileName)
}
Expand Down
4 changes: 2 additions & 2 deletions src/aliapi/alihttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ export default class AliHttp {
}

static async isVip(phone:string): Promise<boolean> {
const url = `https://eu-central-1.data.tidbcloud.com/api/v1beta/app/dataapp-DlZtOYDl/endpoint/v1/orders?userId=${phone}`;
const client = new DigestClient('gGXrSK30', '4c4468a9-0fd6-497e-87e3-b77eb2f71e68')
const url = `https://eu-central-1.data.tidbcloud.com/api/v1beta/app/dataapp-DlZtOYDl/endpoint/v2/orders?userId=${phone}`;
const client = new DigestClient('1fHUXx2d', '49bd6bfc-2dc1-41ac-90c0-5040dbd106b7')

const response = await client.fetch(url, {})
if (AliHttp.IsSuccess(response.status)) {
Expand Down
6 changes: 1 addition & 5 deletions src/resource/searchIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ export default {
// @ts-ignore
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
const intervalId = setInterval(() => {
const element = iframeDocument.querySelector('._76lauz9 ')
if (element) {
element.click()
}
const element2 = iframeDocument.querySelector('._ntlgt3m ')
const element2 = iframeDocument.querySelector('div._4zmcr4t')
if (element2) {
element2.click()
}
Expand Down
7 changes: 3 additions & 4 deletions src/user/UserLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default defineComponent({
setup() {
const handleOpen = () => {
setTimeout(() => {
const webview = document.getElementById('loginiframe') as any
let webview = document.getElementById('loginiframe') as any
if (!webview) {
message.error('严重错误:无法打开登录弹窗,请退出小白羊后重新运行')
return
Expand Down Expand Up @@ -85,13 +85,12 @@ export default defineComponent({
const codeStatusUrl = qrCodeUrl + '/status'
const qrCodeStatus = document.getElementById('qr-code-status') as any
webview.stop()
document.getElementById('loginiframe').loadURL(qrCodeUrl)
console.log("load qr code url: ", qrCodeUrl)
webview = document.getElementById('loginiframe') as any
webview.loadURL(qrCodeUrl)
webview.addEventListener('did-stop-loading', () => {
const loading = document.getElementById('loginframedivloading')
if (loading) loading.parentNode!.removeChild(loading)
document.getElementById('loginframediverror')!.style.display = 'none'
console.log("load qr code url1: ", qrCodeUrl)
// Start polling QR code status
const intervalId = setInterval(async () => {
Expand Down
Loading

0 comments on commit d415874

Please sign in to comment.