Interface IEmulatedAndroid
public interface IEmulatedAndroid
Interface for a simple Android OS environment.
-
Method Summary
Modifier and TypeMethodDescriptioncallInternal(int functionId, Object... params) Internal routine.voiddispose()Dispose the resources used by this object.intRetrieve the emulated Android SDK API level.Retrieve the emulated Android architecture.intRetrieve the emulated Android version.getApk()Convenience method.Retrieve the APK path on the emulated device.Retrieve the app's data folder for the current user on the emulated device.Retrieve the application folder on the emulated device.Convenience method.getDex()Convenience method.Retrieve the shared dropbox folder.Retrieve the Java properties object of the emulated app.Convenience method to retrieve the path to the local APK file (in the JEB project, that is, the file backing up theIApkUnitattached to this object).getLocalApkFile(int what) Retrieve a specific APK file.Convenience method.Convenience method.intGet the emulated process id (PID).getState()Retrieve thedexdecemulator state attached to this object.Retrieve the system properties of the emulated process.intGet the emulated Android user id.invokeMethod(DInvokeType invoketype, String msig, List<IDExpression> args) Convenience method wrapping around thedex emulatorto emulate a method.voidsetLocalApkFile(int what, File file) Set a local APK file override.
-
Method Details
-
dispose
void dispose()Dispose the resources used by this object. -
getAndroidVersion
int getAndroidVersion()Retrieve the emulated Android version.- Returns:
- the standard implementation currently returns 13
-
getAndroidApiLevel
int getAndroidApiLevel()Retrieve the emulated Android SDK API level.- Returns:
- the standard implementation currently returns 33
-
getAndroidPlatformABI
AndroidPlatformABI getAndroidPlatformABI()Retrieve the emulated Android architecture.- Returns:
- the standard implementation currently returns
aarch64
-
getState
IDState getState()Retrieve thedexdecemulator state attached to this object. The emulator state is an entry-point into dex emulation facility as well as native code emulation.- Returns:
- the emulator state
-
getApk
IApkUnit getApk()Convenience method.- Returns:
- the emulated APK unit
-
getDex
IDexUnit getDex()Convenience method.- Returns:
- the emulated Dex unit
-
getDecompiler
IDexDecompilerUnit getDecompiler()Convenience method.- Returns:
- the attached Dex decompiler unit
-
getPackageName
String getPackageName()Convenience method.- Returns:
- the app's package name (e.g.
com.myapp)
-
getMainActivity
String getMainActivity()Convenience method.- Returns:
- the app's main activity class internal signature (e.g.
Lcom/myapp/MainActivity;, or null if there is no main activity
-
getAppFolder
String getAppFolder()Retrieve the application folder on the emulated device.- Returns:
- the application folder path
-
getApkPath
String getApkPath()Retrieve the APK path on the emulated device.- Returns:
- the APK path
-
getAppDataFolder
String getAppDataFolder()Retrieve the app's data folder for the current user on the emulated device.- Returns:
- the application data folder path
-
getLocalApkFile
File getLocalApkFile()Convenience method to retrieve the path to the local APK file (in the JEB project, that is, the file backing up theIApkUnitattached to this object).- Returns:
- the local APK file
-
setLocalApkFile
Set a local APK file override.- Parameters:
what- only 1 (base.apk) or 2 (split_config.arm64_v8a.apk) is accepted, refer togetLocalApkFile(int)for detailsfile- an APK file
-
getLocalApkFile
Retrieve a specific APK file.- Parameters:
what- 0: the apk as returned bygetLocalApkFile()
1: the actual true primary APK, if one is available (usually namedbase.apk)
2: the actual split APK holding the native libs, if one is available (usually namedsplit_config.arm64_v8a.apkfor arm64 code)- Returns:
- the wanted apk; on failure, this method forwards to
getLocalApkFile()
-
getDropboxFolder
File getDropboxFolder()Retrieve the shared dropbox folder.- Returns:
- the dropbox folder
-
invokeMethod
IDImm invokeMethod(DInvokeType invoketype, String msig, List<IDExpression> args) throws DexDecEvaluationException Convenience method wrapping around thedex emulatorto emulate a method.- Parameters:
invoketype- method typemsig- full method signatureargs- method arguments (the first one must be the object if the method is non-static)- Returns:
- the returned value
- Throws:
DexDecEvaluationException- if the method evaluation fails
-
getJavaProperties
Properties getJavaProperties()Retrieve the Java properties object of the emulated app.- Returns:
- the Java properties
-
getSystemProperties
Retrieve the system properties of the emulated process.- Returns:
- the system properties
-
getUserId
int getUserId()Get the emulated Android user id.- Returns:
- the user id
-
getProcessId
int getProcessId()Get the emulated process id (PID).- Returns:
- the process id
-
callInternal
Internal routine. Do not use.- Parameters:
functionId- internal function identifierparams- function parameters- Returns:
- the function result
-