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 <android-base/strings.h>
|
||||||
#include "base/object.h"
|
#include "base/object.h"
|
||||||
|
|
||||||
// NOT USED
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
// Static whitelist of open paths that the zygote is allowed to keep open.
|
// 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) {
|
static void Setup(void *handle, HookFunType hook_func) {
|
||||||
HOOK_FUNC(IsAllowed,
|
HOOK_FUNC(IsAllowed,
|
||||||
"_ZNK23FileDescriptorWhitelist9IsAllowedERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE");
|
"_ZNK23FileDescriptorWhitelist9IsAllowedERKNSt3__112"
|
||||||
|
"basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -23,35 +23,25 @@ namespace edxp {
|
||||||
int res = old___system_property_get(key, value);
|
int res = old___system_property_get(key, value);
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
/*
|
|
||||||
if (strcmp(kPropKeyCompilerFilter, key) == 0) {
|
if (strcmp(kPropKeyCompilerFilter, key) == 0) {
|
||||||
strcpy(value, kPropValueCompilerFilter);
|
// strcpy(value, kPropValueCompilerFilter);
|
||||||
LOGI("system_property_get: %s -> %s", key, value);
|
|
||||||
} else if (strcmp(kPropKeyCompilerFlags, key) == 0) {
|
|
||||||
strcpy(value, kPropValueCompilerFlags);
|
|
||||||
LOGI("system_property_get: %s -> %s", key, value);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(strstr(value,kPropValueCompilerFlags) != NULL)
|
|
||||||
LOGI("system_property_get: %s -> %s", key, value);
|
LOGI("system_property_get: %s -> %s", key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(kPropKeyCompilerFlags, key) == 0) {
|
||||||
|
if (strcmp(value, "") == 0)
|
||||||
|
strcpy(value, kPropValueCompilerFlags);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOGI("system_property_get: %s -> %s", key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (api_level == __ANDROID_API_O_MR1__) {
|
if (api_level == __ANDROID_API_O_MR1__) {
|
||||||
|
|
@ -77,35 +67,27 @@ namespace edxp {
|
||||||
const std::string &key, const std::string &default_value) {
|
const std::string &key, const std::string &default_value) {
|
||||||
std::string res = old__ZN7android4base11GetPropertyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_(
|
std::string res = old__ZN7android4base11GetPropertyERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_(
|
||||||
key, default_value);
|
key, default_value);
|
||||||
/*
|
|
||||||
if (strcmp(kPropKeyCompilerFilter, key.c_str()) == 0) {
|
if (strcmp(kPropKeyCompilerFilter, key.c_str()) == 0) {
|
||||||
res = kPropValueCompilerFilter;
|
// res = kPropValueCompilerFilter;
|
||||||
LOGI("android::base::GetProperty: %s -> %s", key.c_str(), res.c_str());
|
|
||||||
} else if (strcmp(kPropKeyCompilerFlags, key.c_str()) == 0) {
|
|
||||||
res = kPropValueCompilerFlags;
|
|
||||||
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(strcmp(kPropKeyCompilerFlags, key.c_str()) == 0) {
|
if (strcmp(kPropKeyCompilerFlags, key.c_str()) == 0) {
|
||||||
if(strcmp(res.c_str(),"") == 0)
|
if (strcmp(res.c_str(), "") == 0)
|
||||||
res = kPropValueCompilerFlags;
|
res = kPropValueCompilerFlags;
|
||||||
else{
|
else if (strstr(res.c_str(), kPropValueCompilerFlags) == nullptr) {
|
||||||
if(strstr(res.c_str(),kPropValueCompilerFlags) == NULL) {
|
if (strlen(res.c_str()) + strlen(kPropValueCompilerFlagsWS) > PROP_VALUE_MAX) {
|
||||||
if(strlen(res.c_str()) + strlen(kPropValueCompilerFlagsWS) > PROP_VALUE_MAX) {
|
//just fallback, why not
|
||||||
//just fallback,why not
|
LOGI("Cannot add option to disable inline opt! Fall back to replace..");
|
||||||
LOGI("Cannot add option to disable inline opt!Fall back to replace..");
|
|
||||||
res = kPropValueCompilerFlags;
|
res = kPropValueCompilerFlags;
|
||||||
}else {
|
} else {
|
||||||
res.append(kPropValueCompilerFlagsWS);
|
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__) {
|
if (api_level == __ANDROID_API_O_MR1__) {
|
||||||
// see __system_property_get hook above for explanations
|
// see __system_property_get hook above for explanations
|
||||||
if (strcmp(kPropKeyUseJitProfiles, key.c_str()) == 0) {
|
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-filter=quicken
|
||||||
dalvik.vm.dex2oat-flags=--inline-max-code-units=0
|
dalvik.vm.dex2oat-flags=--inline-max-code-units=0
|
||||||
#dalvik.vm.image-dex2oat-flags=--inline-max-code-units=0 --compiler-filter=speed
|
#dalvik.vm.image-dex2oat-flags=--inline-max-code-units=0 --compiler-filter=speed
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue