From e3b1e2261f16e8197e27f851c286d932b2fcd1ec Mon Sep 17 00:00:00 2001 From: Sebastian Weisgerber Date: Wed, 11 Oct 2017 13:54:59 +0200 Subject: [PATCH] Added DexFile count manipulation function. - is not in use atm, because injected apps were not executed anyway. See: https://github.com/Project-ARTist/meta/issues/5#issuecomment-335475757 - Android 8.0 Oreo injection works, but base.apk must get replaced with injected APK for it to work --- runtime/oat.cc | 10 ++++++++++ runtime/oat.h | 1 + runtime/parsed_options.cc | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/runtime/oat.cc b/runtime/oat.cc index d14b399a9a..8b0f919c79 100644 --- a/runtime/oat.cc +++ b/runtime/oat.cc @@ -477,6 +477,16 @@ bool OatHeader::IsConcurrentCopying() const { return IsKeyEnabled(OatHeader::kConcurrentCopying); } +void OatHeader::ArtistFixDexFileCount() { + if (this->dex_file_count_ >= 2) { + VLOG(artist) << "ARTist Fixing Dexfile count, was: " << this->dex_file_count_; + --this->dex_file_count_; + VLOG(artist) << "ARTist Fixing Dexfile count, now: " << this->dex_file_count_; + } else { + VLOG(artist) << "ARTist NOT FIXINF Dexfile count, is " << this->dex_file_count_; + } +} + bool OatHeader::IsNativeDebuggable() const { return IsKeyEnabled(OatHeader::kNativeDebuggableKey); } diff --git a/runtime/oat.h b/runtime/oat.h index a38eebc188..e19fc3bde0 100644 --- a/runtime/oat.h +++ b/runtime/oat.h @@ -114,6 +114,7 @@ class PACKED(4) OatHeader { bool IsNativeDebuggable() const; CompilerFilter::Filter GetCompilerFilter() const; bool IsConcurrentCopying() const; + void ArtistFixDexFileCount(); private: bool KeyHasValue(const char* key, const char* value, size_t value_size) const; diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index 207e6d6c2b..4f8bb7f209 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -415,7 +415,7 @@ bool ParsedOptions::ProcessSpecialOptions(const RuntimeOptions& options, // Intended for local changes only. static void MaybeOverrideVerbosity() { - // gLogVerbosity.artist = true; // TODO: don't check this in! + // gLogVerbosity.artist = true; // TODO: don't check this in! // gLogVerbosity.artistd = true; // TODO: don't check this in! // gLogVerbosity.class_linker = true; // TODO: don't check this in! // gLogVerbosity.collector = true; // TODO: don't check this in!