feat: 优化包名获取逻辑
This commit is contained in:
@ -768,10 +768,10 @@ public class LibaoUtils {
|
||||
}
|
||||
|
||||
public static boolean isAppInstalled(Context context, String packageName) {
|
||||
List<PackageInfo> pinfo = PackageHelper.INSTANCE.getInstalledPackages(context, 0);
|
||||
if (pinfo != null) {
|
||||
for (int i = 0; i < pinfo.size(); i++) {
|
||||
String pn = pinfo.get(i).packageName;
|
||||
List<String> packageNameList = PackageHelper.INSTANCE.getInstalledPackageNameList(context, 0);
|
||||
if (packageNameList != null) {
|
||||
for (int i = 0; i < packageNameList.size(); i++) {
|
||||
String pn = packageNameList.get(i);
|
||||
if (pn.equals(packageName)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user