程序包 net_62v.external

类 MetaApplicationInstaller

java.lang.Object
net_62v.external.MetaApplicationInstaller

public final class MetaApplicationInstaller extends Object
A class for package management, you can clone a specific app by calling the cloneApp(String) method.
You can install an app that not being installed on the host system by calling the installAppByPath(String) method.
版本:
1.0
作者:
king@62v.net
  • 构造器详细资料

    • MetaApplicationInstaller

      public MetaApplicationInstaller()
  • 方法详细资料

    • cloneApp

      public static int cloneApp(String packageName) throws RemoteException
      Install an existing app which already been installed.
      Must be installed before, so this method also known as clone application.
      Usage:

      MetaApplicationInstaller.cloneApp("com.whatsapp")

      参数:
      packageName - package name like "com.whatsapp"
      返回:
      install result, greater than 0 then success, otherwise you should convert it to see.
      抛出:
      RemoteException
    • installAppByPath

      public static int installAppByPath(String path) throws RemoteException
      Install apk from explorer etc. And you must give a direct path to install inside.
      Only support the standard apk file, please verify the file before you use this method.

      MetaApplicationInstaller.installAppByPath("/sdcard/sample.apk")

      参数:
      path - a direct apk path
      返回:
      install result
      抛出:
      RemoteException
    • installAppsByPath

      public static int installAppsByPath(String path) throws RemoteException
      Install apks (split apk) from explorer etc. And you must give a direct path to install inside.
      Support dir or apks / apkm / xapk format file

      MetaApplicationInstaller.installAppsByPath("/sdcard/pure.xapk")

      参数:
      path - a direct apk path
      返回:
      install result
      抛出:
      RemoteException
    • convertResultToString

      public static String convertResultToString(int installResult)
      Convert the install result to a readable string, mostly greater than 0 is success, otherwise you can
      use this api for debug purpose, and can be shown to users for comprehensive.
      参数:
      installResult - install result integer
      返回:
      readable string