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

Commit

Permalink
Merge pull request #550 from CrowTaker/ticktick
Browse files Browse the repository at this point in the history
Added support for Ticktick
  • Loading branch information
shrihankp authored Nov 15, 2022
2 parents c6a804f + 30d5584 commit 5890763
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
6 changes: 6 additions & 0 deletions public/apps/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ <h1>Select the app you want to patch</h1>
>TikTok</label
>
</li>
<li>
<input type="radio" name="app" id="app-7" value="task" /><label
for="app-7"
>TickTick</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 @@ -26,6 +26,10 @@ const defaultPatchesList = JSON.stringify(
{
name: 'trill',
patches: []
},
{
name: 'task',
patches: []
}
]
},
Expand Down
6 changes: 6 additions & 0 deletions utils/downloadApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ async function downloadApp(ws) {
versionDownload = await fetch(
`https://www.apkmirror.com/apk/tiktok-pte-ltd/tik-tok/tik-tok-${apkMirrorVersionArg}-release/`
);
break;
case 'task':
versionDownload = await fetch(
`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;
}

if (!versionDownload.ok) {
Expand Down
13 changes: 11 additions & 2 deletions wsEvents/getAppVersion.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const exec = require('../utils/promisifiedExec.js');

const fetch = require('node-fetch');
const { load } = require('cheerio');
const { load, version } = require('cheerio');
const semver = require('semver');

const { getAppVersion: getAppVersion_ } = require('../utils/getAppVersion.js');
Expand All @@ -14,6 +14,10 @@ const APKMIRROR_UPLOAD_BASE = 'https://www.apkmirror.com/uploads/?appcategory=';
* @param {string} ver
*/
const sanitizeVersion = (ver) => {

while(ver.match(/\./g).length > 2)
ver = ver.replace(/.([^.]*)$/, '$1')

return ver
.replace(/\.0(\d)/gi, '.$1') // because apparently x.0y.z (ex. 5.09.51) isn't a valid version
.replace(/^(\d+)\.(\d+)$/gi, '$1.$2.0'); // nor are versions without a patch (ex. 2.3)
Expand Down Expand Up @@ -135,6 +139,10 @@ module.exports = async function getAppVersion(ws, message) {
break;
case 'trill':
versionsList = await getPage(`${APKMIRROR_UPLOAD_BASE}tik-tok`);
break;
case 'task':
versionsList = await getPage(`${APKMIRROR_UPLOAD_BASE}ticktick-to-do-list-with-reminder-day-planner`);
break;
}

/** @type {{ version: string; recommended: boolean; beta: boolean }[]} */
Expand All @@ -150,7 +158,8 @@ module.exports = async function getAppVersion(ws, message) {
.replace('Twitter ', '')
.replace('Reddit ', '')
.replace('WarnWetter ', '')
.replace('TikTok ', '');
.replace('TikTok ', '')
.replace('TickTick:To-do list & Tasks ', '');

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

await exec(
Expand Down Expand Up @@ -125,6 +129,10 @@ function outputName() {
break;
case 'warnapp':
part2 = 'WarnWetter';
break;
case 'task':
part2 = 'TickTick';
break;
}

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

0 comments on commit 5890763

Please sign in to comment.