java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.android.adb.AndroidDeviceUtil |
Useful routines when debugging Android devices.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AndroidDeviceUtil() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static boolean |
executeCommandAsRoot(AdbWrapper adb, boolean rootVerification, String command)
Attempt to execute a single ADB command as root.
| ||||||||||
static boolean |
executeCommandAsRoot(AdbWrapper adb, String command)
Attempt to execute a single ADB command as root, with a prior root verification.
| ||||||||||
static boolean |
executeCommandsAsRoot(AdbWrapper adb, boolean rootVerification, String[] commands)
Attempt to execute a sequence of ADB commands as root.
| ||||||||||
static boolean |
executeCommandsAsRoot(AdbWrapper adb, String[] commands)
Attempt to execute a sequence of ADB commands as root, with a prior root verification.
| ||||||||||
static int |
getAndroidApiLevel(AdbWrapper adb)
Retrieve the numerical API level (eg, 29 on Android Q) of the target.
| ||||||||||
static AndroidPlatformABI |
getBestABIForApp(AdbWrapper adb, IApkUnit apk)
Get the best ABI to run a given Android app on a given device.
| ||||||||||
static AndroidPlatformABI |
getPreferredABI(AdbWrapper adb)
Get the preferred ABI supported by a device.
| ||||||||||
static List<Integer> |
getProcessesByName(AdbWrapper adb, String processName)
Get a list of PIDs by process name
| ||||||||||
static List<AndroidPlatformABI> |
getSupportedABIs(AdbWrapper adb)
Get the ABIs supported by a device.
| ||||||||||
static boolean |
isDebuggableApp(AdbWrapper adb, String pname)
Determine whether an installed app is debuggable.
| ||||||||||
static boolean |
isRootDevice(AdbWrapper adb)
Heuristic to determine if the device appears to be rooted - and has a copy of
su
installed. | ||||||||||
static boolean |
pullFile(AdbWrapper adb, String remotePath, String localPath)
Attempt to pull a file from a device using a variety of methods.
| ||||||||||
static String |
uploadFileToDeviceTemp(AdbWrapper adb, String name, AndroidPlatformABI platformAbi, String version, String extension)
Upload a JEB Android asset file to an Android device.
| ||||||||||
static String |
uploadFileToDeviceTemp(AdbWrapper adb, String name, AndroidPlatformABI platformAbi)
Upload a JEB Android asset file to an Android device.@return
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Attempt to execute a single ADB command as root.
AdbException |
---|
Attempt to execute a single ADB command as root, with a prior root verification.
AdbException |
---|
Attempt to execute a sequence of ADB commands as root.
AdbException |
---|
Attempt to execute a sequence of ADB commands as root, with a prior root verification.
AdbException |
---|
Retrieve the numerical API level (eg, 29 on Android Q) of the target.
Get the best ABI to run a given Android app on a given device. This method is a heuristic and may fail.
Get the preferred ABI supported by a device.
Get a list of PIDs by process name
Get the ABIs supported by a device.
Determine whether an installed app is debuggable. An app is debuggable if its manifest has the 'debuggable' attribute explicitly set to true.
pname | application package name |
---|
Heuristic to determine if the device appears to be rooted - and has a copy of su
installed.
Attempt to pull a file from a device using a variety of methods. Ultimately, if the device is rooted, this method may resort to using super-user capabilities to download the file.
remotePath | file path on device |
---|---|
localPath | local destination path |
Upload a JEB Android asset file to an Android device.
adb | mandatory |
---|---|
name | mandatory |
platformAbi | optional |
version | optional |
extension | optional |
platform/version/extension
informationIOException |
---|
Upload a JEB Android asset file to an Android device.@return
IOException |
---|