Skip to content

Commit

Permalink
[enhancement] protect get main process from appinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
shwenzhang committed Nov 9, 2017
1 parent acd0742 commit d0fe056
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,14 @@ public static boolean isTinkerEnabledAll(int flag) {
}

public static boolean isInMainProcess(Context context) {
String mainProcessName = null;
ApplicationInfo applicationInfo = context.getApplicationInfo();
String mainProcessName = applicationInfo.processName;
if (applicationInfo != null) {
mainProcessName = applicationInfo.processName;
}
if (isNullOrNil(mainProcessName)) {
mainProcessName = context.getPackageName();
}
String processName = getProcessName(context);
if (processName == null || processName.length() == 0) {
processName = "";
Expand Down
2 changes: 1 addition & 1 deletion tinker-sample-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

TINKER_VERSION=1.9.0
TINKER_VERSION=1.9.1
GRADLE_3=true

0 comments on commit d0fe056

Please sign in to comment.