2 Commits
3 changed files with 29 additions and 10 deletions
Regular → Executable
+4 -4
View File
@@ -1,5 +1,5 @@
import { extractSecrets } from './crunchys'; #!/usr/bin/env node
(async () => { const { extractSecrets } = require('./crunchys');
await extractSecrets();
})(); extractSecrets();
+5 -4
View File
@@ -25,9 +25,7 @@ const downloadLatestApk = async () => {
const decompileApk = (apkPath) => { const decompileApk = (apkPath) => {
try { try {
execSync(`jadx ${apkPath}`, { stdio: 'inherit' }); execSync(`jadx ${apkPath}`, { stdio: 'inherit' });
} catch (error) { } catch (error) {}
console.error(error);
}
return apkPath.replace('.xapk', ''); return apkPath.replace('.xapk', '');
}; };
@@ -64,7 +62,7 @@ const parseSecrets = (contents) => {
return { id, secret, encoded, header }; return { id, secret, encoded, header };
}; };
export const extractSecrets = async ({ cleanup = true } = {}) => { const extractSecrets = async ({ cleanup = true } = {}) => {
console.log('Downloading latest APK...'); console.log('Downloading latest APK...');
const apkPath = await downloadLatestApk(); const apkPath = await downloadLatestApk();
@@ -74,6 +72,7 @@ export const extractSecrets = async ({ cleanup = true } = {}) => {
console.log('Searching for secrets...'); console.log('Searching for secrets...');
const sourcesDir = join(decompiledDir, 'sources'); const sourcesDir = join(decompiledDir, 'sources');
const configurationImpl = await findConfigurationImpl(sourcesDir); const configurationImpl = await findConfigurationImpl(sourcesDir);
if (!configurationImpl) return console.error('Could not find ConfigurationImpl.kt');
console.log('Parsing secrets...'); console.log('Parsing secrets...');
const { id, secret, encoded, header } = parseSecrets(configurationImpl); const { id, secret, encoded, header } = parseSecrets(configurationImpl);
@@ -88,3 +87,5 @@ export const extractSecrets = async ({ cleanup = true } = {}) => {
return { id, secret, encoded, header }; return { id, secret, encoded, header };
}; };
module.exports = { extractSecrets };
+20 -2
View File
@@ -1,15 +1,33 @@
{ {
"name": "crunchys", "name": "crunchys",
"version": "1.0.0", "version": "1.0.1",
"description": "A utility to extract secrets from Crunchyroll mobile app", "description": "A utility to extract secrets from Crunchyroll mobile app",
"main": "crunchys.js", "main": "crunchys.js",
"types": "crunchys.d.ts",
"bin": "crunchys-cli.js", "bin": "crunchys-cli.js",
"types": "crunchys.d.ts",
"type": "commonjs",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"keywords": [
"crunchyroll"
],
"author": "Vitaly Gashkov <vitalygashkov@vk.com>", "author": "Vitaly Gashkov <vitalygashkov@vk.com>",
"license": "MIT", "license": "MIT",
"readmeFilename": "README.md",
"funding": [
{
"type": "individual",
"url": "https://boosty.to/vitalygashkov"
},
{
"type": "patreon",
"url": "https://www.patreon.com/vitalygashkov"
}
],
"engines": {
"node": "20 || 21 || 22 || 23"
},
"devDependencies": { "devDependencies": {
"typescript": "^5.8.2" "typescript": "^5.8.2"
} }