content: package org.lsposed.lspatch.loader;
  
  import android.app.ActivityThread;
  import android.app.LoadedApk;
  import android.content.res.XResources;
  import android.util.Log;
  
  import de.robv.android.xposed.XposedBridge;
  import de.robv.android.xposed.XposedInit;
  import de.robv.android.xposed.callbacks.XC_LoadPackage;
  
  public class LSPLoader {
      public static void initModules(LoadedApk loadedApk) {
          XposedInit.loadedPackagesInProcess.add(loadedApk.getPackageName());
          XResources.setPackageNameForResDir(loadedApk.getPackageName(), loadedApk.getResDir());
          XC_LoadPackage.LoadPackageParam lpparam = new XC_LoadPackage.LoadPackageParam(
                  XposedBridge.sLoadedPackageCallbacks);
          lpparam.packageName = loadedApk.getPackageName();
          lpparam.processName = ActivityThread.currentProcessName();
          lpparam.classLoader = loadedApk.getClassLoader();
          lpparam.appInfo = loadedApk.getApplicationInfo();
          lpparam.isFirstApplication = true;
          XC_LoadPackage.callAll(lpparam);
      }
  }
  