You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another issue that seems to be a regression since 2.8.0: sparseResources in apktool.yml is forced to true regardless of whether the original APK used sparse or not.
It's easy to reproduce:
Decompile any APK: sparseResources is true in apktool.yml.
Set sparseResources to false in apktool.yml.
Recompile the APK.
Decompile the rebuilt APK: sparseResources is true in apktool.yml again.
This wasn't the behavior in Apktool 2.7.1-SNAPSHOT and prior.
While it would still work when rebuilding APKs on an Android 13 ROM, no such luck on Android 10 (other versions might be affected as well), as it causes a nasty boot failure:
W /system/bin/idmap2: failed to create idmap for overlay apk path "/product/overlay/FrameworksResCommonQva.apk": overlay "/product/overlay/FrameworksResCommonQva.apk" does not successfully overlay any resource -> failed to create idmap
F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7c2f611507 in tid 2172 (idmap2), pid 2172 (idmap2)
I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
I /system/bin/tombstoned: received crash request for pid 2172
I crash_dump64: performing dump of process 2172 (target tid = 2172)
F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
F DEBUG : Build fingerprint: 'Xiaomi/dipper/dipper:10/QKQ1.190828.002/V12.5.2.0.QEACNXM:user/release-keys'
F DEBUG : Revision: '0'
F DEBUG : ABI: 'arm64'
F DEBUG : Timestamp: 2023-07-23 00:33:43+0300
F DEBUG : pid: 2172, tid: 2172, name: idmap2 >>> /system/bin/idmap2 <<<
F DEBUG : uid: 0
F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7c2f611507
F DEBUG : x0 000000000000216d x1 0000007c2f229320 x2 0000007c2f200000 x3 0000000000000003
F DEBUG : x4 0000000000000029 x5 7365616d6c657373 x6 7373656c6d616573 x7 7f7f7f7f7f7f7f7f
F DEBUG : x8 0000007c2f1d09bc x9 0000007c2f2413c0 x10 0000007c2f241338 x11 0000000000000011
F DEBUG : x12 00000000000002b1 x13 0000007c2f1d0a10 x14 0000007c2f1d09c0 x15 000000000044002f
F DEBUG : x16 0000007c2f1d14d8 x17 0000007cb095c8f0 x18 0000007cb1a7e000 x19 0000007c2f2ba600
F DEBUG : x20 0000000000000007 x21 0000007fe36c04c0 x22 0000007c2f2ba600 x23 0000007c2f2292f0
F DEBUG : x24 0000007cb0da2020 x25 0000007fe36c04da x26 0000007c2f246180 x27 0000007c2f2462e8
F DEBUG : x28 0000007fe36c0524 x29 0000007fe36c04b0
F DEBUG : sp 0000007fe36c0490 lr 0000007caff577cc pc 0000007caff57844
F DEBUG :
F DEBUG : backtrace:
F DEBUG : #00 pc 0000000000043844 /system/lib64/libandroidfw.so (android::LoadedPackage::FindEntryByName(std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t>> const&, std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t>> const&) const+220) (BuildId: 56e62e9e87e328cab13d1b88d7c2cca0)
F DEBUG : #01 pc 0000000000039484 /system/lib64/libandroidfw.so (android::AssetManager2::GetResourceId(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const+1016) (BuildId: 56e62e9e87e328cab13d1b88d7c2cca0)
F DEBUG : #02 pc 00000000000134c0 /system/lib64/libidmap2.so (android::idmap2::Idmap::FromApkAssets(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, android::ApkAssets const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, android::ApkAssets const&, unsigned int const&, bool)+2188) (BuildId: 140835afee413473b2c971a844f42dfa)
F DEBUG : #03 pc 0000000000007794 /system/bin/idmap2 (Create(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)+1860) (BuildId: f14382a5540f8590c832167932481011)
F DEBUG : #04 pc 0000000000010194 /system/bin/idmap2 (Scan(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&)+8568) (BuildId: f14382a5540f8590c832167932481011)
F DEBUG : #05 pc 000000000000d244 /system/bin/idmap2 (main+1400) (BuildId: f14382a5540hf8590c832167932481011)
F DEBUG : #06 pc 000000000006ebc4 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: f6cc5d2d702265511937b56460b37693)
E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_00
E asset : failed to execute idmap2
W AssetManager: 'idmap2 --scan' failed: no static="true" overlays targeting "android" will be loaded
W /system/bin/idmap2: failed to create idmap for overlay apk path "/vendor/overlay/MiuiFrameworkResOverlay.apk": overlay "/vendor/overlay/MiuiFrameworkResOverlay.apk" does not successfully overlay any resource -> failed to create idmap
The text was updated successfully, but these errors were encountered:
Thanks for the spot. I've added a regression test for now while I dig into the regression. Should make it easier to prevent this from happening in future - #3201
Okay thanks - tracked it down. While its true I regressed it during some ARSC reworks. It wasn't even technically right back then. It was just prior looking for TYPE -> SPEC chunk order, but that is not consistent with a sparse resource build out.
Another issue that seems to be a regression since 2.8.0:
sparseResources
in apktool.yml is forced totrue
regardless of whether the original APK used sparse or not.It's easy to reproduce:
sparseResources
istrue
in apktool.yml.sparseResources
tofalse
in apktool.yml.sparseResources
istrue
in apktool.yml again.This wasn't the behavior in Apktool 2.7.1-SNAPSHOT and prior.
While it would still work when rebuilding APKs on an Android 13 ROM, no such luck on Android 10 (other versions might be affected as well), as it causes a nasty boot failure:
The text was updated successfully, but these errors were encountered: