Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Added support for Twitch #551

Merged
merged 2 commits into from
Nov 16, 2022
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
6 changes: 6 additions & 0 deletions public/apps/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ <h1>Select the app you want to patch</h1>
>TickTick</label
>
</li>
<li>
<input type="radio" name="app" id="app-8" value="app" /><label
for="app-8"
>Twitch</label
>
</li>
</ul>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions utils/PatchListRememberer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const defaultPatchesList = JSON.stringify(
{
name: 'task',
patches: []
},
{
name: 'app',
patches: []
}
]
},
Expand Down
5 changes: 5 additions & 0 deletions utils/downloadApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ async function downloadApp(ws) {
`https://www.apkmirror.com/apk/appest-inc/ticktick-to-do-list-with-reminder-day-planner/ticktick-to-do-list-with-reminder-day-planner-${apkMirrorVersionArg}-release/`
);
break;
case 'app':
versionDownload = await fetch(
`https://www.apkmirror.com/apk/twitch-interactive-inc/twitch/twitch-${apkMirrorVersionArg}-release/`
);
break;
}

if (!versionDownload.ok) {
Expand Down
7 changes: 6 additions & 1 deletion wsEvents/getAppVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ module.exports = async function getAppVersion(ws, message) {
case 'task':
versionsList = await getPage(`${APKMIRROR_UPLOAD_BASE}ticktick-to-do-list-with-reminder-day-planner`);
break;
case 'app':
versionsList = await getPage(`${APKMIRROR_UPLOAD_BASE}twitch`);
break;
}

/** @type {{ version: string; recommended: boolean; beta: boolean }[]} */
Expand All @@ -159,7 +162,9 @@ module.exports = async function getAppVersion(ws, message) {
.replace('Reddit ', '')
.replace('WarnWetter ', '')
.replace('TikTok ', '')
.replace('TickTick:To-do list & Tasks ', '');
.replace('TickTick:To-do list & Tasks ', '')
.replace('Twitch: Live Game Streaming ', '')
.replace('_',' ');

if (
(global.jarNames.selectedApp === 'android' &&
Expand Down
9 changes: 9 additions & 0 deletions wsEvents/patchApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ async function reinstallReVanced() {
case 'task':
pkgNameToGetUninstalled = 'com.ticktick.task';
break;
case 'app':
pkgNameToGetUninstalled = 'tv.twitch.android.app';
break;
}

await exec(
Expand Down Expand Up @@ -130,9 +133,15 @@ function outputName() {
case 'warnapp':
part2 = 'WarnWetter';
break;
case 'trill':
part2 = 'TikTok';
break;
case 'task':
part2 = 'TickTick';
break;
case 'app':
part2 = 'Twitch';
break;
}

// TODO: If the existing input APK is used from revanced/ without downloading, version and arch aren't set
Expand Down