function update_status(status) { console.log(status); document.getElementById("status").innerText = status; } async function patch(file, android, newDomain, patches) { if (newDomain.endsWith("/")) newDomain = newDomain.slice(0, -1); if (!file) { console.log("downloading"); update_status("Downloading..."); file = await (await fetch("https://ethanthesleepy.one/public/lovelive/lovelive-community." + (android ? "apk" : "ipa"))).blob(); console.log("downloaded"); } console.log("loaded"); update_status("Opening file"); const zip = new JSZip(); await zip.loadAsync(file); update_status("Getting current config"); let basePath = android ? "" : "Payload/LoveLive.app/ProjectResources/"; let server_file; if (android) { let server_info = await zip.file("assets/AppAssets.zip").async("arraybuffer"); const zip2 = new JSZip(); await zip2.loadAsync(server_info); server_file = await zip2.file("config/server_info.json").async("arraybuffer"); } else { server_file = await zip.file("Payload/LoveLive.app/ProjectResources/config/server_info.json").async("arraybuffer"); } let postPatches = []; for (let i=0; iuber-apk-signer, sign it with the command `java -jar uber-apk-signer-.jar -a lovelive.apk`."; document.body.appendChild(p); } } function init_honoka(file, android, newDomain, patches) { window.Module = { noInitialRun: true, onRuntimeInitialized: async function() { try { await patch(file, android, newDomain, patches); } catch(e) { console.warn(e); document.getElementById("status").innerText = "It didnt work. Are your files/options invalid?"; } }, arguments: [], preRun: [], postRun: [], print: (msg) => { console.log(msg); }, printErr: (msg) => { console.log(msg); }, totalDependencies: 0, monitorRunDependencies: () => {}, locateFile: function(fileName) { console.log("locateFile", fileName); return fileName; } }; const script = document.createElement("script") script.src = "libhonoka.js"; document.body.appendChild(script); };