Skip to content

Commit

Permalink
add installApkFiles api
Browse files Browse the repository at this point in the history
  • Loading branch information
WaxMoon committed Dec 30, 2022
1 parent e1a3efd commit e64055a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,27 @@ var install: (ApkInfo)->Unit = { apkInfo ->
}
```

### You can also call HackApi.installApkFiles to install apk with apk file path

```Java
/**
* install the apk/apks that is not installed on the system.
* @param apkPathOrDir if this app is a full apk file, apkPathOrDir should pass an absolute path,
* such as /sdcard/com.xx.yy/com.xx.yy.apk;
*
* if this app is split apk files, apkPathOrDir should pass the directory
* containing all the apk files for this app, such as /sdcard/com.xx.yy/,
* and this directory can't contain apk files that do not belong to the current app.
*
* @param userId
* @param forceInstall
* @return public static final int INSTALL_SUCCEEDED = 1;
*/
public static int installApkFiles(String apkPathOrDir, int userId, boolean forceInstall) {
...
}
```

### Use HackApi.startActivity to run app

```Kotlin
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ext {
localTest = false
isMasterPkg = true
hackJarName = "hack.jar"
versionCode = 1004
versionName = "1.0.4"
versionCode = 1005
versionName = "1.0.5"
masterPkg = "org.waxmoon.github64"
assistPkg = "org.waxmoon.github32"
}
21 changes: 21 additions & 0 deletions docs/READEME-zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,27 @@ var install: (ApkInfo)->Unit = { apkInfo ->
}
```

### 也可以调用installApkFiles传递apk路径安装app

```Java
/**
* install the apk/apks that is not installed on the system.
* @param apkPathOrDir if this app is a full apk file, apkPathOrDir should pass an absolute path,
* such as /sdcard/com.xx.yy/com.xx.yy.apk;
*
* if this app is split apk files, apkPathOrDir should pass the directory
* containing all the apk files for this app, such as /sdcard/com.xx.yy/,
* and this directory can't contain apk files that do not belong to the current app.
*
* @param userId
* @param forceInstall
* @return public static final int INSTALL_SUCCEEDED = 1;
*/
public static int installApkFiles(String apkPathOrDir, int userId, boolean forceInstall) {
...
}
```

### 使用HackApi.startActivity运行app

```Kotlin
Expand Down

0 comments on commit e64055a

Please sign in to comment.