didi / didi/DoKit

【Android】【3.5.0.1】- 主进程名不为包名情况下sdk无法初始化

Open
#936 3 comments 0 reactions 1 assignee Claimed by @jtsky View on GitHub
Dominant language
Java
Stars
20.4k
Forks
3.2k
Avg merge
1d 12h
Merged PRs (30d)
2

Description

Dokit执行初始化的入口com.didichuxing.doraemonkit.DoKitReal#install
其中,只会在主进程执行初始化。
当app中主进程名不等于包名时,会被判定为子进程,导致app无法初始化dokit。
建议将主进程的判断方法开放,外部可扩展重写。

`fun install(
app: Application,
mapKits: LinkedHashMap>,
listKits: List,
productId: String
) {
...
//判断进程名
if (!ProcessUtils.isMainProcess()) {
return
}
...
}`

` /**
* Return whether app running in the main process.
*
* @return {@code true}: yes
{@code false}: no
*/
public static boolean isMainProcess() {
return Utils.getApp().getPackageName().equals(getCurrentProcessName());
}
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.