This workaround provides the limited support apps of which dex files are
protected by bangcle free edition protection.
NOTE: Must be merged together with following workaround:
https://android.intel.com/#/c/394523/
https://android.intel.com/#/c/394524/
https://android.intel.com/#/c/394526/
Change-Id: I876330738cbe0f10819e8be961f61f8011258d4b
Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-38665
Signed-off-by: Firefly <service@t-firefly.com>
59 lines
1.4 KiB
C
59 lines
1.4 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include <cutils/properties.h>
|
|
|
|
#include "dynarray.h"
|
|
|
|
static void record_prop(const char* key, const char* name, void* opaque)
|
|
{
|
|
strlist_t* list = opaque;
|
|
char temp[PROP_VALUE_MAX + PROP_NAME_MAX + 16];
|
|
snprintf(temp, sizeof temp, "[%s]: [%s]", key, name);
|
|
strlist_append_dup(list, temp);
|
|
}
|
|
|
|
static void list_properties(void)
|
|
{
|
|
strlist_t list[1] = { STRLIST_INITIALIZER };
|
|
|
|
/* Record properties in the string list */
|
|
(void)property_list(record_prop, list);
|
|
|
|
/* Sort everything */
|
|
strlist_sort(list);
|
|
|
|
/* print everything */
|
|
STRLIST_FOREACH(list, str, printf("%s\n", str));
|
|
|
|
/* voila */
|
|
strlist_done(list);
|
|
}
|
|
|
|
int getprop_main(int argc, char *argv[])
|
|
{
|
|
if (argc == 1) {
|
|
list_properties();
|
|
} else {
|
|
char value[PROPERTY_VALUE_MAX];
|
|
char *default_value;
|
|
if(argc > 2) {
|
|
default_value = argv[2];
|
|
} else {
|
|
default_value = "";
|
|
}
|
|
|
|
if (!strcmp(argv[1], "ro.product.cpu.abi.bn")) {
|
|
printf("armeabi-v7a\n");
|
|
} else if (!strcmp(argv[1], "ro.product.cpu.abi2.bn")) {
|
|
printf("armeabi-v5a\n");
|
|
} else if (!strcmp(argv[1], "ro.product.cpu.abilist.bn")) {
|
|
printf("armeabi-v7a,armeabi-v5a,armeabi\n");
|
|
} else {
|
|
property_get(argv[1], value, default_value);
|
|
printf("%s\n", value);
|
|
}
|
|
}
|
|
return 0;
|
|
}
|