@devicefarmer/adbkit 2.11.3 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +46 -0
- package/CONTRIBUTING.md +28 -0
- package/README.md +749 -759
- package/bin/adbkit +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +84 -0
- package/dist/src/Callback.d.ts +2 -0
- package/dist/src/Callback.d.ts.map +1 -0
- package/dist/src/Callback.js +3 -0
- package/dist/src/Callback.js.map +1 -0
- package/dist/src/ClientOptions.d.ts +6 -0
- package/dist/src/ClientOptions.d.ts.map +1 -0
- package/dist/src/ClientOptions.js +3 -0
- package/dist/src/ClientOptions.js.map +1 -0
- package/dist/src/CpuStats.d.ts +17 -0
- package/dist/src/CpuStats.d.ts.map +1 -0
- package/dist/src/CpuStats.js +3 -0
- package/dist/src/CpuStats.js.map +1 -0
- package/dist/src/Device.d.ts +5 -0
- package/dist/src/Device.d.ts.map +1 -0
- package/dist/src/Device.js +3 -0
- package/dist/src/Device.js.map +1 -0
- package/dist/src/DeviceWithPath.d.ts +9 -0
- package/dist/src/DeviceWithPath.d.ts.map +1 -0
- package/dist/src/DeviceWithPath.js +3 -0
- package/dist/src/DeviceWithPath.js.map +1 -0
- package/dist/src/ExtendedPublicKey.d.ts +7 -0
- package/dist/src/ExtendedPublicKey.d.ts.map +1 -0
- package/dist/src/ExtendedPublicKey.js +3 -0
- package/dist/src/ExtendedPublicKey.js.map +1 -0
- package/dist/src/Features.d.ts +2 -0
- package/dist/src/Features.d.ts.map +1 -0
- package/dist/src/Features.js +3 -0
- package/dist/src/Features.js.map +1 -0
- package/dist/src/Forward.d.ts +6 -0
- package/dist/src/Forward.d.ts.map +1 -0
- package/dist/src/Forward.js +3 -0
- package/dist/src/Forward.js.map +1 -0
- package/dist/src/FramebufferMeta.d.ts +60 -0
- package/dist/src/FramebufferMeta.d.ts.map +1 -0
- package/dist/src/FramebufferMeta.js +3 -0
- package/dist/src/FramebufferMeta.js.map +1 -0
- package/dist/src/FramebufferStreamWithMeta.d.ts +10 -0
- package/dist/src/FramebufferStreamWithMeta.d.ts.map +1 -0
- package/dist/src/FramebufferStreamWithMeta.js +3 -0
- package/dist/src/FramebufferStreamWithMeta.js.map +1 -0
- package/dist/src/Properties.d.ts +2 -0
- package/dist/src/Properties.d.ts.map +1 -0
- package/dist/src/Properties.js +3 -0
- package/dist/src/Properties.js.map +1 -0
- package/dist/src/Reverse.d.ts +5 -0
- package/dist/src/Reverse.d.ts.map +1 -0
- package/dist/src/Reverse.js +3 -0
- package/dist/src/Reverse.js.map +1 -0
- package/dist/src/SocketOptions.d.ts +6 -0
- package/dist/src/SocketOptions.d.ts.map +1 -0
- package/dist/src/SocketOptions.js +3 -0
- package/dist/src/SocketOptions.js.map +1 -0
- package/dist/src/StartActivityOptions.d.ts +12 -0
- package/dist/src/StartActivityOptions.d.ts.map +1 -0
- package/dist/src/StartActivityOptions.js +3 -0
- package/dist/src/StartActivityOptions.js.map +1 -0
- package/dist/src/StartServiceOptions.d.ts +57 -0
- package/dist/src/StartServiceOptions.d.ts.map +1 -0
- package/dist/src/StartServiceOptions.js +3 -0
- package/dist/src/StartServiceOptions.js.map +1 -0
- package/dist/src/TrackerChangeSet.d.ts +7 -0
- package/dist/src/TrackerChangeSet.d.ts.map +1 -0
- package/dist/src/TrackerChangeSet.js +3 -0
- package/dist/src/TrackerChangeSet.js.map +1 -0
- package/dist/src/WithToString.d.ts +4 -0
- package/dist/src/WithToString.d.ts.map +1 -0
- package/dist/src/WithToString.js +3 -0
- package/dist/src/WithToString.js.map +1 -0
- package/dist/src/adb/DeviceClient.d.ts +376 -0
- package/dist/src/adb/DeviceClient.d.ts.map +1 -0
- package/dist/src/adb/DeviceClient.js +517 -0
- package/dist/src/adb/DeviceClient.js.map +1 -0
- package/dist/src/adb/auth.d.ts +8 -0
- package/dist/src/adb/auth.d.ts.map +1 -0
- package/dist/src/adb/auth.js +87 -0
- package/dist/src/adb/auth.js.map +1 -0
- package/dist/src/adb/client.d.ts +29 -0
- package/dist/src/adb/client.d.ts.map +1 -0
- package/dist/src/adb/client.js +73 -0
- package/dist/src/adb/client.js.map +1 -0
- package/dist/src/adb/command/host/connect.d.ts +6 -0
- package/dist/src/adb/command/host/connect.d.ts.map +1 -0
- package/dist/src/adb/command/host/connect.js +36 -0
- package/dist/src/adb/command/host/connect.js.map +1 -0
- package/dist/src/adb/command/host/devices.d.ts +10 -0
- package/dist/src/adb/command/host/devices.d.ts.map +1 -0
- package/dist/src/adb/command/host/devices.js +40 -0
- package/dist/src/adb/command/host/devices.js.map +1 -0
- package/dist/src/adb/command/host/deviceswithpaths.d.ts +9 -0
- package/dist/src/adb/command/host/deviceswithpaths.d.ts.map +1 -0
- package/dist/src/adb/command/host/deviceswithpaths.js +46 -0
- package/dist/src/adb/command/host/deviceswithpaths.js.map +1 -0
- package/dist/src/adb/command/host/disconnect.d.ts +6 -0
- package/dist/src/adb/command/host/disconnect.d.ts.map +1 -0
- package/dist/src/adb/command/host/disconnect.js +35 -0
- package/dist/src/adb/command/host/disconnect.js.map +1 -0
- package/dist/src/adb/command/host/index.d.ts +9 -0
- package/dist/src/adb/command/host/index.d.ts.map +1 -0
- package/dist/src/adb/command/host/index.js +23 -0
- package/dist/src/adb/command/host/index.js.map +1 -0
- package/dist/src/adb/command/host/kill.d.ts +6 -0
- package/dist/src/adb/command/host/kill.d.ts.map +1 -0
- package/dist/src/adb/command/host/kill.js +24 -0
- package/dist/src/adb/command/host/kill.js.map +1 -0
- package/dist/src/adb/command/host/trackdevices.d.ts +6 -0
- package/dist/src/adb/command/host/trackdevices.d.ts.map +1 -0
- package/dist/src/adb/command/host/trackdevices.js +27 -0
- package/dist/src/adb/command/host/trackdevices.js.map +1 -0
- package/dist/src/adb/command/host/transport.d.ts +6 -0
- package/dist/src/adb/command/host/transport.d.ts.map +1 -0
- package/dist/src/adb/command/host/transport.js +24 -0
- package/dist/src/adb/command/host/transport.js.map +1 -0
- package/dist/src/adb/command/host/version.d.ts +7 -0
- package/dist/src/adb/command/host/version.d.ts.map +1 -0
- package/dist/src/adb/command/host/version.js +29 -0
- package/dist/src/adb/command/host/version.js.map +1 -0
- package/dist/src/adb/command/host-serial/forward.d.ts +6 -0
- package/dist/src/adb/command/host-serial/forward.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/forward.js +33 -0
- package/dist/src/adb/command/host-serial/forward.js.map +1 -0
- package/dist/src/adb/command/host-serial/getdevicepath.d.ts +6 -0
- package/dist/src/adb/command/host-serial/getdevicepath.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/getdevicepath.js +26 -0
- package/dist/src/adb/command/host-serial/getdevicepath.js.map +1 -0
- package/dist/src/adb/command/host-serial/getserialno.d.ts +6 -0
- package/dist/src/adb/command/host-serial/getserialno.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/getserialno.js +24 -0
- package/dist/src/adb/command/host-serial/getserialno.js.map +1 -0
- package/dist/src/adb/command/host-serial/getstate.d.ts +6 -0
- package/dist/src/adb/command/host-serial/getstate.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/getstate.js +24 -0
- package/dist/src/adb/command/host-serial/getstate.js.map +1 -0
- package/dist/src/adb/command/host-serial/index.d.ts +7 -0
- package/dist/src/adb/command/host-serial/index.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/index.js +19 -0
- package/dist/src/adb/command/host-serial/index.js.map +1 -0
- package/dist/src/adb/command/host-serial/listforwards.d.ts +8 -0
- package/dist/src/adb/command/host-serial/listforwards.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/listforwards.js +34 -0
- package/dist/src/adb/command/host-serial/listforwards.js.map +1 -0
- package/dist/src/adb/command/host-serial/waitfordevice.d.ts +6 -0
- package/dist/src/adb/command/host-serial/waitfordevice.d.ts.map +1 -0
- package/dist/src/adb/command/host-serial/waitfordevice.js +33 -0
- package/dist/src/adb/command/host-serial/waitfordevice.js.map +1 -0
- package/dist/src/adb/command/host-transport/clear.d.ts +6 -0
- package/dist/src/adb/command/host-transport/clear.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/clear.js +39 -0
- package/dist/src/adb/command/host-transport/clear.js.map +1 -0
- package/dist/src/adb/command/host-transport/framebuffer.d.ts +12 -0
- package/dist/src/adb/command/host-transport/framebuffer.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/framebuffer.js +113 -0
- package/dist/src/adb/command/host-transport/framebuffer.js.map +1 -0
- package/dist/src/adb/command/host-transport/getfeatures.d.ts +8 -0
- package/dist/src/adb/command/host-transport/getfeatures.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/getfeatures.js +35 -0
- package/dist/src/adb/command/host-transport/getfeatures.js.map +1 -0
- package/dist/src/adb/command/host-transport/getpackages.d.ts +7 -0
- package/dist/src/adb/command/host-transport/getpackages.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/getpackages.js +45 -0
- package/dist/src/adb/command/host-transport/getpackages.js.map +1 -0
- package/dist/src/adb/command/host-transport/getproperties.d.ts +8 -0
- package/dist/src/adb/command/host-transport/getproperties.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/getproperties.js +37 -0
- package/dist/src/adb/command/host-transport/getproperties.js.map +1 -0
- package/dist/src/adb/command/host-transport/index.d.ts +28 -0
- package/dist/src/adb/command/host-transport/index.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/index.js +61 -0
- package/dist/src/adb/command/host-transport/index.js.map +1 -0
- package/dist/src/adb/command/host-transport/install.d.ts +6 -0
- package/dist/src/adb/command/host-transport/install.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/install.js +42 -0
- package/dist/src/adb/command/host-transport/install.js.map +1 -0
- package/dist/src/adb/command/host-transport/isinstalled.d.ts +6 -0
- package/dist/src/adb/command/host-transport/isinstalled.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/isinstalled.js +37 -0
- package/dist/src/adb/command/host-transport/isinstalled.js.map +1 -0
- package/dist/src/adb/command/host-transport/listreverses.d.ts +8 -0
- package/dist/src/adb/command/host-transport/listreverses.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/listreverses.js +38 -0
- package/dist/src/adb/command/host-transport/listreverses.js.map +1 -0
- package/dist/src/adb/command/host-transport/local.d.ts +8 -0
- package/dist/src/adb/command/host-transport/local.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/local.js +24 -0
- package/dist/src/adb/command/host-transport/local.js.map +1 -0
- package/dist/src/adb/command/host-transport/log.d.ts +8 -0
- package/dist/src/adb/command/host-transport/log.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/log.js +24 -0
- package/dist/src/adb/command/host-transport/log.js.map +1 -0
- package/dist/src/adb/command/host-transport/logcat.d.ts +9 -0
- package/dist/src/adb/command/host-transport/logcat.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/logcat.js +37 -0
- package/dist/src/adb/command/host-transport/logcat.js.map +1 -0
- package/dist/src/adb/command/host-transport/monkey.d.ts +8 -0
- package/dist/src/adb/command/host-transport/monkey.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/monkey.js +50 -0
- package/dist/src/adb/command/host-transport/monkey.js.map +1 -0
- package/dist/src/adb/command/host-transport/reboot.d.ts +6 -0
- package/dist/src/adb/command/host-transport/reboot.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/reboot.js +24 -0
- package/dist/src/adb/command/host-transport/reboot.js.map +1 -0
- package/dist/src/adb/command/host-transport/remount.d.ts +6 -0
- package/dist/src/adb/command/host-transport/remount.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/remount.js +24 -0
- package/dist/src/adb/command/host-transport/remount.js.map +1 -0
- package/dist/src/adb/command/host-transport/reverse.d.ts +6 -0
- package/dist/src/adb/command/host-transport/reverse.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/reverse.js +33 -0
- package/dist/src/adb/command/host-transport/reverse.js.map +1 -0
- package/dist/src/adb/command/host-transport/root.d.ts +6 -0
- package/dist/src/adb/command/host-transport/root.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/root.js +32 -0
- package/dist/src/adb/command/host-transport/root.js.map +1 -0
- package/dist/src/adb/command/host-transport/screencap.d.ts +8 -0
- package/dist/src/adb/command/host-transport/screencap.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/screencap.js +36 -0
- package/dist/src/adb/command/host-transport/screencap.js.map +1 -0
- package/dist/src/adb/command/host-transport/shell.d.ts +9 -0
- package/dist/src/adb/command/host-transport/shell.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/shell.js +27 -0
- package/dist/src/adb/command/host-transport/shell.js.map +1 -0
- package/dist/src/adb/command/host-transport/startactivity.d.ts +13 -0
- package/dist/src/adb/command/host-transport/startactivity.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/startactivity.js +166 -0
- package/dist/src/adb/command/host-transport/startactivity.js.map +1 -0
- package/dist/src/adb/command/host-transport/startservice.d.ts +7 -0
- package/dist/src/adb/command/host-transport/startservice.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/startservice.js +17 -0
- package/dist/src/adb/command/host-transport/startservice.js.map +1 -0
- package/dist/src/adb/command/host-transport/sync.d.ts +7 -0
- package/dist/src/adb/command/host-transport/sync.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/sync.js +25 -0
- package/dist/src/adb/command/host-transport/sync.js.map +1 -0
- package/dist/src/adb/command/host-transport/tcp.d.ts +8 -0
- package/dist/src/adb/command/host-transport/tcp.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/tcp.js +24 -0
- package/dist/src/adb/command/host-transport/tcp.js.map +1 -0
- package/dist/src/adb/command/host-transport/tcpip.d.ts +6 -0
- package/dist/src/adb/command/host-transport/tcpip.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/tcpip.js +32 -0
- package/dist/src/adb/command/host-transport/tcpip.js.map +1 -0
- package/dist/src/adb/command/host-transport/trackjdwp.d.ts +7 -0
- package/dist/src/adb/command/host-transport/trackjdwp.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/trackjdwp.js +25 -0
- package/dist/src/adb/command/host-transport/trackjdwp.js.map +1 -0
- package/dist/src/adb/command/host-transport/uninstall.d.ts +6 -0
- package/dist/src/adb/command/host-transport/uninstall.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/uninstall.js +40 -0
- package/dist/src/adb/command/host-transport/uninstall.js.map +1 -0
- package/dist/src/adb/command/host-transport/usb.d.ts +6 -0
- package/dist/src/adb/command/host-transport/usb.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/usb.js +32 -0
- package/dist/src/adb/command/host-transport/usb.js.map +1 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.d.ts +6 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.d.ts.map +1 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.js +27 -0
- package/dist/src/adb/command/host-transport/waitbootcomplete.js.map +1 -0
- package/dist/src/adb/command.d.ts +17 -0
- package/dist/src/adb/command.d.ts.map +1 -0
- package/dist/src/adb/command.js +43 -0
- package/dist/src/adb/command.js.map +1 -0
- package/dist/src/adb/connection.d.ts +24 -0
- package/dist/src/adb/connection.d.ts.map +1 -0
- package/dist/src/adb/connection.js +115 -0
- package/dist/src/adb/connection.js.map +1 -0
- package/dist/src/adb/dump.d.ts +4 -0
- package/dist/src/adb/dump.d.ts.map +1 -0
- package/dist/src/adb/dump.js +38 -0
- package/dist/src/adb/dump.js.map +1 -0
- package/dist/src/adb/framebuffer/rgbtransform.d.ts +16 -0
- package/dist/src/adb/framebuffer/rgbtransform.d.ts.map +1 -0
- package/dist/src/adb/framebuffer/rgbtransform.js +47 -0
- package/dist/src/adb/framebuffer/rgbtransform.js.map +1 -0
- package/dist/src/adb/jdwptracker.d.ts +41 -0
- package/dist/src/adb/jdwptracker.d.ts.map +1 -0
- package/dist/src/adb/jdwptracker.js +85 -0
- package/dist/src/adb/jdwptracker.js.map +1 -0
- package/dist/src/adb/keycode.d.ts +292 -0
- package/dist/src/adb/keycode.d.ts.map +1 -0
- package/dist/src/adb/keycode.js +298 -0
- package/dist/src/adb/keycode.js.map +1 -0
- package/dist/src/adb/linetransform.d.ts +17 -0
- package/dist/src/adb/linetransform.d.ts.map +1 -0
- package/dist/src/adb/linetransform.js +93 -0
- package/dist/src/adb/linetransform.js.map +1 -0
- package/dist/src/adb/parser.d.ts +37 -0
- package/dist/src/adb/parser.d.ts.map +1 -0
- package/dist/src/adb/parser.js +269 -0
- package/dist/src/adb/parser.js.map +1 -0
- package/dist/src/adb/proc/stat.d.ts +30 -0
- package/dist/src/adb/proc/stat.d.ts.map +1 -0
- package/dist/src/adb/proc/stat.js +131 -0
- package/dist/src/adb/proc/stat.js.map +1 -0
- package/dist/src/adb/protocol.d.ts +17 -0
- package/dist/src/adb/protocol.d.ts.map +1 -0
- package/dist/src/adb/protocol.js +29 -0
- package/dist/src/adb/protocol.js.map +1 -0
- package/dist/src/adb/sync/entry.d.ts +8 -0
- package/dist/src/adb/sync/entry.d.ts.map +1 -0
- package/dist/src/adb/sync/entry.js +16 -0
- package/dist/src/adb/sync/entry.js.map +1 -0
- package/dist/src/adb/sync/pulltransfer.d.ts +10 -0
- package/dist/src/adb/sync/pulltransfer.d.ts.map +1 -0
- package/dist/src/adb/sync/pulltransfer.js +24 -0
- package/dist/src/adb/sync/pulltransfer.js.map +1 -0
- package/dist/src/adb/sync/pushtransfer.d.ts +13 -0
- package/dist/src/adb/sync/pushtransfer.d.ts.map +1 -0
- package/dist/src/adb/sync/pushtransfer.js +30 -0
- package/dist/src/adb/sync/pushtransfer.js.map +1 -0
- package/dist/src/adb/sync/stats.d.ts +23 -0
- package/dist/src/adb/sync/stats.d.ts.map +1 -0
- package/dist/src/adb/sync/stats.js +54 -0
- package/dist/src/adb/sync/stats.js.map +1 -0
- package/dist/src/adb/sync.d.ts +31 -0
- package/dist/src/adb/sync.d.ts.map +1 -0
- package/dist/src/adb/sync.js +322 -0
- package/dist/src/adb/sync.js.map +1 -0
- package/dist/src/adb/tcpusb/packet.d.ts +27 -0
- package/dist/src/adb/tcpusb/packet.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/packet.js +94 -0
- package/dist/src/adb/tcpusb/packet.js.map +1 -0
- package/dist/src/adb/tcpusb/packetreader.d.ts +26 -0
- package/dist/src/adb/tcpusb/packetreader.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/packetreader.js +100 -0
- package/dist/src/adb/tcpusb/packetreader.js.map +1 -0
- package/dist/src/adb/tcpusb/rollingcounter.d.ts +8 -0
- package/dist/src/adb/tcpusb/rollingcounter.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/rollingcounter.js +17 -0
- package/dist/src/adb/tcpusb/rollingcounter.js.map +1 -0
- package/dist/src/adb/tcpusb/server.d.ts +19 -0
- package/dist/src/adb/tcpusb/server.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/server.js +78 -0
- package/dist/src/adb/tcpusb/server.js.map +1 -0
- package/dist/src/adb/tcpusb/service.d.ts +37 -0
- package/dist/src/adb/tcpusb/service.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/service.js +173 -0
- package/dist/src/adb/tcpusb/service.js.map +1 -0
- package/dist/src/adb/tcpusb/servicemap.d.ts +10 -0
- package/dist/src/adb/tcpusb/servicemap.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/servicemap.js +42 -0
- package/dist/src/adb/tcpusb/servicemap.js.map +1 -0
- package/dist/src/adb/tcpusb/socket.d.ts +45 -0
- package/dist/src/adb/tcpusb/socket.d.ts.map +1 -0
- package/dist/src/adb/tcpusb/socket.js +284 -0
- package/dist/src/adb/tcpusb/socket.js.map +1 -0
- package/dist/src/adb/tracker.d.ts +17 -0
- package/dist/src/adb/tracker.d.ts.map +1 -0
- package/dist/src/adb/tracker.js +72 -0
- package/dist/src/adb/tracker.js.map +1 -0
- package/dist/src/adb/util.d.ts +10 -0
- package/dist/src/adb/util.d.ts.map +1 -0
- package/dist/src/adb/util.js +17 -0
- package/dist/src/adb/util.js.map +1 -0
- package/dist/src/adb.d.ts +13 -0
- package/dist/src/adb.d.ts.map +1 -0
- package/dist/src/adb.js +28 -0
- package/dist/src/adb.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +86 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/index.d.ts +19 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +12 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +53 -33
- package/.semaphore/publish.yml +0 -19
- package/.semaphore/semaphore.yml +0 -27
- package/index.js +0 -4
- package/lib/adb/auth.js +0 -78
- package/lib/adb/client.js +0 -576
- package/lib/adb/command/host/connect.js +0 -46
- package/lib/adb/command/host/devices.js +0 -64
- package/lib/adb/command/host/deviceswithpaths.js +0 -70
- package/lib/adb/command/host/disconnect.js +0 -46
- package/lib/adb/command/host/kill.js +0 -36
- package/lib/adb/command/host/trackdevices.js +0 -40
- package/lib/adb/command/host/transport.js +0 -36
- package/lib/adb/command/host/version.js +0 -42
- package/lib/adb/command/host-serial/forward.js +0 -45
- package/lib/adb/command/host-serial/getdevicepath.js +0 -38
- package/lib/adb/command/host-serial/getserialno.js +0 -38
- package/lib/adb/command/host-serial/getstate.js +0 -38
- package/lib/adb/command/host-serial/listforwards.js +0 -56
- package/lib/adb/command/host-serial/waitfordevice.js +0 -45
- package/lib/adb/command/host-transport/clear.js +0 -45
- package/lib/adb/command/host-transport/framebuffer.js +0 -114
- package/lib/adb/command/host-transport/getfeatures.js +0 -51
- package/lib/adb/command/host-transport/getpackages.js +0 -51
- package/lib/adb/command/host-transport/getproperties.js +0 -51
- package/lib/adb/command/host-transport/install.js +0 -48
- package/lib/adb/command/host-transport/isinstalled.js +0 -47
- package/lib/adb/command/host-transport/listreverses.js +0 -55
- package/lib/adb/command/host-transport/local.js +0 -36
- package/lib/adb/command/host-transport/log.js +0 -36
- package/lib/adb/command/host-transport/logcat.js +0 -48
- package/lib/adb/command/host-transport/monkey.js +0 -42
- package/lib/adb/command/host-transport/reboot.js +0 -36
- package/lib/adb/command/host-transport/remount.js +0 -36
- package/lib/adb/command/host-transport/reverse.js +0 -45
- package/lib/adb/command/host-transport/root.js +0 -46
- package/lib/adb/command/host-transport/screencap.js +0 -52
- package/lib/adb/command/host-transport/shell.js +0 -39
- package/lib/adb/command/host-transport/startactivity.js +0 -184
- package/lib/adb/command/host-transport/startservice.js +0 -33
- package/lib/adb/command/host-transport/sync.js +0 -38
- package/lib/adb/command/host-transport/tcp.js +0 -36
- package/lib/adb/command/host-transport/tcpip.js +0 -46
- package/lib/adb/command/host-transport/trackjdwp.js +0 -120
- package/lib/adb/command/host-transport/uninstall.js +0 -44
- package/lib/adb/command/host-transport/usb.js +0 -46
- package/lib/adb/command/host-transport/waitbootcomplete.js +0 -42
- package/lib/adb/command.js +0 -56
- package/lib/adb/connection.js +0 -117
- package/lib/adb/dump.js +0 -15
- package/lib/adb/framebuffer/rgbtransform.js +0 -55
- package/lib/adb/keycode.js +0 -225
- package/lib/adb/linetransform.js +0 -87
- package/lib/adb/parser.js +0 -291
- package/lib/adb/proc/stat.js +0 -137
- package/lib/adb/protocol.js +0 -45
- package/lib/adb/sync/entry.js +0 -23
- package/lib/adb/sync/pulltransfer.js +0 -31
- package/lib/adb/sync/pushtransfer.js +0 -40
- package/lib/adb/sync/stats.js +0 -54
- package/lib/adb/sync.js +0 -343
- package/lib/adb/tcpusb/packet.js +0 -112
- package/lib/adb/tcpusb/packetreader.js +0 -121
- package/lib/adb/tcpusb/rollingcounter.js +0 -21
- package/lib/adb/tcpusb/server.js +0 -79
- package/lib/adb/tcpusb/service.js +0 -203
- package/lib/adb/tcpusb/servicemap.js +0 -48
- package/lib/adb/tcpusb/socket.js +0 -312
- package/lib/adb/tracker.js +0 -89
- package/lib/adb/util.js +0 -13
- package/lib/adb.js +0 -29
- package/lib/cli.js +0 -66
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const adbkit_monkey_1 = __importDefault(require("@devicefarmer/adbkit-monkey"));
|
|
7
|
+
const adbkit_logcat_1 = __importDefault(require("@devicefarmer/adbkit-logcat"));
|
|
8
|
+
const sync_1 = __importDefault(require("./sync"));
|
|
9
|
+
const parser_1 = __importDefault(require("./parser"));
|
|
10
|
+
const stat_1 = __importDefault(require("./proc/stat"));
|
|
11
|
+
const host_1 = require("./command/host");
|
|
12
|
+
const host_transport_1 = require("./command/host-transport");
|
|
13
|
+
const host_serial_1 = require("./command/host-serial");
|
|
14
|
+
const debug_1 = __importDefault(require("debug"));
|
|
15
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
16
|
+
const debug = (0, debug_1.default)('adb:client');
|
|
17
|
+
const NoUserOptionError = (err) => err.message.indexOf('--user') !== -1;
|
|
18
|
+
class DeviceClient {
|
|
19
|
+
constructor(client, serial) {
|
|
20
|
+
this.client = client;
|
|
21
|
+
this.serial = serial;
|
|
22
|
+
// no code
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets the serial number of the device identified by the given serial number. With our API this doesn't really make much sense, but it has been implemented for completeness. _FYI: in the raw ADB protocol you can specify a device in other ways, too._
|
|
26
|
+
*
|
|
27
|
+
* @returns The serial number of the device.
|
|
28
|
+
*/
|
|
29
|
+
getSerialNo() {
|
|
30
|
+
return this.connection().then((conn) => new host_serial_1.GetSerialNoCommand(conn).execute(this.serial));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Gets the device path of the device identified by the given serial number.
|
|
34
|
+
* @returns The device path. This corresponds to the device path in `client.listDevicesWithPaths()`.
|
|
35
|
+
*/
|
|
36
|
+
getDevicePath() {
|
|
37
|
+
return this.connection().then((conn) => new host_serial_1.GetDevicePathCommand(conn).execute(this.serial));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Gets the state of the device identified by the given serial number.
|
|
41
|
+
*
|
|
42
|
+
* @returns The device state. This corresponds to the device type in `client.listDevices()`.
|
|
43
|
+
*/
|
|
44
|
+
getState() {
|
|
45
|
+
return this.connection().then((conn) => new host_serial_1.GetStateCommand(conn).execute(this.serial));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves the properties of the device identified by the given serial number. This is analogous to `adb shell getprop`.
|
|
49
|
+
*
|
|
50
|
+
* @returns An object of device properties. Each key corresponds to a device property. Convenient for accessing things like `'ro.product.model'`.
|
|
51
|
+
*/
|
|
52
|
+
getProperties() {
|
|
53
|
+
return this.transport().then((transport) => new host_transport_1.GetPropertiesCommand(transport).execute());
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the features of the device identified by the given serial number. This is analogous to `adb shell pm list features`. Useful for checking whether hardware features such as NFC are available (you'd check for `'android.hardware.nfc'`).
|
|
57
|
+
* @param [flags] Flags to pass to the `pm list packages` command to filter the list
|
|
58
|
+
* ```
|
|
59
|
+
* -d: filter to only show disabled packages
|
|
60
|
+
* -e: filter to only show enabled packages
|
|
61
|
+
* -s: filter to only show system packages
|
|
62
|
+
* -3: filter to only show third party packages
|
|
63
|
+
* ```
|
|
64
|
+
* @returns An object of device features. Each key corresponds to a device feature, with the value being either `true` for a boolean feature, or the feature value as a string (e.g. `'0x20000'` for `reqGlEsVersion`).
|
|
65
|
+
*/
|
|
66
|
+
getFeatures() {
|
|
67
|
+
return this.transport().then((transport) => new host_transport_1.GetFeaturesCommand(transport).execute());
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Retrieves the list of packages present on the device. This is analogous to `adb shell pm list packages`. If you just want to see if something's installed, consider using `client.isInstalled()` instead.
|
|
71
|
+
*
|
|
72
|
+
* @param flags TODO
|
|
73
|
+
* @returns An object of device features. Each key corresponds to a device feature, with the value being either `true` for a boolean feature, or the feature value as a string (e.g. `'0x20000'` for `reqGlEsVersion`)
|
|
74
|
+
*/
|
|
75
|
+
getPackages(flags) {
|
|
76
|
+
return this.transport().then((transport) => new host_transport_1.GetPackagesCommand(transport).execute(flags));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Attemps to retrieve the IP address of the device. Roughly analogous to `adb shell getprop dhcp.<iface>.ipaddress`.
|
|
80
|
+
*
|
|
81
|
+
* @param [iface] The network interface. Defaults to `'wlan0'`.
|
|
82
|
+
*
|
|
83
|
+
* @returns The IP address as a `String`.
|
|
84
|
+
*/
|
|
85
|
+
getDHCPIpAddress(iface = 'wlan0') {
|
|
86
|
+
return this.getProperties().then((properties) => {
|
|
87
|
+
const ip = properties[`dhcp.${iface}.ipaddress`];
|
|
88
|
+
if (ip) {
|
|
89
|
+
return ip;
|
|
90
|
+
}
|
|
91
|
+
throw Error(`Unable to find ipaddress for '${iface}'`);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Forwards socket connections from the ADB server host (local) to the device (remote). This is analogous to `adb forward <local> <remote>`. It's important to note that if you are connected to a remote ADB server, the forward will be created on that host.
|
|
96
|
+
*
|
|
97
|
+
* @param local A string representing the local endpoint on the ADB host. At time of writing, can be one of:
|
|
98
|
+
* - `tcp:<port>`
|
|
99
|
+
* - `localabstract:<unix domain socket name>`
|
|
100
|
+
* - `localreserved:<unix domain socket name>`
|
|
101
|
+
* - `localfilesystem:<unix domain socket name>`
|
|
102
|
+
* - `dev:<character device name>`
|
|
103
|
+
* @param remote A string representing the remote endpoint on the device. At time of writing, can be one of:
|
|
104
|
+
* Any value accepted by the `local` argument
|
|
105
|
+
* `jdwp:<process pid>`
|
|
106
|
+
* @returns true
|
|
107
|
+
*/
|
|
108
|
+
forward(local, remote) {
|
|
109
|
+
return this.connection().then((conn) => new host_serial_1.ForwardCommand(conn).execute(this.serial, local, remote));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Lists forwarded connections on the device. This is analogous to `adb forward --list`.
|
|
113
|
+
*
|
|
114
|
+
* @returns An array of forward objects with the following properties:
|
|
115
|
+
* - **serial** The device serial.
|
|
116
|
+
* - **local** The local endpoint. Same format as `client.forward()`'s `local` argument.
|
|
117
|
+
* - **remote** The remote endpoint on the device. Same format as `client.forward()`'s `remote` argument.
|
|
118
|
+
*/
|
|
119
|
+
listForwards() {
|
|
120
|
+
return this.connection().then((conn) => new host_serial_1.ListForwardsCommand(conn).execute(this.serial));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Reverses socket connections from the device (remote) to the ADB server host (local). This is analogous to `adb reverse <remote> <local>`. It's important to note that if you are connected to a remote ADB server, the reverse will be created on that host.
|
|
124
|
+
* @param remote A string representing the remote endpoint on the device. At time of writing, can be one of:
|
|
125
|
+
* - `tcp:<port>`
|
|
126
|
+
* - `localabstract:<unix domain socket name>`
|
|
127
|
+
* - `localreserved:<unix domain socket name>`
|
|
128
|
+
* - `localfilesystem:<unix domain socket name>`
|
|
129
|
+
* @param local A string representing the local endpoint on the ADB host. At time of writing, can be any value accepted by the `remote` argument.
|
|
130
|
+
*/
|
|
131
|
+
reverse(remote, local) {
|
|
132
|
+
return this.transport().then((transport) => new host_transport_1.ReverseCommand(transport).execute(remote, local));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Lists forwarded connections on the device. This is analogous to `adb reverse --list`.
|
|
136
|
+
*
|
|
137
|
+
* @returns An array of Reverse objects with the following properties:
|
|
138
|
+
* - **remote** The remote endpoint on the device. Same format as `client.reverse()`'s `remote` argument.
|
|
139
|
+
* - **local** The local endpoint on the host. Same format as `client.reverse()`'s `local` argument.
|
|
140
|
+
*/
|
|
141
|
+
listReverses() {
|
|
142
|
+
return this.transport().then((transport) => new host_transport_1.ListReversesCommand(transport).execute());
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* return a new connection to ADB.
|
|
146
|
+
*/
|
|
147
|
+
connection() {
|
|
148
|
+
return this.client.connection();
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* return a new connextion to the current Host devices
|
|
152
|
+
*/
|
|
153
|
+
transport() {
|
|
154
|
+
return this.connection().then((conn) => new host_1.HostTransportCommand(conn).execute(this.serial).return(conn));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Runs a shell command on the device. Note that you'll be limited to the permissions of the `shell` user, which ADB uses.
|
|
158
|
+
*
|
|
159
|
+
* @param command The shell command to execute. When `String`, the command is run as-is. When `Array`, the elements will be rudimentarily escaped (for convenience, not security) and joined to form a command.
|
|
160
|
+
*
|
|
161
|
+
* @returns A readable stream (`Socket` actually) containing the progressive `stdout` of the command. Use with `adb.util.readAll` to get a readable String from it.
|
|
162
|
+
*/
|
|
163
|
+
shell(command) {
|
|
164
|
+
return this.transport().then((transport) => new host_transport_1.ShellCommand(transport).execute(command));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Puts the device into root mode which may be needed by certain shell commands. A remount is generally required after a successful root call. **Note that this will only work if your device supports this feature. Production devices almost never do.**
|
|
168
|
+
*
|
|
169
|
+
* @return true
|
|
170
|
+
*/
|
|
171
|
+
reboot() {
|
|
172
|
+
return this.transport().then((transport) => new host_transport_1.RebootCommand(transport).execute());
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Attempts to remount the `/system` partition in read-write mode. This will usually only work on emulators and developer devices.
|
|
176
|
+
*
|
|
177
|
+
* @returns true
|
|
178
|
+
*/
|
|
179
|
+
remount() {
|
|
180
|
+
return this.transport().then((transport) => new host_transport_1.RemountCommand(transport).execute());
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Puts the device into root mode which may be needed by certain shell commands. A remount is generally required after a successful root call. **Note that this will only work if your device supports this feature. Production devices almost never do.**
|
|
184
|
+
*
|
|
185
|
+
* @return true
|
|
186
|
+
*/
|
|
187
|
+
root() {
|
|
188
|
+
return this.transport().then((transport) => new host_transport_1.RootCommand(transport).execute());
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Starts a JDWP tracker for the given device.
|
|
192
|
+
*
|
|
193
|
+
* Note that as the tracker will keep a connection open, you must call `tracker.end()` if you wish to stop tracking JDWP processes.
|
|
194
|
+
*
|
|
195
|
+
* @returns The JDWP tracker, which is an [`EventEmitter`][node-events]. The following events are available:
|
|
196
|
+
* - **add** **(pid)** Emitted when a new JDWP process becomes available, once per pid.
|
|
197
|
+
* - **remove** **(pid)** Emitted when a JDWP process becomes unavailable, once per pid.
|
|
198
|
+
* - **changeSet** **(changes, pids)** All changes in a single event.
|
|
199
|
+
* - **changes** An object with the following properties always present:
|
|
200
|
+
* - **added** An array of pids that were added. Empty if none.
|
|
201
|
+
* - **removed** An array of pids that were removed. Empty if none.
|
|
202
|
+
* - **pids** All currently active pids (including pids from previous runs).
|
|
203
|
+
* - **end** Emitted when the underlying connection ends.
|
|
204
|
+
* - **error** **(err)** Emitted if there's an error.
|
|
205
|
+
*/
|
|
206
|
+
trackJdwp() {
|
|
207
|
+
return this.transport().then((transport) => new host_transport_1.TrackJdwpCommand(transport).execute());
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Fetches the current **raw** framebuffer (i.e. what is visible on the screen) from the device, and optionally converts it into something more usable by using [GraphicsMagick][graphicsmagick]'s `gm` command, which must be available in `$PATH` if conversion is desired. Note that we don't bother supporting really old framebuffer formats such as RGB_565. If for some mysterious reason you happen to run into a `>=2.3` device that uses RGB_565, let us know.
|
|
211
|
+
*
|
|
212
|
+
* Note that high-resolution devices can have quite massive framebuffers. For example, a device with a resolution of 1920x1080 and 32 bit colors would have a roughly 8MB (`1920*1080*4` byte) RGBA framebuffer. Empirical tests point to about 5MB/s bandwidth limit for the ADB USB connection, which means that it can take ~1.6 seconds for the raw data to arrive, or even more if the USB connection is already congested. Using a conversion will further slow down completion.
|
|
213
|
+
*
|
|
214
|
+
* @param format The desired output format. Any output format supported by [GraphicsMagick][graphicsmagick] (such as `'png'`) is supported. Defaults to `'raw'` for raw framebuffer data.
|
|
215
|
+
*
|
|
216
|
+
* @returns The possibly converted framebuffer stream. The stream also has a `meta`.:
|
|
217
|
+
*/
|
|
218
|
+
framebuffer(format = 'raw') {
|
|
219
|
+
return this.transport().then((transport) => new host_transport_1.FrameBufferCommand(transport).execute(format));
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Takes a screenshot in PNG format using the built-in `screencap` utility. This is analogous to `adb shell screencap -p`. Sadly, the utility is not available on most Android `<=2.3` devices, but a silent fallback to the `client.framebuffer()` command in PNG mode is attempted, so you should have its dependencies installed just in case.
|
|
223
|
+
*
|
|
224
|
+
* Generating the PNG on the device naturally requires considerably more processing time on that side. However, as the data transferred over USB easily decreases by ~95%, and no conversion being required on the host, this method is usually several times faster than using the framebuffer. Naturally, this benefit does not apply if we're forced to fall back to the framebuffer.
|
|
225
|
+
*
|
|
226
|
+
* For convenience purposes, if the screencap command fails (e.g. because it doesn't exist on older Androids), we fall back to `client.framebuffer(serial, 'png')`, which is slower and has additional installation requirements.
|
|
227
|
+
*
|
|
228
|
+
* @return The PNG stream.
|
|
229
|
+
*/
|
|
230
|
+
screencap() {
|
|
231
|
+
return this.transport().then((transport) => new host_transport_1.ScreencapCommand(transport).execute().catch((err) => {
|
|
232
|
+
debug(`Emulating screencap command due to '${err}'`);
|
|
233
|
+
return this.framebuffer('png');
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Opens a direct connection to a unix domain socket in the given path.
|
|
238
|
+
*
|
|
239
|
+
* @param path The path to the socket. Prefixed with `'localfilesystem:'` by default, include another prefix (e.g. `'localabstract:'`) in the path to override.
|
|
240
|
+
*
|
|
241
|
+
* @returns The connection (i.e. [`net.Socket`][node-net]). Read and write as you please. Call `conn.end()` to end the connection.
|
|
242
|
+
*/
|
|
243
|
+
openLocal(path) {
|
|
244
|
+
return this.transport().then((transport) => new host_transport_1.LocalCommand(transport).execute(path));
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Opens a direct connection to a binary log file, providing access to the raw log data. Note that it is usually much more convenient to use the `client.openLogcat()` method, described separately.
|
|
248
|
+
*
|
|
249
|
+
* @param name The name of the log. Available logs include `'main'`, `'system'`, `'radio'` and `'events'`.
|
|
250
|
+
*
|
|
251
|
+
* @returns The binary log stream. Call `log.end()` when you wish to stop receiving data.
|
|
252
|
+
*/
|
|
253
|
+
openLog(name) {
|
|
254
|
+
return this.transport().then((transport) => new host_transport_1.LogCommand(transport).execute(name));
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Opens a direct TCP connection to a port on the device, without any port forwarding required.
|
|
258
|
+
|
|
259
|
+
* @param port The port number to connect to.
|
|
260
|
+
* @param host Optional. The host to connect to. Allegedly this is supposed to establish a connection to the given host from the device, but we have not been able to get it to work at all. Skip the host and everything works great.
|
|
261
|
+
*
|
|
262
|
+
* @returns The TCP connection (i.e. [`net.Socket`][node-net]). Read and write as you please. Call `conn.end()` to end the connection.
|
|
263
|
+
*/
|
|
264
|
+
openTcp(port, host) {
|
|
265
|
+
return this.transport().then((transport) => new host_transport_1.TcpCommand(transport).execute(port, host));
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Starts the built-in `monkey` utility on the device, connects to it using `client.openTcp()` and hands the connection to [adbkit-monkey][adbkit-monkey], a pure Node.js Monkey client. This allows you to create touch and key events, among other things.
|
|
269
|
+
*
|
|
270
|
+
* For more information, check out the [adbkit-monkey][adbkit-monkey] documentation.
|
|
271
|
+
*
|
|
272
|
+
* @param port Optional. The device port where you'd like Monkey to run at. Defaults to `1080`.
|
|
273
|
+
*
|
|
274
|
+
* @returns The Monkey client. Please see the [adbkit-monkey][adbkit-monkey] documentation for details.
|
|
275
|
+
*/
|
|
276
|
+
openMonkey(port = 1080) {
|
|
277
|
+
const tryConnect = (times) => {
|
|
278
|
+
return this.openTcp(port)
|
|
279
|
+
.then((stream) => adbkit_monkey_1.default.connectStream(stream))
|
|
280
|
+
.catch((err) => {
|
|
281
|
+
if ((times -= 1)) {
|
|
282
|
+
debug(`Monkey can't be reached, trying ${times} more times`);
|
|
283
|
+
return bluebird_1.default.delay(100).then(() => tryConnect(times));
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
throw err;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
return tryConnect(1).catch(() => {
|
|
291
|
+
return this.transport()
|
|
292
|
+
.then((transport) => new host_transport_1.MonkeyCommand(transport).execute(port))
|
|
293
|
+
.then((out) => tryConnect(20).then((monkey) => monkey.once('end', () => out.end())));
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Calls the `logcat` utility on the device and hands off the connection to [adbkit-logcat][adbkit-logcat], a pure Node.js Logcat client. This is analogous to `adb logcat -B`, but the event stream will be parsed for you and a separate event will be emitted for every log entry, allowing for easy processing.
|
|
298
|
+
*
|
|
299
|
+
* For more information, check out the [adbkit-logcat][adbkit-logcat] documentation.
|
|
300
|
+
*
|
|
301
|
+
* @param options Optional. The following options are supported:
|
|
302
|
+
* - **clear** When `true`, clears logcat before opening the reader. Not set by default.
|
|
303
|
+
*
|
|
304
|
+
* @returns The Logcat client. Please see the [adbkit-logcat][adbkit-logcat] documentation for details.
|
|
305
|
+
*/
|
|
306
|
+
openLogcat(options = {}) {
|
|
307
|
+
return this.transport()
|
|
308
|
+
.then((transport) => new host_transport_1.LogcatCommand(transport).execute(options))
|
|
309
|
+
.then((stream) => adbkit_logcat_1.default.readStream(stream, { fixLineFeeds: false }));
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Tracks `/proc/stat` and emits useful information, such as CPU load. A single sync service instance is used to download the `/proc/stat` file for processing. While doing this does consume some resources, it is very light and should not be a problem.
|
|
313
|
+
*
|
|
314
|
+
* @returns The `/proc/stat` tracker, which is an [`EventEmitter`][node-events]. Call `stat.end()` to stop tracking. The following events are available:
|
|
315
|
+
* - **load** **(loads)** Emitted when a CPU load calculation is available.
|
|
316
|
+
* - **loads** CPU loads of **online** CPUs. Each key is a CPU id (e.g. `'cpu0'`, `'cpu1'`) and the value an object with the following properties:
|
|
317
|
+
* - **user** Percentage (0-100) of ticks spent on user programs.
|
|
318
|
+
* - **nice** Percentage (0-100) of ticks spent on `nice`d user programs.
|
|
319
|
+
* - **system** Percentage (0-100) of ticks spent on system programs.
|
|
320
|
+
* - **idle** Percentage (0-100) of ticks spent idling.
|
|
321
|
+
* - **iowait** Percentage (0-100) of ticks spent waiting for IO.
|
|
322
|
+
* - **irq** Percentage (0-100) of ticks spent on hardware interrupts.
|
|
323
|
+
* - **softirq** Percentage (0-100) of ticks spent on software interrupts.
|
|
324
|
+
* - **steal** Percentage (0-100) of ticks stolen by others.
|
|
325
|
+
* - **guest** Percentage (0-100) of ticks spent by a guest.
|
|
326
|
+
* - **guestnice** Percentage (0-100) of ticks spent by a `nice`d guest.
|
|
327
|
+
* - **total** Total. Always 100.
|
|
328
|
+
*/
|
|
329
|
+
openProcStat() {
|
|
330
|
+
return this.syncService().then((sync) => new stat_1.default(sync));
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Deletes all data associated with a package from the device. This is roughly analogous to `adb shell pm clear <pkg>`.
|
|
334
|
+
*
|
|
335
|
+
* @param pkg The package name. This is NOT the APK.
|
|
336
|
+
*
|
|
337
|
+
* @returns true
|
|
338
|
+
*/
|
|
339
|
+
clear(pkg) {
|
|
340
|
+
return this.transport().then((transport) => new host_transport_1.ClearCommand(transport).execute(pkg));
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Installs the APK on the device, replacing any previously installed version. This is roughly analogous to `adb install -r <apk>`.
|
|
344
|
+
*
|
|
345
|
+
* Note that if the call seems to stall, you may have to accept a dialog on the phone first.
|
|
346
|
+
*
|
|
347
|
+
* @param apk When `String`, interpreted as a path to an APK file. When [`Stream`][node-stream], installs directly from the stream, which must be a valid APK.
|
|
348
|
+
* @returns true
|
|
349
|
+
*/
|
|
350
|
+
install(apk) {
|
|
351
|
+
const temp = sync_1.default.temp(typeof apk === 'string' ? apk : '_stream.apk');
|
|
352
|
+
return this.push(apk, temp).then((transfer) => {
|
|
353
|
+
let endListener;
|
|
354
|
+
let errorListener;
|
|
355
|
+
return new bluebird_1.default((resolve, reject) => {
|
|
356
|
+
errorListener = (err) => reject(err);
|
|
357
|
+
endListener = () => this.installRemote(temp).then((value) => resolve(value));
|
|
358
|
+
transfer.on('error', errorListener);
|
|
359
|
+
transfer.on('end', endListener);
|
|
360
|
+
}).finally(() => {
|
|
361
|
+
transfer.removeListener('error', errorListener);
|
|
362
|
+
transfer.removeListener('end', endListener);
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Installs an APK file which must already be located on the device file system, and replaces any previously installed version. Useful if you've previously pushed the file to the device for some reason (perhaps to have direct access to `client.push()`'s transfer stats). This is roughly analogous to `adb shell pm install -r <apk>` followed by `adb shell rm -f <apk>`.
|
|
368
|
+
*
|
|
369
|
+
* Note that if the call seems to stall, you may have to accept a dialog on the phone first.
|
|
370
|
+
*
|
|
371
|
+
* @param apk The path to the APK file on the device. The file will be removed when the command completes.
|
|
372
|
+
* @returns true
|
|
373
|
+
*/
|
|
374
|
+
installRemote(apk) {
|
|
375
|
+
return this.transport().then((transport) => {
|
|
376
|
+
return new host_transport_1.InstallCommand(transport)
|
|
377
|
+
.execute(apk)
|
|
378
|
+
.then(() => this.shell(['rm', '-f', apk]))
|
|
379
|
+
.then((stream) => new parser_1.default(stream).readAll())
|
|
380
|
+
.then(() => true);
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Uninstalls the package from the device. This is roughly analogous to `adb uninstall <pkg>`.
|
|
385
|
+
*
|
|
386
|
+
* @param pkg The package name. This is NOT the APK.
|
|
387
|
+
* @returns true
|
|
388
|
+
*/
|
|
389
|
+
uninstall(pkg) {
|
|
390
|
+
return this.transport().then((transport) => new host_transport_1.UninstallCommand(transport).execute(pkg));
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Tells you if the specific package is installed or not. This is analogous to `adb shell pm path <pkg>` and some output parsing.
|
|
394
|
+
*
|
|
395
|
+
* @param pkg The package name. This is NOT the APK.
|
|
396
|
+
*
|
|
397
|
+
* @returns `true` if the package is installed, `false` otherwise.
|
|
398
|
+
*/
|
|
399
|
+
isInstalled(pkg) {
|
|
400
|
+
return this.transport().then((transport) => new host_transport_1.IsInstalledCommand(transport).execute(pkg));
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Starts the configured activity on the device. Roughly analogous to `adb shell am start <options>`.
|
|
404
|
+
*
|
|
405
|
+
* @param options The activity configuration.
|
|
406
|
+
*/
|
|
407
|
+
startActivity(options) {
|
|
408
|
+
return this.transport()
|
|
409
|
+
.then((transport) => new host_transport_1.StartActivityCommand(transport).execute(options))
|
|
410
|
+
.catch(NoUserOptionError, () => {
|
|
411
|
+
options.user = undefined;
|
|
412
|
+
return this.startActivity(options);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Starts the configured service on the device. Roughly analogous to `adb shell am startservice <options>`.
|
|
417
|
+
* @param options The activity configuration.
|
|
418
|
+
*/
|
|
419
|
+
startService(options) {
|
|
420
|
+
return this.transport()
|
|
421
|
+
.then((transport) => {
|
|
422
|
+
if (!(options.user || options.user === null)) {
|
|
423
|
+
options.user = 0;
|
|
424
|
+
}
|
|
425
|
+
return new host_transport_1.StartServiceCommand(transport).execute(options);
|
|
426
|
+
})
|
|
427
|
+
.catch(NoUserOptionError, () => {
|
|
428
|
+
options.user = undefined;
|
|
429
|
+
return this.startService(options);
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Establishes a new Sync connection that can be used to push and pull files. This method provides the most freedom and the best performance for repeated use, but can be a bit cumbersome to use. For simple use cases, consider using `client.stat()`, `client.push()` and `client.pull()`.
|
|
434
|
+
*
|
|
435
|
+
* @returns The Sync client. See below for details. Call `sync.end()` when done.
|
|
436
|
+
*/
|
|
437
|
+
syncService() {
|
|
438
|
+
return this.transport().then((transport) => new host_transport_1.SyncCommand(transport).execute());
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Retrieves information about the given path.
|
|
442
|
+
*
|
|
443
|
+
* @param path The path.
|
|
444
|
+
*
|
|
445
|
+
* @returns An [`fs.Stats`][node-fs-stats] instance. While the `stats.is*` methods are available, only the following properties are supported:
|
|
446
|
+
- **mode** The raw mode.
|
|
447
|
+
- **size** The file size.
|
|
448
|
+
- **mtime** The time of last modification as a `Date`.
|
|
449
|
+
*/
|
|
450
|
+
stat(path) {
|
|
451
|
+
return this.syncService().then((sync) => sync.stat(path).finally(() => sync.end()));
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* A convenience shortcut for `sync.readdir()`, mainly for one-off use cases. The connection cannot be reused, resulting in poorer performance over multiple calls. However, the Sync client will be closed automatically for you, so that's one less thing to worry about.
|
|
455
|
+
*
|
|
456
|
+
* @param path See `sync.readdir()` for details.
|
|
457
|
+
* @returns Files Lists
|
|
458
|
+
*/
|
|
459
|
+
readdir(path) {
|
|
460
|
+
return this.syncService().then((sync) => sync.readdir(path).finally(() => sync.end()));
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* A convenience shortcut for `sync.pull()`, mainly for one-off use cases. The connection cannot be reused, resulting in poorer performance over multiple calls. However, the Sync client will be closed automatically for you, so that's one less thing to worry about.
|
|
464
|
+
*
|
|
465
|
+
* @param path See `sync.pull()` for details.
|
|
466
|
+
*
|
|
467
|
+
* @returns A `PullTransfer` instance.
|
|
468
|
+
*/
|
|
469
|
+
pull(path) {
|
|
470
|
+
return this.syncService().then((sync) => sync.pull(path).on('end', () => sync.end()));
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* A convenience shortcut for `sync.push()`, mainly for one-off use cases. The connection cannot be reused, resulting in poorer performance over multiple calls. However, the Sync client will be closed automatically for you, so that's one less thing to worry about.
|
|
474
|
+
*
|
|
475
|
+
* @param contents See `sync.push()` for details.
|
|
476
|
+
* @param path See `sync.push()` for details.
|
|
477
|
+
* @param mode See `sync.push()` for details.
|
|
478
|
+
*/
|
|
479
|
+
push(contents, path, mode) {
|
|
480
|
+
return this.syncService().then((sync) => sync.push(contents, path, mode).on('end', () => sync.end()));
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Puts the device's ADB daemon into tcp mode, allowing you to use `adb connect` or `client.connect()` to connect to it. Note that the device will still be visible to ADB as a regular USB-connected device until you unplug it. Same as `adb tcpip <port>`.
|
|
484
|
+
*
|
|
485
|
+
* @param port Optional. The port the device should listen on. Defaults to `5555`.
|
|
486
|
+
* @returns The port the device started listening on.
|
|
487
|
+
*/
|
|
488
|
+
tcpip(port = 5555) {
|
|
489
|
+
return this.transport().then((transport) => new host_transport_1.TcpIpCommand(transport).execute(port));
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Puts the device's ADB daemon back into USB mode. Reverses `client.tcpip()`. Same as `adb usb`.
|
|
493
|
+
*
|
|
494
|
+
* @returns true
|
|
495
|
+
*/
|
|
496
|
+
usb() {
|
|
497
|
+
return this.transport().then((transport) => new host_transport_1.UsbCommand(transport).execute());
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Waits until the device has finished booting. Note that the device must already be seen by ADB. This is roughly analogous to periodically checking `adb shell getprop sys.boot_completed`.
|
|
501
|
+
*
|
|
502
|
+
* @returns true
|
|
503
|
+
*/
|
|
504
|
+
waitBootComplete() {
|
|
505
|
+
return this.transport().then((transport) => new host_transport_1.WaitBootCompleteCommand(transport).execute());
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Waits until ADB can see the device. Note that you must know the serial in advance. Other than that, works like `adb -s serial wait-for-device`. If you're planning on reacting to random devices being plugged in and out, consider using `client.trackDevices()` instead.
|
|
509
|
+
*
|
|
510
|
+
* @returns The device ID. Can be useful for chaining.
|
|
511
|
+
*/
|
|
512
|
+
waitForDevice() {
|
|
513
|
+
return this.connection().then((conn) => new host_serial_1.WaitForDeviceCommand(conn).execute(this.serial));
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
exports.default = DeviceClient;
|
|
517
|
+
//# sourceMappingURL=DeviceClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceClient.js","sourceRoot":"","sources":["../../../src/adb/DeviceClient.ts"],"names":[],"mappings":";;;;;AAAA,gFAAiD;AACjD,gFAAiD;AAEjD,kDAA0B;AAC1B,sDAA8B;AAC9B,uDAAmC;AAEnC,yCAAsD;AACtD,6DA4BkC;AAClC,uDAO+B;AAC/B,kDAAsB;AAKtB,wDAAgC;AAehC,MAAM,KAAK,GAAG,IAAA,eAAC,EAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,iBAAiB,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAE/E,MAAqB,YAAY;IAC/B,YAA4B,MAAc,EAAkB,MAAc;QAA9C,WAAM,GAAN,MAAM,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAQ;QACxE,UAAU;IACZ,CAAC;IAED;;;;OAIG;IACI,WAAW;QAChB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,gCAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED;;;OAGG;IACI,aAAa;QAClB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,C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wCAAuB,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;OAIG;IACI,aAAa;QAClB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,kCAAoB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/F,CAAC;CACF;AAxhBD,+BAwhBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ExtendedPublicKey from '../ExtendedPublicKey';
|
|
2
|
+
import Bluebird from 'bluebird';
|
|
3
|
+
export default class Auth {
|
|
4
|
+
private static RE;
|
|
5
|
+
static parsePublicKey(buffer: string): Bluebird<ExtendedPublicKey>;
|
|
6
|
+
private static readPublicKeyFromStruct;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/adb/auth.ts"],"names":[],"mappings":"AAiBA,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAIhC,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAuF;WAC1F,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,iBAAiB,CAAC;IAazE,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAgDvC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
The stucture of an ADB RSAPublicKey is as follows:
|
|
4
|
+
|
|
5
|
+
#define RSANUMBYTES 256 // 2048 bit key length
|
|
6
|
+
#define RSANUMWORDS (RSANUMBYTES / sizeof(uint32_t))
|
|
7
|
+
|
|
8
|
+
typedef struct RSAPublicKey {
|
|
9
|
+
int len; // Length of n[] in number of uint32_t
|
|
10
|
+
uint32_t n0inv; // -1 / n[0] mod 2^32
|
|
11
|
+
uint32_t n[RSANUMWORDS]; // modulus as little endian array
|
|
12
|
+
uint32_t rr[RSANUMWORDS]; // R^2 as little endian array
|
|
13
|
+
int exponent; // 3 or 65537
|
|
14
|
+
} RSAPublicKey;
|
|
15
|
+
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const node_forge_1 = __importDefault(require("node-forge"));
|
|
22
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
23
|
+
const BigInteger = node_forge_1.default.jsbn.BigInteger;
|
|
24
|
+
class Auth {
|
|
25
|
+
static parsePublicKey(buffer) {
|
|
26
|
+
return new bluebird_1.default(function (resolve, reject) {
|
|
27
|
+
const match = Auth.RE.exec(buffer);
|
|
28
|
+
if (match) {
|
|
29
|
+
const struct = Buffer.from(match[1], 'base64');
|
|
30
|
+
const comment = match[2].trim();
|
|
31
|
+
return resolve(Auth.readPublicKeyFromStruct(struct, comment));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return reject(new Error('Unrecognizable public key format'));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
static readPublicKeyFromStruct(struct, comment) {
|
|
39
|
+
if (!struct.length) {
|
|
40
|
+
throw new Error('Invalid public key');
|
|
41
|
+
}
|
|
42
|
+
// Keep track of what we've read already
|
|
43
|
+
let offset = 0;
|
|
44
|
+
// Get len
|
|
45
|
+
const len = struct.readUInt32LE(offset) * 4;
|
|
46
|
+
offset += 4;
|
|
47
|
+
if (struct.length !== 4 + 4 + len + len + 4) {
|
|
48
|
+
throw new Error('Invalid public key');
|
|
49
|
+
}
|
|
50
|
+
// Skip n0inv, we don't need it
|
|
51
|
+
offset += 4;
|
|
52
|
+
// Get n
|
|
53
|
+
const n = Buffer.alloc(len);
|
|
54
|
+
struct.copy(n, 0, offset, offset + len);
|
|
55
|
+
[].reverse.call(n);
|
|
56
|
+
offset += len;
|
|
57
|
+
// Skip rr, we don't need it
|
|
58
|
+
offset += len;
|
|
59
|
+
// Get e
|
|
60
|
+
const e = struct.readUInt32LE(offset);
|
|
61
|
+
if (!(e === 3 || e === 65537)) {
|
|
62
|
+
throw new Error(`Invalid exponent ${e}, only 3 and 65537 are supported`);
|
|
63
|
+
}
|
|
64
|
+
// FIXME: bug in @types/node-forge
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
const modulus = new BigInteger(n.toString('hex'), 16);
|
|
68
|
+
// FIXME: bug in @types/node-forge
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
const exponent = new BigInteger(e.toString(), 10);
|
|
72
|
+
// Restore the public key
|
|
73
|
+
const key = node_forge_1.default.pki.rsa.setPublicKey(modulus, exponent);
|
|
74
|
+
// It will be difficult to retrieve the fingerprint later as it's based
|
|
75
|
+
// on the complete struct data, so let's just extend the key with it.
|
|
76
|
+
const md = node_forge_1.default.md.md5.create();
|
|
77
|
+
md.update(struct.toString('binary'));
|
|
78
|
+
const extendedKey = key;
|
|
79
|
+
extendedKey.fingerprint = md.digest().toHex().match(/../g).join(':');
|
|
80
|
+
// Expose comment for the same reason
|
|
81
|
+
extendedKey.comment = comment;
|
|
82
|
+
return extendedKey;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.default = Auth;
|
|
86
|
+
Auth.RE = /^((?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?)\0?( .*|)\s*$/;
|
|
87
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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