Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F-Droid build failed #38

Closed
linsui opened this issue Jan 7, 2025 · 12 comments
Closed

F-Droid build failed #38

linsui opened this issue Jan 7, 2025 · 12 comments

Comments

@linsui
Copy link

linsui commented Jan 7, 2025

https://gitlab.com/fdroid/checkupdates-bot-fdroiddata/-/jobs/8782198532

Could you please take a look? Thanks!

@brandonp2412
Copy link
Owner

Hey @linsui sorry but i'm struggling to figure out what the differences is between my apk and the f-droid one, when I went through the steps of decompiling the apks and comparing the differences it looks like it's saying the only diff is the file-names

[07:42 PM] ~ diff mine.txt fdroid.txt
2c2
< app-x86_64-release/lib/x86_64/libapp.so:     file format elf64-x86-64
---
> com.presley.fit_book_951/lib/x86_64/libapp.so:     file format elf64-x86-64
[07:42 PM] ~

@licaon-kter
Copy link

Use difoscope between the folders directly

@brandonp2412
Copy link
Owner

@licaon-kter Still not sure what this stuff means :(

Image

@licaon-kter
Copy link

That's the only difference?

If so, search for shstrtab in https://f-droid.org/docs/Reproducible_Builds/

@linsui
Copy link
Author

linsui commented Jan 29, 2025

How did you build the apk? If you use GHA, do note that it has ndk installed by default.

@brandonp2412
Copy link
Owner

brandonp2412 commented Jan 29, 2025

@linsui I build it with the flutter submodule:

./flutter/bin/flutter build apk --split-per-abi

Also I tried a few chatbot "answers" related to the shstrtab that didn't work (preventing jni stripping and something else) not much of an expert on any of this stuff ;/

@licaon-kter
Copy link

which NDK do you have installed?

@brandonp2412
Copy link
Owner

brandonp2412 commented Jan 29, 2025

@licaon-kter Im using: 27.0.12077973

@linsui
Copy link
Author

linsui commented Jan 30, 2025

We find that there is a DependencyInfoBlock in your APK.

It's a Signing block added by AGP and encrypted with the Google public key so it can't be read by anyone else except Google. You can read more about it here, here and here.

While this was added a while ago, we were only enforcing it for new apps, and recently we started scanning updates too.

Could you please disable it with the following code?

android {
    dependenciesInfo {
        // Disables dependency metadata when building APKs.
        includeInApk = false
        // Disables dependency metadata when building Android App Bundles.
        includeInBundle = false
    }
}

Thanks!

@brandonp2412
Copy link
Owner

OK I'm pushing that through, however when I tested it locally it looks like it's having the same diff

@brandonp2412
Copy link
Owner

Seems to still have the same diff:

[brandon@pc ~]$ diffoscope app-x86_64-release/lib/x86_64/libapp.so downloads/com.presley.fit_book_951/lib/x86_64/libapp.so
--- app-x86_64-release/lib/x86_64/libapp.so
+++ downloads/com.presley.fit_book_951/lib/x86_64/libapp.so
├── strings --all --bytes=8 {}
│┄ Ordering differences only
│ @@ -20735,11 +20735,11 @@
│  AUATARAQAPWVSRQP
│  AUATARAQAPWVSRQP
│  AUATARAQAPWVSRQP
│  AUATARAQAPWVSRQP
│  AUATARAQAPWVSRQP
│  AUATARAQAPWVSRQP
│  AUATARAQAPWVSRQP
│ -.eh_frame
│ +.shstrtab
│  .note.gnu.build-id
│ +.eh_frame
│  .dynamic
│ -.shstrtab
├── readelf --wide --decompress --hex-dump=.shstrtab {}
│ @@ -1,9 +1,9 @@
│
│  Hex dump of section '.shstrtab':
│ -  0x00000000 002e7465 7874002e 62737300 2e64796e ..text..bss..dyn
│ -  0x00000010 73747200 2e64796e 73796d00 2e686173 str..dynsym..has
│ -  0x00000020 68002e65 685f6672 616d6500 2e6e6f74 h..eh_frame..not
│ -  0x00000030 652e676e 752e6275 696c642d 6964002e e.gnu.build-id..
│ -  0x00000040 64796e61 6d696300 2e736873 74727461 dynamic..shstrta
│ -  0x00000050 62002e72 6f646174 6100              b..rodata.
│ +  0x00000000 002e7368 73747274 6162002e 74657874 ..shstrtab..text
│ +  0x00000010 002e726f 64617461 002e6e6f 74652e67 ..rodata..note.g
│ +  0x00000020 6e752e62 75696c64 2d696400 2e627373 nu.build-id..bss
│ +  0x00000030 002e6568 5f667261 6d65002e 64796e73 ..eh_frame..dyns
│ +  0x00000040 7472002e 64796e73 796d002e 68617368 tr..dynsym..hash
│ +  0x00000050 002e6479 6e616d69 6300              ..dynamic.
[brandon@pc ~]$ cat fitbook/android/app/build.gradle| grep -A 5 dependenciesInfo
   dependenciesInfo {
        includeInApk = false
        includeInBundle = false
   }
}

@linsui
Copy link
Author

linsui commented Jan 30, 2025

It's fixed, thanks!

@linsui linsui closed this as completed Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants