Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function serializeApp(app) {
const { name, id, smallIcon, largeIcon, identifier } = app
return {
name,
id,
identifier,
smallIcon: serializeIcon(smallIcon),
largeIcon: serializeIcon(largeIcon),
}
}
class ExtendedDevice {
static frida = {
version: require('frida/package.json').version
}
static async list() {
const notLocal = device => !['local', 'tcp'].includes(device.id)
const all = await enumerateDevices()
return all.filter(notLocal).map(serializeDevice)
}
static async get(id, timeout = 10 * 1000) {
return new ExtendedDevice(await getDevice(id, { timeout }))
}
static async connect(host) {
return new ExtendedDevice(await getDeviceManager().addRemoteDevice(host))
}
const path = require('path')
const http = require('http')
const { Z_SYNC_FLUSH } = require('zlib')
require('colors')
const frida = require('frida')
const FRIDA_VERSION = require('frida/package.json').version
const Koa = require('koa')
const logger = require('koa-logger')
const json = require('koa-json')
const compress = require('koa-compress')
const bodyParser = require('koa-bodyparser')
const send = require('koa-send')
const Router = require('koa-router')
const { FridaUtil, serializeDevice, serializeApp } = require('./lib/utils')
const channels = require('./lib/channels.js')
const { KnownError, InvalidDeviceError, VersionMismatchError } = require('./lib/error')
const app = new Koa()
const router = new Router({ prefix: '/api' })