| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import { io } from "socket.io-client"
- import axios from "axios"
- import { setTimeout } from "timers/promises"
- import chalk from "chalk"
- const axiosInstance = axios.create({
- baseURL: "http://47.98.225.28/api",
- headers: {
- Authorization:
- "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InpvdW1hQWRtaW4iLCJzdWIiOjEsInJvbGVzIjpbImFkbWluIl0sImlhdCI6MTcyNjU4MTk1OH0.dQiHFYaDDa1qp4OpEHaH5SCZ9dafJ8uO9fAAc8HZgAo"
- }
- })
- const {
- data: { items: devices }
- } = await axiosInstance.post("/device", {
- page: { page: 1, limit: 1000 },
- search: { where: { online: true }, order: { name: "ASC" } }
- })
- for (let device of devices) {
- try {
- const {
- data: { out }
- } = await axiosInstance.post(
- `/device/${device.id}/sendMessage`,
- {
- action: "runScript",
- data: {
- script: "cat /data/adb/modules/playintegrityfix/pif.json"
- }
- },
- {
- timeout: 10000
- }
- )
- console.log(chalk.blue(device.id, device.name, "kill"))
- axiosInstance
- .post(
- `/device/${device.id}/sendMessage`,
- {
- action: "runScript",
- data: {
- script: `am force-stop com.google.android.gms
- sleep 1
- am force-stop com.google.android.apps.messaging`
- }
- },
- {
- timeout: 60000
- }
- )
- .catch(e =>
- console.log(chalk.red(device.id, device.name, e.message))
- )
- } catch (e) {
- console.log(chalk.red(e.message))
- }
- }
|