Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-base: Commit

frameworks/base


Commit MetaInfo

Revisionc129edc53b0fe23d5c7f6f23553755a515e9a233 (tree)
Time2020-04-14 23:46:53
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

ABIPicker: match package name by patterns

PRC apps from different markets usually have different package names.
This change tries to match them by patterns.

To test it, install the Implosion apps from Wandoujia and CoolMarket
and run them OK.

Change Summary

Incremental Difference

--- a/core/jni/abipicker/ABIPicker.cpp
+++ b/core/jni/abipicker/ABIPicker.cpp
@@ -5,6 +5,7 @@
55
66 #include <androidfw/ZipFileRO.h>
77 #include <androidfw/ZipUtils.h>
8+#include <fnmatch.h>
89
910 namespace android {
1011 #define ARR_SIZE(x) (sizeof(x)/sizeof(x[0]))
@@ -103,8 +104,8 @@ bool isInOEMWhiteList(const char* pkgName) {
103104 Vector<char*>::iterator it = cfgWhite.begin();
104105 for (; it != cfgWhite.end(); it++) {
105106 P_LOG("whitelist : %s", *it);
106- if (0 == strcmp(pkgName, *it)) {
107- ALOGI("found %s in whitelist", pkgName);
107+ if (0 == fnmatch(*it, pkgName, 0)) {
108+ ALOGI("whitelist %s by %s", pkgName, *it);
108109 result = true;
109110 break;
110111 }
@@ -125,8 +126,8 @@ bool isInOEMBlackList(const char* pkgName) {
125126
126127 Vector<char*>::iterator it = cfgBlack.begin();
127128 for (; it != cfgBlack.end(); it++) {
128- if (0 == strcmp(pkgName, *it)) {
129- ALOGI("found %s in blacklist", pkgName);
129+ if (0 == fnmatch(*it, pkgName, 0)) {
130+ ALOGI("blacklist %s by %s", pkgName, *it);
130131 result = true;
131132 break;
132133 }
Show on old repository browser