Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const axios = require("axios");
- const FormData = require("form-data");
- const fs = require("fs");
- async function web2apk(url, email, appName, iconPath) {
- const headers = {
- "accept": "application/json, text/plain, */*",
- "content-type": "application/json;charset=UTF-8",
- "origin": "https://create.appmaker.xyz",
- "referer": "https://create.appmaker.xyz/",
- "user-agent":
- "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Mobile Safari/537.36",
- };
- const buildInit = await axios.post(
- "https://standalone-app-api.appmaker.xyz/webapp/build",
- { url, email },
- { headers }
- );
- const appId = buildInit.data.body.appId;
- const form = new FormData();
- form.append("file", fs.createReadStream(iconPath));
- form.append("id", appId);
- const upload = await axios.post(
- "https://standalone-app-api.appmaker.xyz/webapp/build/file-upload",
- form,
- {
- headers: {
- ...form.getHeaders(),
- "origin": "https://create.appmaker.xyz",
- "referer": "https://create.appmaker.xyz/",
- },
- }
- );
- const iconUrl = upload.data.cloudStoragePublicUrl;
- await axios.post(
- "https://standalone-app-api.appmaker.xyz/webapp/build/build",
- {
- appId,
- appIcon: iconUrl,
- appName,
- isPaymentInProgress: false,
- enableShowToolBar: false,
- toolbarColor: "#03A9F4",
- toolbarTitleColor: "#FFFFFF",
- splashIcon: iconUrl,
- },
- { headers }
- );
- let status = "building";
- while (status === "building" || status === "draft") {
- const statusResp = await axios.get(
- `https://standalone-app-api.appmaker.xyz/webapp/build/status?appId=${appId}`,
- { headers }
- );
- status = statusResp.data.body.status;
- if (status !== "success") await new Promise((r) => setTimeout(r, 5000));
- }
- const result = await axios.get(
- `https://standalone-app-api.appmaker.xyz/webapp/complete/download?appId=${appId}`,
- { headers }
- );
- return {
- appId,
- build: result.data.body,
- };
- }
- //use
- const hasil = await web2apk(
- "https://zephrine.live", // web
- "KyuuRzy", // app
- "./icon.png" // icon
- );
- console.log(hasil);
Advertisement
Add Comment
Please, Sign In to add comment