[Xposed Framework Modules] Fif_:
Warning

This module fixes a problem on OOS 4.5 devices that crash when Xposed 87.3, 88 or 88.1 is active.

The root cause of the problem has been fixed in Xposed 88.2, so you do not need this module with Xposed 88.2 or later.

If you are experiencing soft-reboots and/or crashes without Xposed installed, this module cannot help you.

Requirements

An OOS Device.running Nougat

Xposed (Official [MENTION=4419114]rovo89[/MENTION] or systemless Magisk)

Description

If you're trying to run Xposed on OOS Devices, you may notice that every time your phone is left charging for a while, Android crashes with:

OPConfig:ConfigProvider: Module:BackgroundOptConfig
BackgroundDexOptService: blacklist add : com.chinamworld.main
BackgroundDexOptService: blacklist add : cn.kidyn.qdmedical160
BackgroundDexOptService: blacklist add : com.paic.zhifu.wallet.activity
BackgroundDexOptService: blacklist add : com.pingan.paces.ccms
BackgroundDexOptService: blacklist add : cn.damai
BackgroundDexOptService: blacklist add : com.baidu.carlife
BackgroundDexOptService: [OnlineConfig] BackgroundOpt updated complete
art : No implementation found for java.lang.String dalvik.system.DexFile.getOatFileCompilerFilter(java.lang.String, java.lang.String) (tried Java_dalvik_system_DexFile_getOatFileCompilerFilter and Java_dalvik_system_DexFile_getOatFileCompilerFilter__Ljava_lang_String_2Ljava_lang_String_2)
AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: BackgroundDexOptService_IdleOptimization
AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String dalvik.system.DexFile.getOatFileCompilerFilter(java.lang.String, java.lang.String) (tried Java_dalvik_system_DexFile_getOatFileCompilerFilter and Java_dalvik_system_DexFile_getOatFileCompilerFilter__Ljava_lang_String_2Ljava_lang_String_2)
AndroidRuntime: at dalvik.system.DexFile.getOatFileCompilerFilter(Native Method)
AndroidRuntime: at com.android.server.pm.PackageDexOptimizer.getOatFileCompilerFilter(PackageDexOptimizer.java:167)
AndroidRuntime: at com.android.server.pm.PackageManagerService.getOatFileCompilerFilter(PackageManagerService.java:19879)
AndroidRuntime: at com.android.server.pm.BackgroundDexOptService$3.run(BackgroundDexOptService.java:373)
DownloadManager: Removed 0 stale downloads
MDM_DropBox: record:system_server_crash
OSTracker: OS Event: system_server_crash

Then this module is for you.

Install, activate, reboot and crashes be gone.

This module has no UI.

Technical explanation

For some reason OnePlus has patched the Background Dex Optimization service. I think it's related to the aggressive optimization OOS 4.5 pushes (it uses the "speed" compiler filter everywhere) and also implements some filtering of some apps (see the blacklist add lines in the backtrace).

Note that the Background Dex Optimizer as shipped by OOS will not obey the pm.dexopt.bg-dexopt property and will always use "speed" irrespective of the pm.dexopt.bg-dexopt setting. Gah...

In their patching, OnePlus made the com.android.server.pm.PackageDexOptimizer.getOatFileCompilerFilter() framework function call the dalvik.system.DexFile.getOatFileCompilerFilter() native function.

dalvik.system.DexFile.getOatFileCompilerFilter() is implemented in OOS by /system/lib64/libart.so.

And Xposed replaces /system/lib64/libart.so with its own version, which does not contain dalvik.system.DexFile.getOatFileCompilerFilter().

When the OOS phone is left charging and reaches 100% battery, a timer starts. 1h after reaching 100% battery, the Background Dex Optimization runs, and promptly crashes. Since this is in the Android system, the whole phone soft-reboots.

The module works by hooking com.android.server.pm.PackageDexOptimizer.getOatFileCompilerFilter() and having it return null instead of calling the native method dalvik.system.DexFile.getOatFileCompilerFilter(). That's what the native method returns anyways, so no functionality should be lost.

Device Status

Working and tested on:

OnePlus 5 running OOS 4.5.12, Magisk 14.2 and Xposed 88.0.

Changelog

Release 0.1 on October 11, 2017

Initial release.

Download

httphttp://dl-xda.xposed.info/modules/com.fifsource.android.oosbackgroupdexcompilationfix_v1_830eb4.apk (on Xposed Module Repository)

XDA:DevDB Information

OOS Background DEX Optimization Fix, Xposed for all devices (see above for details)

Contributors

Fif_

Xposed Package Name:

Version Information

Status: Beta

Current Beta Version: 0.1

Beta Release Date: 2016-10-11

Created 2017-10-12

Last Updated 2017-10-12