Class ReLinkerInstance


  • public class ReLinkerInstance
    extends Object
    • Method Detail

      • force

        public ReLinkerInstance force()
        Forces any previously extracted / re-linked libraries to be cleaned up before loading
      • recursively

        public ReLinkerInstance recursively()
        Enables recursive library loading to resolve and load shared object -> shared object defined dependencies
      • loadLibrary

        public void loadLibrary​(Context context,
                                String library)
        Utilizes the regular system call to attempt to load a native library. If a failure occurs, then the function extracts native .so library out of the app's APK and attempts to load it.

        Note: This is a synchronous operation

      • loadLibrary

        public void loadLibrary​(Context context,
                                String library,
                                String version,
                                ReLinker.LoadListener listener)
        Attemps to load the given library normally. If that fails, it loads the library utilizing a workaround.
        Parameters:
        context - The Context to get a workaround directory from
        library - The library you wish to load
        version - The version of the library you wish to load, or null
        listener - ReLinker.LoadListener to listen for async execution, or null
      • getWorkaroundLibDir

        protected File getWorkaroundLibDir​(Context context)
        Parameters:
        context - Context to describe the location of it's private directories
        Returns:
        A File locating the directory that can store extracted libraries for later use
      • getWorkaroundLibFile

        protected File getWorkaroundLibFile​(Context context,
                                            String library,
                                            String version)
        Parameters:
        context - Context to retrieve the workaround directory from
        library - The name of the library to load
        version - The version of the library to load or null
        Returns:
        A File locating the workaround library file to load
      • cleanupOldLibFiles

        protected void cleanupOldLibFiles​(Context context,
                                          String library,
                                          String currentVersion)
        Cleans up any other versions of the library. If force is used, all versions of the library are deleted
        Parameters:
        context - Context to retrieve the workaround directory from
        library - The name of the library to load
        currentVersion - The version of the library to keep, all other versions will be deleted. This parameter is ignored if force is used.
      • log

        public void log​(String message)