Skip to content

Commit

Permalink
add blackShadow to hostWhiteList
Browse files Browse the repository at this point in the history
  • Loading branch information
nnjun committed Mar 17, 2024
1 parent 0f75106 commit 582d7f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public static Context getContext() {
return get().mContext;
}

public static String getHostPackageName() {
return get().mContext.getPackageName();
}

public static boolean isHostProcess() {
return get().mProcessType == ProcessType.Host;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -91,8 +92,16 @@ public InstallResult installPlugin(String pluginKey, String pluginPath, String[]
// 复制so文件
NativeUtils.copyNativeLib(new File(pluginPath), BSFileManager.get().getPluginLibsDir(pluginKey, version));

List<String> allHostWhiteList = new ArrayList<>();
if (hostWhiteList != null) {
allHostWhiteList.addAll(Arrays.asList(hostWhiteList));
}
allHostWhiteList.add("top.niunaijun.shadow");
allHostWhiteList.add("top.niunaijun.shadow.*");
allHostWhiteList.add("top.niunaijun.shadow.**");

LoadParameters loadParameters = new LoadParameters(null, pluginKey, null,
hostWhiteList);
allHostWhiteList.toArray(new String[0]));
Parcel parcel = Parcel.obtain();
loadParameters.writeToParcel(parcel, 0);
InstalledApk installedApk = installPlugin(pluginKey, pluginApk, version);
Expand Down

0 comments on commit 582d7f7

Please sign in to comment.