From 81d0f745ce8636956f6950dca290326c6f859e79 Mon Sep 17 00:00:00 2001 From: Yuuto <55290516+JustYuuto@users.noreply.github.com> Date: Wed, 28 Aug 2024 02:11:31 +0200 Subject: [PATCH] 1.2.8 --- CHANGELOG.md | 6 + package.json | 6 +- src/functions.ts | 39 +- src/index.ts | 17 +- src/prompt.html | 97 - src/prompt.js | 5 - src/react-devtools/build/background.js | 272 - .../build/importFile.worker.worker.js | 4790 - src/react-devtools/build/installHook.js | 13347 --- src/react-devtools/build/main.js | 56723 ---------- src/react-devtools/build/panel.js | 110 - .../build/parseHookNames.chunk.js | 490 - .../parseSourceAndMetadata.worker.worker.js | 87709 ---------------- src/react-devtools/build/prepareInjection.js | 731 - src/react-devtools/build/proxy.js | 155 - .../build/react_devtools_backend.js | 16893 --- src/react-devtools/build/renderer.js | 12853 --- .../build/vendors~parseHookNames.chunk.js | 2095 - src/react-devtools/icons/128-deadcode.png | Bin 2101 -> 0 bytes src/react-devtools/icons/128-development.png | Bin 2101 -> 0 bytes src/react-devtools/icons/128-disabled.png | Bin 1936 -> 0 bytes src/react-devtools/icons/128-outdated.png | Bin 1992 -> 0 bytes src/react-devtools/icons/128-production.png | Bin 1920 -> 0 bytes src/react-devtools/icons/128-restricted.png | Bin 1936 -> 0 bytes src/react-devtools/icons/128-unminified.png | Bin 2101 -> 0 bytes src/react-devtools/icons/16-deadcode.png | Bin 338 -> 0 bytes src/react-devtools/icons/16-development.png | Bin 338 -> 0 bytes src/react-devtools/icons/16-disabled.png | Bin 288 -> 0 bytes src/react-devtools/icons/16-outdated.png | Bin 313 -> 0 bytes src/react-devtools/icons/16-production.png | Bin 272 -> 0 bytes src/react-devtools/icons/16-restricted.png | Bin 288 -> 0 bytes src/react-devtools/icons/16-unminified.png | Bin 338 -> 0 bytes src/react-devtools/icons/32-deadcode.png | Bin 561 -> 0 bytes src/react-devtools/icons/32-development.png | Bin 561 -> 0 bytes src/react-devtools/icons/32-disabled.png | Bin 490 -> 0 bytes src/react-devtools/icons/32-outdated.png | Bin 550 -> 0 bytes src/react-devtools/icons/32-production.png | Bin 474 -> 0 bytes src/react-devtools/icons/32-restricted.png | Bin 490 -> 0 bytes src/react-devtools/icons/32-unminified.png | Bin 561 -> 0 bytes src/react-devtools/icons/48-deadcode.png | Bin 826 -> 0 bytes src/react-devtools/icons/48-development.png | Bin 826 -> 0 bytes src/react-devtools/icons/48-disabled.png | Bin 730 -> 0 bytes src/react-devtools/icons/48-outdated.png | Bin 787 -> 0 bytes src/react-devtools/icons/48-production.png | Bin 714 -> 0 bytes src/react-devtools/icons/48-restricted.png | Bin 730 -> 0 bytes src/react-devtools/icons/48-unminified.png | Bin 826 -> 0 bytes src/react-devtools/icons/deadcode.svg | 1 - src/react-devtools/icons/development.svg | 1 - src/react-devtools/icons/disabled.svg | 1 - src/react-devtools/icons/outdated.svg | 1 - src/react-devtools/icons/production.svg | 1 - src/react-devtools/icons/restricted.svg | 1 - src/react-devtools/main.html | 9 - src/react-devtools/manifest.json | 55 - src/react-devtools/panel.html | 32 - src/react-devtools/popups/deadcode.html | 28 - src/react-devtools/popups/development.html | 24 - src/react-devtools/popups/disabled.html | 17 - src/react-devtools/popups/outdated.html | 25 - src/react-devtools/popups/production.html | 17 - src/react-devtools/popups/restricted.html | 14 - src/react-devtools/popups/shared.css | 7 - src/react-devtools/popups/shared.js | 25 - src/react-devtools/popups/unminified.html | 31 - src/utils/Activity.ts | 56 +- src/utils/DiscordWebSocket.ts | 42 - src/utils/RPC.ts | 13 +- src/utils/Tray.ts | 49 +- src/utils/Window.ts | 20 +- yarn.lock | 121 +- 70 files changed, 138 insertions(+), 196791 deletions(-) delete mode 100644 src/prompt.html delete mode 100644 src/prompt.js delete mode 100644 src/react-devtools/build/background.js delete mode 100644 src/react-devtools/build/importFile.worker.worker.js delete mode 100644 src/react-devtools/build/installHook.js delete mode 100644 src/react-devtools/build/main.js delete mode 100644 src/react-devtools/build/panel.js delete mode 100644 src/react-devtools/build/parseHookNames.chunk.js delete mode 100644 src/react-devtools/build/parseSourceAndMetadata.worker.worker.js delete mode 100644 src/react-devtools/build/prepareInjection.js delete mode 100644 src/react-devtools/build/proxy.js delete mode 100644 src/react-devtools/build/react_devtools_backend.js delete mode 100644 src/react-devtools/build/renderer.js delete mode 100644 src/react-devtools/build/vendors~parseHookNames.chunk.js delete mode 100644 src/react-devtools/icons/128-deadcode.png delete mode 100644 src/react-devtools/icons/128-development.png delete mode 100644 src/react-devtools/icons/128-disabled.png delete mode 100644 src/react-devtools/icons/128-outdated.png delete mode 100644 src/react-devtools/icons/128-production.png delete mode 100644 src/react-devtools/icons/128-restricted.png delete mode 100644 src/react-devtools/icons/128-unminified.png delete mode 100644 src/react-devtools/icons/16-deadcode.png delete mode 100644 src/react-devtools/icons/16-development.png delete mode 100644 src/react-devtools/icons/16-disabled.png delete mode 100644 src/react-devtools/icons/16-outdated.png delete mode 100644 src/react-devtools/icons/16-production.png delete mode 100644 src/react-devtools/icons/16-restricted.png delete mode 100644 src/react-devtools/icons/16-unminified.png delete mode 100644 src/react-devtools/icons/32-deadcode.png delete mode 100644 src/react-devtools/icons/32-development.png delete mode 100644 src/react-devtools/icons/32-disabled.png delete mode 100644 src/react-devtools/icons/32-outdated.png delete mode 100644 src/react-devtools/icons/32-production.png delete mode 100644 src/react-devtools/icons/32-restricted.png delete mode 100644 src/react-devtools/icons/32-unminified.png delete mode 100644 src/react-devtools/icons/48-deadcode.png delete mode 100644 src/react-devtools/icons/48-development.png delete mode 100644 src/react-devtools/icons/48-disabled.png delete mode 100644 src/react-devtools/icons/48-outdated.png delete mode 100644 src/react-devtools/icons/48-production.png delete mode 100644 src/react-devtools/icons/48-restricted.png delete mode 100644 src/react-devtools/icons/48-unminified.png delete mode 100644 src/react-devtools/icons/deadcode.svg delete mode 100644 src/react-devtools/icons/development.svg delete mode 100644 src/react-devtools/icons/disabled.svg delete mode 100644 src/react-devtools/icons/outdated.svg delete mode 100644 src/react-devtools/icons/production.svg delete mode 100644 src/react-devtools/icons/restricted.svg delete mode 100644 src/react-devtools/main.html delete mode 100644 src/react-devtools/manifest.json delete mode 100644 src/react-devtools/panel.html delete mode 100644 src/react-devtools/popups/deadcode.html delete mode 100644 src/react-devtools/popups/development.html delete mode 100644 src/react-devtools/popups/disabled.html delete mode 100644 src/react-devtools/popups/outdated.html delete mode 100644 src/react-devtools/popups/production.html delete mode 100644 src/react-devtools/popups/restricted.html delete mode 100644 src/react-devtools/popups/shared.css delete mode 100644 src/react-devtools/popups/shared.js delete mode 100644 src/react-devtools/popups/unminified.html delete mode 100644 src/utils/DiscordWebSocket.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7831fd1..17fe24f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.2.8 + +* Fixed the app not working because of Deezer and Discord changes +* Made the "Listening to" mode not needing your token anymore +* Fixed the "Don't close to tray" option not making the RPC disconnect when closing the app + ## 1.2.7 * Added back and forward buttons (#53) diff --git a/package.json b/package.json index 4ff316e..e751232 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deezer-discord-rpc", - "version": "1.2.7", + "version": "1.2.8", "description": "A Discord RPC for Deezer", "main": "./build/src/index.js", "scripts": { @@ -10,13 +10,13 @@ "run": "yarn build:ts && yarn run copy-assets && yarn start", "postinstall": "electron-builder install-app-deps", "lint": "eslint --fix --ext .ts ./src", - "copy-assets": "cpy ./src/img/* ./build/src/img/ && cpy ./src/prompt.html ./build/" + "copy-assets": "cpy ./src/img/* ./build/src/img/" }, "dependencies": { "@cliqz/adblocker-electron": "^1.27.1", + "@xhayper/discord-rpc": "^1.2.0", "axios": "^1.6.8", "chalk": "4.1.2", - "discord-rpc": "^4.0.1", "discord.js-selfbot-v13": "^2.14.9" }, "devDependencies": { diff --git a/src/functions.ts b/src/functions.ts index ef5a96d..41c12cd 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -1,45 +1,8 @@ -import { BrowserWindow, shell, ipcMain } from 'electron'; -import { join } from 'path'; -import * as Config from './utils/Config'; -import * as DiscordWebSocket from './utils/DiscordWebSocket'; import { win } from './utils/Window'; export const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); -export async function prompt(message: string, app: Electron.App, options?: { - closable?: boolean -}) { - const win = new BrowserWindow({ - resizable: false, - minimizable: false, - maximizable: false, - closable: typeof options?.closable !== 'undefined' ? options?.closable : true, - webPreferences: { - preload: join(__dirname, 'prompt.js') - } - }); - - ipcMain.on('autocomplete-token', async () => { - if (Config.get(app, 'discord_token')) { - await runJs(`document.querySelector('input#discord-token').value = '${Config.get(app, 'discord_token')}'`); - } - }); - - ipcMain.on('token-received', async (e, data) => { - Config.set(app, 'discord_token', data); - Config.set(app, 'use_listening_to', true); - win.close(); - DiscordWebSocket.connect(data, app).catch(console.error); - }); - - win.webContents.setWindowOpenHandler((details) => { - shell.openExternal(details.url); - return { action: 'deny' }; - }); - win.setMenuBarVisibility(false); - await win.loadFile(join(__dirname, 'prompt.html'), { hash: message }); -} - export async function runJs(code: string) { + // return code; return win.webContents.executeJavaScript(code); } diff --git a/src/index.ts b/src/index.ts index 3f94ad6..8ac1411 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,19 +1,15 @@ -import { app, BrowserWindow, session } from 'electron'; +import { app, BrowserWindow } from 'electron'; import { log } from './utils/Log'; -import * as Config from './utils/Config'; import * as Tray from './utils/Tray'; import updater from './utils/Updater'; -import * as DiscordWebSocket from './utils/DiscordWebSocket'; import * as RPC from './utils/RPC'; import * as Window from './utils/Window'; -import { join } from 'path'; import { version } from '../package.json'; -import {showWindow} from './utils/Window'; +import { showWindow } from './utils/Window'; log('App', 'Deezer Discord RPC version', version, process.argv0.includes('node') ? '(debug)' : ''); app.whenReady().then(async () => { - const gotTheLock = app.requestSingleInstanceLock(); if (!gotTheLock) { @@ -26,17 +22,10 @@ app.whenReady().then(async () => { } await Tray.init(app, RPC.client); - if (process.argv0.includes('node')) { - await session.defaultSession.loadExtension(join(process.cwd(), 'src', 'react-devtools')); - } await Window.load(app); await updater(true); - if (Config.get(app, 'use_listening_to')) { - DiscordWebSocket.connect(Config.get(app, 'discord_token'), app).catch((e) => log('WebSocket', e.toString())); - } else { - RPC.connect(); - } + RPC.connect(); app.on('activate', async () => { if (BrowserWindow.getAllWindows().length > 0) { diff --git a/src/prompt.html b/src/prompt.html deleted file mode 100644 index 499963b..0000000 --- a/src/prompt.html +++ /dev/null @@ -1,97 +0,0 @@ - - -
- - - ->24;do if(A)var g=h,y=n;else{if(E&&_<<24>>24
- This page includes an extra development build of React. 🚧
-
- The React build on this page includes both development and production versions because dead code elimination has not been applied correctly.
-
- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
-
- This page is using the development build of React. 🚧
-
- Note that the development build is not suitable for production.
-
- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
-
- This page doesn’t appear to be using React.
-
- This page is using an outdated version of React. ⌛
-
- We recommend updating React to ensure that you receive important bugfixes and performance improvements.
-
- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
-
- This page is using the production build of React. ✅
-
- This is a restricted browser page.
-
- This page is using an unminified build of React. 🚧
-
- The React build on this page appears to be unminified.
-
- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
->>0){_=11;break}var b=s<<3,k=Wr(r,b);if(0==(0|k)){var l=0;_=17;break}var u=k,c=i+16|0,h=Se[c>>2],d=Se[f]<<2;Pa(k,h,d,1);var w=Se[f]<<1;Se[f]=w,Se[c>>2]=u,_=11;break}while(0);do if(11==_){if((0|e)==-1)var p=Ca(a),E=p;else var E=e;var E,A=ja(a),g=E+1|0,y=Wr(r,g),t=(i+4|0)>>2,v=(i+16|0)>>2,m=(Se[t]<<2)+Se[v]|0;Se[m>>2]=y;var S=Se[Se[v]+(Se[t]<<2)>>2];if(0==(0|S)){Xa(0|He.__str72242,233,0|He.___func___str_array_push,0|He.__str117287);var M=Se[Se[v]+(Se[t]<<2)>>2]}else var M=S;var M;Pa(M,A,E,1),va(A),Ae[Se[Se[v]+(Se[t]<<2)>>2]+g|0]=0;var C=Se[t]+1|0;Se[t]=C;var R=i+8|0;if(C>>>0>>0){var fr=tr-w|0;Se[vi+12>>2]=fr;var _r=Me[vi+24>>2],sr=_r;Se[vi+24>>2]=sr+w|0,Se[w+(sr+4)>>2]=1|fr,Se[_r+4>>2]=3|w;var d=_r+8|0}else var nr=aa(w),d=nr}else{var or=vr-w|0,lr=Me[vi+20>>2];if(or>>>0>15){var br=lr;Se[vi+20>>2]=br+w|0,Se[vi+8>>2]=or,Se[w+(br+4)>>2]=1|or,Se[br+vr>>2]=or,Se[lr+4>>2]=3|w}else{Se[vi+8>>2]=0,Se[vi+20>>2]=0,Se[lr+4>>2]=3|vr;var kr=vr+(lr+4)|0,ur=1|Se[kr>>2];Se[kr>>2]=ur}var d=lr+8|0}}var d;return d}function ra(r){var a,e,i,v=Se[vi+4>>2],t=(v&-v)-1|0,f=t>>>12&16,_=t>>>(f>>>0),s=_>>>5&8,n=_>>>(s>>>0),o=n>>>2&4,l=n>>>(o>>>0),b=l>>>1&2,k=l>>>(b>>>0),u=k>>>1&1,c=Me[vi+((s|f|o|b|u)+(k>>>(u>>>0))<<2)+304>>2],h=c,e=h>>2,d=(Se[c+4>>2]&-8)-r|0;r:for(;;)for(var d,h,w=h;;){var w,p=Se[w+16>>2];if(0==(0|p)){var E=Se[w+20>>2];if(0==(0|E))break r;var A=E}else var A=p;var A,g=(Se[A+4>>2]&-8)-r|0;if(g>>>0 >>0){if((0|T)==(0|r)){var E=M,A=O,g=M;break r}var N=M,I=O}else var N=m,I=S;var I,N,P=Me[t+5],D=Me[((C>>>31<<2)+16>>2)+t],L=0==(0|P)|(0|P)==(0|D)?R:P;if(0==(0|D)){var E=N,A=I,g=L;break r}var m=N,S=I,M=D,t=M>>2,C=C<<1,R=L}}while(0);var g,A,E,F=0==(0|g)&0==(0|E);do if(F){var X=2<
>2]=wr}else{var pr=d,Er=Me[f+(s+4)],Ar=Me[((4|h)>>2)+s],gr=(0|Ar)==(0|pr);do if(gr){var yr=h+(r+12)|0,mr=Se[yr>>2];if(0==(0|mr)){var Sr=h+(r+8)|0,Mr=Se[Sr>>2];if(0==(0|Mr)){var Cr=0,a=Cr>>2;break}var Rr=Sr,Tr=Mr}else{var Rr=yr,Tr=mr;_=73}for(;;){var Tr,Rr,Or=Tr+20|0,Nr=Se[Or>>2];if(0==(0|Nr)){var Ir=Tr+16|0,Pr=Me[Ir>>2];if(0==(0|Pr))break;var Rr=Ir,Tr=Pr}else var Rr=Or,Tr=Nr}if(Rr>>>0>>0;do if(!fr){if(vr>>>0 >>0)break;Se[vr+12>>2]=x,Se[ir>>2]=x,Se[i+2]=vr,Se[i+3]=er,Se[i+6]=0;break r}while(0);throw Ka(),"Reached an unreachable!"}var _r=(ar>>>31<<2)+er+16|0,sr=Me[_r>>2];if(0==(0|sr)){if(_r>>>0>=Me[vi+16>>2]>>>0){Se[_r>>2]=x,Se[i+6]=er,Se[i+3]=v,Se[i+2]=v;break r}throw Ka(),"Reached an unreachable!"}var ar=ar<<1,er=sr}}}}while(0)}function Ca(r){return d(r)}function Ra(r,a){var e=0;do Ae[r+e]=Ae[a+e],e++;while(0!=Ae[a+e-1]);return r}function Ta(){var r=Ta;return r.LLVM_SAVEDSTACKS||(r.LLVM_SAVEDSTACKS=[]),r.LLVM_SAVEDSTACKS.push(le.stackSave()),r.LLVM_SAVEDSTACKS.length-1}function Oa(r){var a=Ta,e=a.LLVM_SAVEDSTACKS[r];a.LLVM_SAVEDSTACKS.splice(r,1),le.stackRestore(e)}function Na(r,a,e){for(var i=0;i
-
- This makes its size larger, and causes React to run slower.
-
-
- Make sure to set up dead code elimination before deployment.
-
-
- Make sure to use the production build before deployment.
-
-
- If this seems wrong, follow the troubleshooting instructions.
-
-
- You can find the upgrade instructions on the React blog.
-
-
- Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
-
- React devtools cannot access this page.
-
- This makes its size larger, and causes React to run slower.
-
-
- Make sure to set up minification before deployment.
-
-