Always write concerning sysprops to log
This commit is contained in:
parent
02adea8691
commit
b6c1a1bd01
|
|
@ -4,7 +4,6 @@
|
|||
#include <android-base/strings.h>
|
||||
#include "base/object.h"
|
||||
|
||||
// NOT USED
|
||||
namespace android {
|
||||
|
||||
// Static whitelist of open paths that the zygote is allowed to keep open.
|
||||
|
|
@ -20,7 +19,8 @@ namespace android {
|
|||
|
||||
static void Setup(void *handle, HookFunType hook_func) {
|
||||
HOOK_FUNC(IsAllowed,
|
||||
"_ZNK23FileDescriptorWhitelist9IsAllowedERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE");
|
||||
"_ZNK23FileDescriptorWhitelist9IsAllowedERKNSt3__112"
|
||||
"basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE");
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -14,46 +14,36 @@
|
|||
namespace edxp {
|
||||
|
||||
static int api_level = 0;
|
||||
|
||||
|
||||
//Max length of property values
|
||||
//Ref https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/os/SystemProperties.java
|
||||
//static const int PROP_VALUE_MAX = 91;
|
||||
|
||||
NEW_FUNC_DEF(int, __system_property_get, const char *key, char *value) {
|
||||
int res = old___system_property_get(key, value);
|
||||
|
||||
|
||||
if (key) {
|
||||
/*
|
||||
if (strcmp(kPropKeyCompilerFilter, key) == 0) {
|
||||
strcpy(value, kPropValueCompilerFilter);
|
||||
LOGI("system_property_get: %s -> %s", key, value);
|
||||
} else if (strcmp(kPropKeyCompilerFlags, key) == 0) {
|
||||
strcpy(value, kPropValueCompilerFlags);
|
||||
// strcpy(value, kPropValueCompilerFilter);
|
||||
LOGI("system_property_get: %s -> %s", key, value);
|
||||
}
|
||||
*/
|
||||
|
||||
if(strcmp(kPropKeyCompilerFlags, key) == 0) {
|
||||
if(strcmp(value,"") == 0)
|
||||
|
||||
if (strcmp(kPropKeyCompilerFlags, key) == 0) {
|
||||
if (strcmp(value, "") == 0)
|
||||
strcpy(value, kPropValueCompilerFlags);
|
||||
else {
|
||||
if(strstr(value,kPropValueCompilerFlags) == NULL) {
|
||||
if(strlen(value) + strlen(kPropValueCompilerFlagsWS) > PROP_VALUE_MAX) {
|
||||
//just fallback,why not
|
||||
LOGI("Cannot add option to disable inline opt!Fall back to replace..");
|
||||
strcpy(value, kPropValueCompilerFlags);
|
||||
}else {
|
||||
strcat(value,kPropValueCompilerFlagsWS);
|
||||
}
|
||||
else if (strstr(value, kPropValueCompilerFlags) == nullptr) {
|
||||
if (strlen(value) + strlen(kPropValueCompilerFlagsWS) > PROP_VALUE_MAX) {
|
||||
//just fallback, why not
|
||||
LOGI("Cannot add option to disable inline opt! Fall back to replace..");
|
||||
strcpy(value, kPropValueCompilerFlags);
|
||||
} else {
|
||||
strcat(value, kPropValueCompilerFlagsWS);
|
||||
}
|
||||
}
|
||||
if(strstr(value,kPropValueCompilerFlags) != NULL)
|
||||
LOGI("system_property_get: %s -> %s", key, value);
|
||||
LOGI("system_property_get: %s -> %s", key, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (api_level == __ANDROID_API_O_MR1__) {
|
||||
// https://android.googlesource.com/platform/art/+/f5516d38736fb97bfd0435ad03bbab17ddabbe4e
|
||||
// Android 8.1 add a fatal check for debugging (removed in Android 9.0),
|
||||
|
|
@ -77,35 +67,27 @@ namespace edxp {
|
|||
const std::string &key, const std::string &default_value) {
|
||||
std::string res = old__ZN7android4base11GetPropertyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_(
|
||||
key, default_value);
|
||||
/*
|
||||
|
||||
if (strcmp(kPropKeyCompilerFilter, key.c_str()) == 0) {
|
||||
res = kPropValueCompilerFilter;
|
||||
LOGI("android::base::GetProperty: %s -> %s", key.c_str(), res.c_str());
|
||||
} else if (strcmp(kPropKeyCompilerFlags, key.c_str()) == 0) {
|
||||
res = kPropValueCompilerFlags;
|
||||
// res = kPropValueCompilerFilter;
|
||||
LOGI("android::base::GetProperty: %s -> %s", key.c_str(), res.c_str());
|
||||
}
|
||||
*/
|
||||
|
||||
if(strcmp(kPropKeyCompilerFlags, key.c_str()) == 0) {
|
||||
if(strcmp(res.c_str(),"") == 0)
|
||||
|
||||
if (strcmp(kPropKeyCompilerFlags, key.c_str()) == 0) {
|
||||
if (strcmp(res.c_str(), "") == 0)
|
||||
res = kPropValueCompilerFlags;
|
||||
else{
|
||||
if(strstr(res.c_str(),kPropValueCompilerFlags) == NULL) {
|
||||
if(strlen(res.c_str()) + strlen(kPropValueCompilerFlagsWS) > PROP_VALUE_MAX) {
|
||||
//just fallback,why not
|
||||
LOGI("Cannot add option to disable inline opt!Fall back to replace..");
|
||||
res = kPropValueCompilerFlags;
|
||||
}else {
|
||||
res.append(kPropValueCompilerFlagsWS);
|
||||
}
|
||||
else if (strstr(res.c_str(), kPropValueCompilerFlags) == nullptr) {
|
||||
if (strlen(res.c_str()) + strlen(kPropValueCompilerFlagsWS) > PROP_VALUE_MAX) {
|
||||
//just fallback, why not
|
||||
LOGI("Cannot add option to disable inline opt! Fall back to replace..");
|
||||
res = kPropValueCompilerFlags;
|
||||
} else {
|
||||
res.append(kPropValueCompilerFlagsWS);
|
||||
}
|
||||
}
|
||||
if(strstr(res.c_str(),kPropValueCompilerFlags) != NULL)
|
||||
LOGI("android::base::GetProperty: %s -> %s", key.c_str(), res.c_str());
|
||||
LOGI("android::base::GetProperty: %s -> %s", key.c_str(), res.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (api_level == __ANDROID_API_O_MR1__) {
|
||||
// see __system_property_get hook above for explanations
|
||||
if (strcmp(kPropKeyUseJitProfiles, key.c_str()) == 0) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# TODO ensure quicken is not essential
|
||||
#dalvik.vm.dex2oat-filter=quicken
|
||||
dalvik.vm.dex2oat-flags=--inline-max-code-units=0
|
||||
#dalvik.vm.image-dex2oat-flags=--inline-max-code-units=0 --compiler-filter=speed
|
||||
|
|
|
|||
Loading…
Reference in New Issue