Xposed
public final class

AndroidAppHelper

extends Object
java.lang.Object
   ↳ android.app.AndroidAppHelper

Class Overview

Contains various methods for information about the current app.

For historical reasons, this class is in the android.app package. It can't be moved without breaking compatibility with existing modules.

Summary

Public Methods
static Application currentApplication()
Returns the main Application object in the current process.
static ApplicationInfo currentApplicationInfo()
Returns information about the main application in the current process.
static String currentPackageName()
Returns the Android package name of the main application in the current process.
static String currentProcessName()
Returns the name of the current process.
static SharedPreferences getDefaultSharedPreferencesForPackage(String packageName)
This method is deprecated. Use XSharedPreferences instead.
static SharedPreferences getSharedPreferencesForPackage(String packageName, String prefFileName, int mode)
This method is deprecated. Use XSharedPreferences instead.
static void reloadSharedPreferencesIfNeeded(SharedPreferences pref)
This method is deprecated. Use XSharedPreferences.reload() instead.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Application currentApplication ()

Returns the main Application object in the current process.

In a few cases, multiple apps might run in the same process, e.g. the SystemUI and the Keyguard which both have android:process="com.android.systemui" set in their manifest. In those cases, the first application that was initialized will be returned.

public static ApplicationInfo currentApplicationInfo ()

Returns information about the main application in the current process.

In a few cases, multiple apps might run in the same process, e.g. the SystemUI and the Keyguard which both have android:process="com.android.systemui" set in their manifest. In those cases, the first application that was initialized will be returned.

public static String currentPackageName ()

Returns the Android package name of the main application in the current process.

In a few cases, multiple apps might run in the same process, e.g. the SystemUI and the Keyguard which both have android:process="com.android.systemui" set in their manifest. In those cases, the first application that was initialized will be returned.

public static String currentProcessName ()

Returns the name of the current process. It's usually the same as the main package name.

public static SharedPreferences getDefaultSharedPreferencesForPackage (String packageName)

This method is deprecated.
Use XSharedPreferences instead.

public static SharedPreferences getSharedPreferencesForPackage (String packageName, String prefFileName, int mode)

This method is deprecated.
Use XSharedPreferences instead.

public static void reloadSharedPreferencesIfNeeded (SharedPreferences pref)

This method is deprecated.
Use XSharedPreferences.reload() instead.