Class XposedService

    • Constructor Detail

    • Method Detail

      • getApiVersion

         int getApiVersion()

        Get the Xposed API version of current implementation.

        Returns:

        API version

      • getFrameworkName

         String getFrameworkName()

        Get the Xposed framework name of current implementation.

        Returns:

        Framework name

      • getFrameworkVersion

         String getFrameworkVersion()

        Get the Xposed framework version of current implementation.

        Returns:

        Framework version

      • getFrameworkVersionCode

         long getFrameworkVersionCode()

        Get the Xposed framework version code of current implementation.

        Returns:

        Framework version code

      • getFrameworkProperties

         long getFrameworkProperties()

        Gets the Xposed framework properties. Properties with prefix PROP_RT_ may change among launches.

        Returns:

        Framework properties

      • getScope

         List<String> getScope()

        Get the application scope of current module.

        Returns:

        Module scope

      • removeScope

         void removeScope(List<String> packages)

        Remove an app from the module scope.

        Parameters:
        packages - Packages to be removed
      • getRunningTargets

         List<HookedTarget> getRunningTargets()

        Get a list of currently running processes that are hooked by the module.

        Returned targets can be passed to hotReloadModule. The pid, uid, process name, and loaded version code are diagnostic values only.

        Returns:

        The list of hooked processes

      • hotReloadModule

         void hotReloadModule(HookedTarget target, Bundle data, XposedService.HotReloadCallback callback)

        Request hot reload for the module in the specified process. The process must be one of the targets returned by getRunningTargets.

        This method only validates and submits the request. The actual reload result is delivered asynchronously through callback. If the framework cannot provide a valid new module generation for the target, the callback receives UNSUPPORTED.

        If the old module rejects reload by returning false from onHotReloading, the callback receives FAILED with a null message. If reload fails because of an exception, the callback receives FAILED with a framework-provided diagnostic message.

        Hot reload is intended for loading a new module generation after the module app is updated. It should not be used to propagate configuration changes. For configuration updates, use getRemotePreferences and SharedPreferences.OnSharedPreferenceChangeListener.

        The optional data should contain only classloader-neutral values that can be unmarshalled without the module's class loader. Do not put module-defined android.os.Parcelable or java.io.Serializable objects in this bundle.

        Parameters:
        target - The target process
        data - Optional data to be passed to the old module
        callback - Callback to be invoked when the request completes or fails
      • getRemotePreferences

         synchronized SharedPreferences getRemotePreferences(String group)

        Get remote preferences from Xposed framework. If the group does not exist, it will be created.

        Parameters:
        group - Group name
        Returns:

        The preferences

      • deleteRemotePreferences

         synchronized void deleteRemotePreferences(String group)

        Delete a group of remote preferences.

        Parameters:
        group - Group name
      • openRemoteFile

         ParcelFileDescriptor openRemoteFile(String name)

        Open a file in the module's shared data directory. The file will be created if not exists.

        Parameters:
        name - File name, must not contain path separators and .
        Returns:

        The file descriptor

      • deleteRemoteFile

         boolean deleteRemoteFile(String name)

        Delete a file in the module's shared data directory.

        Parameters:
        name - File name, must not contain path separators and .
        Returns:

        true if successful, false if the file does not exist