DoKit
DoKit copied to clipboard
【Android】【3.5.0.1】- 主进程名不为包名情况下sdk无法初始化
Dokit执行初始化的入口com.didichuxing.doraemonkit.DoKitReal#install 其中,只会在主进程执行初始化。 当app中主进程名不等于包名时,会被判定为子进程,导致app无法初始化dokit。 建议将主进程的判断方法开放,外部可扩展重写。
fun install( app: Application, mapKits: LinkedHashMap<String, List<AbstractKit>>, listKits: List<AbstractKit>, productId: String ) { ... //判断进程名 if (!ProcessUtils.isMainProcess()) { return } ... }
/** * Return whether app running in the main process. * * @return {@code true}: yes<br>{@code false}: no */ public static boolean isMainProcess() { return Utils.getApp().getPackageName().equals(getCurrentProcessName()); }
什么情况需要显式指定进程名与包名不一致
什么情况需要显式指定进程名与包名不一致
历史原因吧,项目中主进程做了命名配置,不是默认的包名
不建议在主干版本中增加,非通用功能特性。 针对特殊需求可考虑增加 x.x.x.process-workround 版本支持