rootbeer icon indicating copy to clipboard operation
rootbeer copied to clipboard

Feature: Support 16 KB page sizes

Open cmveas opened this issue 1 year ago • 21 comments

Describe the bug/feature request/question We need a library that is aligned for 16KB memory pages as described here

https://developer.android.com/guide/practices/page-sizes

Do you think you might have an updated version with this kind of support?

cmveas avatar Jan 07 '25 10:01 cmveas

Version 0.1.1 with 16kb was released in Sept 2024.

https://github.com/scottyab/rootbeer/releases/tag/0.1.1

bhm avatar Jan 21 '25 10:01 bhm

In my report I still see

/var/folders/95/7vdyp6cx38g4481n1t40zj8h0000gn/T/app-prod-debug_out_XXXXX.AS3CypP3ir/lib/x86/libtoolChecker.so: \e[31mUNALIGNED\e[0m (2**12)

Will this be fixed when

https://github.com/scottyab/rootbeer/pull/244

is merged? will there be another version released?

cmveas avatar Jul 01 '25 08:07 cmveas

Hi, Same here. I have upgraded RootBeer to 0.1.1 But still found it is UNALIGNED

/var/folders/97/rrwwqgc138s466tqfbsbr3c80000gn/T/app-debug_aligned_out_XXXXX.lKQRG43oGO/lib/armeabi-v7a/libtoolChecker.so: \e[31mUNALIGNED\e[0m (2**12)

ABINAYASEL avatar Jul 03 '25 18:07 ABINAYASEL

Update: Fixed it using 0.1.1.

corepuncher avatar Jul 15 '25 02:07 corepuncher

@corepuncher It's already done. See https://github.com/scottyab/rootbeer/issues/241#issuecomment-2604281957

People complaining about x86 and armeabi-v7a libraries being unaligned haven't read the docs and/or the output from check_elf_alignment.sh:

If any arm64-v8a or x86_64 shared libraries are UNALIGNED, you'll need to update the packaging for those libraries, then recompile your app...

only arm64-v8a/x86_64 libs need to be aligned

liamjones avatar Jul 15 '25 07:07 liamjones

@liamjones thanks for pointing out the mistake. I can confirm this is the case. Thanks for the support

cmveas avatar Jul 15 '25 07:07 cmveas

@corepuncher It's already done. See #241 (comment)

People complaining about x86 and armeabi-v7a libraries being unaligned haven't read the docs and/or the output from check_elf_alignment.sh:

If any arm64-v8a or x86_64 shared libraries are UNALIGNED, you'll need to update the packaging for those libraries, then recompile your app...

only arm64-v8a/x86_64 libs need to be aligned

The problem is that even when I submit builds that include x86 and armeabi‑v7a libraries to Google Play, it still warns that we don’t meet the 16 KB page‑size requirement. Should I ignore the warning, or filter out x86 and armeabi‑v7a?

0x0BB9 avatar Jul 21 '25 06:07 0x0BB9

@0x0BB9 Interesting, I've not got to submission yet on our apps. Are you submitting AABs or APKs? If it's APKs, are they split by ABI? If it was a universal APK, or, if it were split APKs and your 64-bit APKs were ending up with 32-bit libraries inside them somehow I can see how it'd probably still complain.

It might be worth querying with Google's dev support?

liamjones avatar Jul 21 '25 06:07 liamjones

@0x0BB9 Interesting, I've not got to submission yet on our apps. Are you submitting AABs or APKs? If it's APKs, are they split by ABI? If it was a universal APK, or, if it were split APKs and your 64-bit APKs were ending up with 32-bit libraries inside them somehow I can see how it'd probably still complain.

It might be worth querying with Google's dev support?

@liamjones AABs, not APKs.

0x0BB9 avatar Jul 21 '25 07:07 0x0BB9

Any updates on this issue? i am facing this issue too.

K-K-Chong avatar Jul 31 '25 01:07 K-K-Chong

up

dyazincahya avatar Aug 03 '25 13:08 dyazincahya

Any updates on this issue? i am facing this issue too.

pawarprasad37 avatar Aug 04 '25 11:08 pawarprasad37

Hi all, is anyone able to solve the issue? Mind to share the solution. Thanks 😊

K-K-Chong avatar Aug 26 '25 03:08 K-K-Chong

Update: fix it by adding the following configuration in build.gradle packagingOptions { jniLibs {useLegacyPackaging true}} or upgrade the Gradle version to 8.5 or above.

0x0BB9 avatar Aug 26 '25 03:08 0x0BB9

Update: fix it by adding the following configuration in build.gradle packagingOptions { jniLibs {useLegacyPackaging true}} or upgrade the Gradle version to 8.5 or above.

the configuration above is to disable the apk to support 16kb? Please correct if I'm wrong. If yes, will it be rejected by google playstore?

K-K-Chong avatar Aug 27 '25 05:08 K-K-Chong

There was a problem in the Android Studio, that make the "Analyze APK" give the 16 KB warning. In the new version(Narwhal 3 Feature Drop | 2025.1.3) this issue is solved. The issue: https://issuetracker.google.com/issues/432782053

ice-psantos avatar Sep 05 '25 18:09 ice-psantos

The problem with the library isn't fixed, the deadline imposed by Play Store is near.

This is the warning from PlayStore for our app:

Image

The librealmc.so is related to rootbeer:

Image

maavalos avatar Sep 23 '25 13:09 maavalos

The librealmc.so is related to rootbeer

@maavalos I'm not sure why you think that, rootbeer only produces a libtoolChecker.so: https://github.com/scottyab/rootbeer/blob/eff976a9eec1706957b2fa594672105fa9c3fa1e/rootbeerlib/src/main/cpp/CMakeLists.txt#L12

From a quick web search it looks like it's from realm-kotlin? https://github.com/realm/realm-kotlin/issues/1202

Over there, that was fixed and released in realm-kotlin 2.3.0: https://github.com/realm/realm-kotlin/pull/1834

liamjones avatar Sep 23 '25 14:09 liamjones

Hey guys i added rootbeer as a module in my app and did the following changes and it seems to work for me, if anyone want's to give it a shot as well in the file CMakeLists.txt

if(ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,max-page-size=16384")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,max-page-size=16384")
endif()

in the file RootBeerTest.java

from

import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;

changed it to

import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString; 

if anyone gives it a shot and it works for him as well let me know so i can open a pull request and maybe get approved!

fanistheolog avatar Sep 25 '25 12:09 fanistheolog