X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/af949fdd618113755b85860f88c0736aa1ed09e7..5af431483a08f10bea3834db1ee7304e735c359c:/Command.cpp diff --git a/Command.cpp b/Command.cpp index 5d345e6..735a80d 100644 --- a/Command.cpp +++ b/Command.cpp @@ -525,6 +525,8 @@ int doDump(Bundle* bundle) bool actWallpaperService = false; bool specCameraFeature = false; bool hasCameraPermission = false; + bool specGpsFeature = false; + bool hasGpsPermission = false; int targetSdk = 0; int smallScreen = 1; int normalScreen = 1; @@ -601,7 +603,7 @@ int doDump(Bundle* bundle) } else { printf("versionCode='' "); } - String8 versionName = getAttribute(tree, VERSION_NAME_ATTR, &error); + String8 versionName = getResolvedAttribute(&res, tree, VERSION_NAME_ATTR, &error); if (error != "") { fprintf(stderr, "ERROR getting 'android:versionName' attribute: %s\n", error.string()); goto bail; @@ -719,6 +721,8 @@ int doDump(Bundle* bundle) REQUIRED_ATTR, NULL, 1); if (name == "android.hardware.camera") { specCameraFeature = true; + } else if (name == "android.hardware.location.gps") { + specGpsFeature = true; } printf("uses-feature%s:'%s'\n", req ? "" : "-not-required", name.string()); @@ -734,6 +738,8 @@ int doDump(Bundle* bundle) if (name != "" && error == "") { if (name == "android.permission.CAMERA") { hasCameraPermission = true; + } else if (name == "android.permission.ACCESS_FINE_LOCATION") { + hasGpsPermission = true; } printf("uses-permission:'%s'\n", name.string()); } else { @@ -741,6 +747,15 @@ int doDump(Bundle* bundle) error.string()); goto bail; } + } else if (tag == "original-package") { + String8 name = getAttribute(tree, NAME_ATTR, &error); + if (name != "" && error == "") { + printf("original-package:'%s'\n", name.string()); + } else { + fprintf(stderr, "ERROR getting 'android:name' attribute: %s\n", + error.string()); + goto bail; + } } } else if (depth == 3 && withinApplication) { withinActivity = false; @@ -850,6 +865,14 @@ int doDump(Bundle* bundle) printf("uses-feature:'android.hardware.camera.autofocus'\n"); } + if (!specGpsFeature && hasGpsPermission) { + // For applications that have not explicitly stated their + // GPS feature requirements, but have requested the "fine" (GPS) + // permission, we are going to give them compatibility treatment + // of requiring the equivalent to original android devices. + printf("uses-feature:'android.hardware.location.gps'\n"); + } + if (hasMainActivity) { printf("main\n"); }