KittyMemoryEx 1.0.0
Dedicated library for runtime code patching, memory scanning, tracing, injection and some more useful memory utilities. works for both Android and Linux
Loading...
Searching...
No Matches
KittyUtils::Android Namespace Reference

Provides utility functions for Android. More...

Functions

int getUserId ()
template<typename T>
T getSystemProperty (const std::string &key, T defaultValue)
 Get an Android system property as a typed value.
int getVersion ()
 Returns the version of the Android operating system.
int getSDK ()
 Returns the SDK version of the Android operating system.
bool is64BitSupported ()
 Returns true if Android operating system supports 64bit.
std::string getExternalStorage ()
 Get the base external storage directory.
std::string getAppInternalDataDir (const std::string &packageName)
 Get the Android app-specific internal data directory.
std::string getAppInternalFilesDir (const std::string &packageName)
 Get the Android app-specific internal files directory.
std::string getAppInternalCacheDir (const std::string &packageName)
 Get the Android app-specific internal cache directory. the system usually sets the TMPDIR environment variable. If TMPDIR is not set, it falls back to /data/user/<user_id>/<package_name>/cache.
std::string getAppExternalDataDir (const std::string &packageName)
 Get the Android app-specific external data directory.
std::string getAppExternalFilesDir (const std::string &packageName)
 Get the Android app-specific external files directory.
std::string getAppExternalCacheDir (const std::string &packageName)
 Get the Android app-specific external cache directory.
std::string getAppExternalMediaDir (const std::string &packageName)
 Get the Android app-specific external media directory (Android 10+).
std::string getAppObbDir (const std::string &packageName)
 Get the Android app-specific OBB directory.

Detailed Description

Provides utility functions for Android.

Function Documentation

◆ getAppExternalCacheDir()

std::string KittyUtils::Android::getAppExternalCacheDir ( const std::string & packageName)
inline

Get the Android app-specific external cache directory.

Equivalent to: Context.getExternalCacheDir()

Example: /storage/emulated/0/Android/data/<package>/cache

Parameters
packageNameAndroid application package name.
Returns
Absolute path to external cache directory.
Here is the call graph for this function:

◆ getAppExternalDataDir()

std::string KittyUtils::Android::getAppExternalDataDir ( const std::string & packageName)
inline

Get the Android app-specific external data directory.

Example: /storage/emulated/0/Android/data/<package>

Parameters
packageNameAndroid application package name.
Returns
Absolute path to app external data.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAppExternalFilesDir()

std::string KittyUtils::Android::getAppExternalFilesDir ( const std::string & packageName)
inline

Get the Android app-specific external files directory.

Equivalent to: Context.getExternalFilesDir(null)

Example: /storage/emulated/0/Android/data/<package>/files

Parameters
packageNameAndroid application package name.
Returns
Absolute path to external files directory.
Here is the call graph for this function:

◆ getAppExternalMediaDir()

std::string KittyUtils::Android::getAppExternalMediaDir ( const std::string & packageName)
inline

Get the Android app-specific external media directory (Android 10+).

Example: /storage/emulated/0/Android/media/<package>

Parameters
packageNameAndroid application package name.
Returns
Absolute path to external media directory.
Here is the call graph for this function:

◆ getAppInternalCacheDir()

std::string KittyUtils::Android::getAppInternalCacheDir ( const std::string & packageName)

Get the Android app-specific internal cache directory. the system usually sets the TMPDIR environment variable. If TMPDIR is not set, it falls back to /data/user/<user_id>/<package_name>/cache.

Equivalent to: Context.getCacheDir()

Example: /data/user/<user_id>/<package_name>/cache

Parameters
packageNameAndroid application package name.
Returns
Absolute path to app internal cache directory.

◆ getAppInternalDataDir()

std::string KittyUtils::Android::getAppInternalDataDir ( const std::string & packageName)

Get the Android app-specific internal data directory.

Equivalent to: Context.getDataDir()

Example: /data/user/<user_id>/<package_name>

Parameters
packageNameAndroid application package name.
Returns
Absolute path to app internal data directory.

◆ getAppInternalFilesDir()

std::string KittyUtils::Android::getAppInternalFilesDir ( const std::string & packageName)

Get the Android app-specific internal files directory.

Equivalent to: Context.getFilesDir()

Example: /data/user/<user_id>/<package_name>/files

Parameters
packageNameAndroid application package name.
Returns
Absolute path to app internal files directory.

◆ getAppObbDir()

std::string KittyUtils::Android::getAppObbDir ( const std::string & packageName)
inline

Get the Android app-specific OBB directory.

Example: /storage/emulated/0/Android/obb/<package>

Parameters
packageNameAndroid application package name.
Returns
Absolute path to OBB directory.
Here is the call graph for this function:

◆ getExternalStorage()

std::string KittyUtils::Android::getExternalStorage ( )
inline

Get the base external storage directory.

Usually: /storage/emulated/0

Uses the EXTERNAL_STORAGE environment variable.

Returns
Absolute path to external storage root, falls back to "/sdcard" if not defined.
Here is the caller graph for this function:

◆ getSystemProperty()

template<typename T>
T KittyUtils::Android::getSystemProperty ( const std::string & key,
T defaultValue )
inline

Get an Android system property as a typed value.

Supports std::string, bool, integral, and floating-point types. Returns defaultValue if the property is missing or conversion fails.

Template Parameters
TDesired type
Parameters
keyProperty name (e.g., "ro.build.version.sdk")
defaultValueValue returned if property not found or conversion fails
Returns
Property value converted to T