THLfi / koronavilkku-android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable Android App Bundles (.aab file) and Proguard for obfuscation

pedpess opened this issue · comments

Enabling Android App Bundles to source the correct binary format per device architecture. With that addition to your build.gradle, the app will indirectly consume less space, and it may load faster. It's a simple addition with good benefits.

For Proguard, you could pass to your build.gradle file minifyEnabled true and use the conventional Proguard proguard-android.txt rules initially to avoid that other app to sniff into the source code during app run-time? I noticed that you already encrypt the SQLite database. Having this would be a bonus, but not really necessary.

Happy to help if anything else needed to introduce this if valuable to you. :)

The app is already open source, not sure what obfuscation would actually help in this case.

As for app bundles, I don't think it would actually yield the performance improvements that you mentioned? When app is launched, the correct resources are automatically used. The benefit of app bundle is of course that the download size would be smaller.

@kypeli Not sure either the full benefit of obfuscation security-wise for an open-source project, but for code optimization, Proguard also removes unused code during the bundling process.

You are right, there's no direct benefit indeed for the app bundles. I re-phrased that better, thanks for mentioning :)... Having smaller binary size and load time improv are the main ones I found.

IMO, obfuscation is bad for this app in particular, we want full transparency.

Is there ways to optimize without obfuscate?

Hi @pedpess and thanks for the suggestions! We are already deploying app bundles to Play Store, but we are using defaults and not defining anything special with the bundle block in build.gradle. Is that what you were looking for in build.gradle?

And yes, obfuscation is not used since the app is open-source. Code optimization and shrinking with R8/ProGuard is not used at the moment since the benefit seems minor vs. the effort required to make sure nothing breaks. We of course welcome any suggestions for safe and easy improvements there.

@finmackandal not that I know. It's done automatically by R8/Proguard.

@solita-jussihei Ah okay, good to know aab is being shipped 👍 :). Enabling Proguard and making a release build to test it is a simple change, but I agree that if the intention is to let the binary be open, so other people can download the app from the store and inspect the aab/apk then it makes sense.

Nothing more to add here from my side. Thanks for the replies :)