[原创]改机系列 1 -ag真人国际厅网站

packagemanagerservice m = new packagemanagerservice(injector, onlycore, factorytest);

  t.traceend(); // "create package manager"

 

  injector.getcompatibility().registerlistener(selinuxmmac.selinux_latest_changes,

          packagename -> {

              synchronized (m.minstalllock) {

                  final androidpackage pkg;

                  final packagesetting ps;

                  final sharedusersetting shareduser;

                  final string oldseinfo;

                  synchronized (m.mlock) {

                      ps = m.msettings.getpackagelpr(packagename);

                      if (ps == null) {

                          slog.e(tag, "failed to find package setting " packagename);

                          return;

                      }

                      pkg = ps.pkg;

                      shareduser = ps.getshareduser();

                      oldseinfo = androidpackageutils.getseinfo(pkg, ps);

                  }

 

                  if (pkg == null) {

                      slog.e(tag, "failed to find package " packagename);

                      return;

                  }

                  final string newseinfo = selinuxmmac.getseinfo(pkg, shareduser,

                          m.minjector.getcompatibility());

 

                  if (!newseinfo.equals(oldseinfo)) {

                      slog.i(tag, "updating seinfo for package " packagename " from: "

                               oldseinfo " to: " newseinfo);

                      ps.getpkgstate().setoverrideseinfo(newseinfo);

                      m.prepareappdataafterinstalllif(pkg);

                  }

              }

          });

 

  m.installwhitelistedsystempackages();

  servicemanager.addservice("package", m);

  //将pms添加为系统服务

  final packagemanagernative pmn = m.new packagemanagernative();

  servicemanager.addservice("package_native", pmn);

原文链接:https://bbs.kanxue.com/thread-278408.htm

网络摘文,本文作者:15h,如若转载,请注明出处:https://www.15cov.cn/2023/08/27/原创改机系列-1-为所有应用添加权限/

发表评论

邮箱地址不会被公开。 必填项已用*标注

网站地图