Project-ARTist / meta

Meta repository for matters related to more than one repository or even the whole project as such.
2 stars 0 forks source link

Android 8.0 Oreo: Untouched base.apk #7

Open sweisgerber-dev opened 6 years ago

sweisgerber-dev commented 6 years ago

ARTist's injection only works when replacing the original /data/app/<package>/base.apk with the injected and signed base.apk..

On Android 6, 7 & 7.1 it works, when rewriting / faking the checksums.

Affected Projects

The only log message indicating the problem is: zygote64: expected 1 dex files but found 2 Then the compiled oat fiel is thrown away and the original non-injected app is executed

Context Logs

10-10 15:37:28.066  1081  1784 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.heise.android.heiseonlineapp/.ui.ChannelActivity bnds=[255,245][512,440]} from uid 10035
10-10 15:37:28.069   803  4088 I ACDB-LOADER: ACDB AFE returned = -19
10-10 15:37:28.069   803  4088 D hardware_info: hw_info_append_hw_type : device_name = speaker
10-10 15:37:28.069   803  4088 D audio_hw_primary: enable_snd_device: snd_device(2: speaker)
10-10 15:37:28.069   803  4088 D audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback speaker
10-10 15:37:28.069   872   997 E ANDR-PERF-OPTSHANDLER: Warning: Resource [2, 0] not supported for core 1. Instead use resource for core 0
10-10 15:37:28.069   872   997 E ANDR-PERF-RESOURCEQS: Failed to apply optimization [2, 2, 0]
10-10 15:37:28.101  1081  2426 I ActivityManager: Start proc 17944:de.heise.android.heiseonlineapp/u0a150 for activity de.heise.android.heiseonlineapp/.ui.ChannelActivity
10-10 15:37:28.165 17944 17944 E zygote64: expected 1 dex files but found 2

Error Research

Log(Fatal) terminates here:

bool OatFileAssistant::DexChecksumUpToDate(const OatFile& file, std::string* error_msg) {
  (...)
  // art::OatFile
  uint32_t number_of_dex_files = file.GetOatHeader().GetDexFileCount();
  if (required_dex_checksums->size() != number_of_dex_files) {
  (...)
}
bool OatFileAssistant::DexChecksumUpToDate(const VdexFile& file, std::string* error_msg) {
  (...)
  // art::VdexFile
  uint32_t number_of_dex_files = file.GetHeader().GetNumberOfDexFiles();
  if (required_dex_checksums->size() != number_of_dex_files) {
  (...)
}

Ideas

Experiments with rewriting the dexfile count have been done here:

https://github.com/Project-ARTist/art/commit/e3b1e2261f16e8197e27f851c286d932b2fcd1ec via:

OatHeader::ArtistFixDexFileCount(){ ... }

w/o success. Injected apps didn't even log an error, before ARTist's compiled oat file was thrown away.

chevalx commented 3 years ago

Hi, can ARtist work on Android 8.0? I tested it with a Nexus5X device running Android 8.0, the injection worked fine but injected app did not run. Can this problem be addressed?