Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed May 24, 2024
1 parent 9f5a41c commit 28b02ae
Show file tree
Hide file tree
Showing 16 changed files with 386 additions and 245 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
with:
node-version: 20

- name: Install dependencies
- name: Install pnpm and dependencies
run: |
npm i -g pnpm
pnpm i
pnpm i\
- name: Build
run: pnpm build
run: pnpm build --release-branch=${{ github.ref_name }} --build-minify

# TODO: Check for linting?

Expand All @@ -49,5 +49,5 @@ jobs:
- name: Purge CDN cache
run: |
curl https://purge.jsdelivr.net/gh/pyoncord/bunny-builds@${{ github.ref_name }}/bunny.js
curl https://purge.jsdelivr.net/gh/pyoncord/bunny-build-infos@${{ github.ref_name }}/bunny.js
168 changes: 0 additions & 168 deletions build.mjs

This file was deleted.

30 changes: 12 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
{
"name": "bunny",
"version": "1.0.0",
"description": "A mod for Discord's mobile apps, fork of Vendetta.",
"private": true,
"author": {
"name": "Pyoncord Team",
"url": "https://github.com/pyoncord"
},
"scripts": {
"dev": "node build.mjs",
"build": "node build.mjs --release",
"serve": "node build.mjs --serve",
"watch": "node build.mjs --watch",
"build": "node scripts/build.mjs",
"serve": "node scripts/serve.mjs",
"serve:adb": "pnpm run serve --adb",
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx"
},
"keywords": [
"discord",
"android",
"ios",
"react native",
"vendetta",
"bunny"
],
"author": "pylixonly, Team Vendetta",
"license": "BSD-3-Clause",
"devDependencies": {
"@react-native-clipboard/clipboard": "1.10.0",
Expand All @@ -29,7 +22,7 @@
"@types/node": "^20.11.25",
"@types/react": "~18.2.0",
"@types/react-native": "~0.72.0",
"@types/spark-md5": "^3.0.4",
"@types/yargs-parser": "^21.0.3",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/typescript-estree": "^7.1.1",
Expand All @@ -43,9 +36,10 @@
"moment": "2.22.2",
"type-fest": "^4.12.0",
"typescript": "^5.4.5",
"typescript-transform-paths": "^3.4.7"
"yargs-parser": "^21.1.1"
},
"dependencies": {
"chalk": "^5.3.0",
"fuzzysort": "^2.0.4",
"spitroast": "^1.4.4"
},
Expand All @@ -57,4 +51,4 @@
]
}
}
}
}
38 changes: 21 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions scripts/adb.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// @ts-nocheck
import { execSync } from "child_process";

const packageName = process.env.DISCORD_PACKAGE_NAME ?? "com.discord";

export function getPackageName() {
return packageName;
}

export function isADBAvailableAndAppInstalled() {
try {
const out = execSync(`adb shell pm list packages ${packageName}`);
return out.toString().trimEnd() === `package:${packageName}`;
} catch {
return false;
}
}
export async function restartAppFromADB(reversePort) {
if (typeof reversePort === "number") {
await execSync(`adb reverse tcp:${reversePort} tcp:${reversePort}`);
}

await forceStopAppFromADB();
await execSync(`adb shell am start ${packageName}/com.discord.main.MainActivity`);
}

export async function forceStopAppFromADB() {
await execSync(`adb shell am force-stop ${packageName}`);
}
Loading

0 comments on commit 28b02ae

Please sign in to comment.