var user = require(["CurrentUserInitialData"]).USER_ID;
var fb_dtsg = require(["DTSGInitData"]).token;
var idbm = "1660116254801945";
var idapp = "727977396683152";
var solan = 1000000;
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
(async () => {
for (let i = 0; i < solan; i++) {
const response = await fetch(
"https://developers.facebook.com/apps/async/create/?app_creation_source=dfc_test_app_creation&app_owner_type=1&create_from_business_id=" + idbm + "&platform_category=business",
{
"headers": {
"content-type": "application/x-www-form-urlencoded",
"x-asbd-id": "359341",
"x-fb-lsd": "gsDBpxO9xRAUK25GpSD0Ka",
"x-fb-qpl-active-flows": "890780636"
},
"referrer": `https://developers.facebook.com/apps/${idapp}/dashboard/?business_id=${idbm}`,
"body": `jazoest=25412&fb_dtsg=${fb_dtsg}&create_test_app=1&parent_app_id=${idapp}&basic_name=Bm%20nlm%20-%20Test1&__aaid=0&__bid=${idbm}&__user=${user}&__a=1&__req=q&__hs=20295.BP%3Adevsite_pkg.2.0...0&dpr=1&__ccg=EXCELLENT&__rev=1025187666&__s=ri550j%3Apvs6ot%3Aanui9o&__hsi=7531412242586751691&__dyn=...&lsd=gsDBpxO9xRAUK25GpSD0Ka&qpl_active_flow_ids=890780636`,
"method": "POST",
"mode": "cors",
"credentials": "include"
}
);
const rawText = await response.text();
await sleep(15000);
const clean = rawText.replace(/^for\s*\(\s*;;\s*\);\s*/, "");
const data = JSON.parse(clean);
const app1 = data?.payload?.extra?.newApp?.id;
if (!app1) {
console.warn("⚠️NDM OFFICIAL: Không lấy được app ID.");
continue;
}
console.log("✅NDM OFFICIAL: App tạo thành công:", app1);
// 👉 Gắn sản phẩm WhatsApp
await fetch(`https://developers.facebook.com/apps/${app1}/async/products/add/`, {
"headers": {
"content-type": "application/x-www-form-urlencoded",
"x-asbd-id": "359341",
"x-fb-lsd": "B5ZJ-mGWZJPxzdo92SnPhE",
"x-fb-qpl-active-flows": "890780636"
},
"referrer": `https://developers.facebook.com/apps/${app1}/dashboard/?business_id=${idbm}`,
"body": `product_route=whatsapp-business&__aaid=0&__bid=${idbm}&__user=${user}&__a=1&__req=l&__hs=20295.BP%3Adevsite_pkg.2.0...0&dpr=1&__ccg=EXCELLENT&__rev=1025187666&__s=w3sjer%3Apvs6ot%3Alnm578&__hsi=7531419097793690605&__dyn=...&fb_dtsg=${fb_dtsg}&jazoest=25482&lsd=B5ZJ-mGWZJPxzdo92SnPhE&qpl_active_flow_ids=890780636`,
"method": "POST",
"mode": "cors",
"credentials": "include"
});
console.log("📌NDM OFFICIAL: Gắn WhatsApp thành công:", app1);
await sleep(5000);
// 🗑️NDM OFFICIAL: Xoá app sau khi gắn WhatsApp
await fetch(`https://developers.facebook.com/apps/${app1}/delete/`, {
method: "POST",
headers: {
"content-type": "application/x-www-form-urlencoded",
"x-asbd-id": "359341",
"x-fb-lsd": "zwm-EuixLKDzHa3OwvsLpq",
"x-fb-qpl-active-flows": "890776884"
},
referrer: "https://developers.facebook.com/apps/",
body: `confirmed=true&__aaid=0&__user=${user}&__a=1&__req=n&dpr=1&__rev=1025187666&__s=jcy10z%3Aw55dzv%3Acjxvdb&__hsi=7531428809821816560&__dyn=...&fb_dtsg=${fb_dtsg}&jazoest=25402&lsd=zwm-EuixLKDzHa3OwvsLpq&qpl_active_flow_ids=890776884`,
credentials: "include"
});
console.log("🗑️ NDM OFFICIAL: App đã được xoá:", app1);
await sleep(5000); // nghỉ giữa vòng lặp
}
})();