Fermat-ORG / fermat-framework

This is the Fermat Framework described on the first Fermat whitepaper. The Java Framework, Android Framework, Linux Framework, and all platforms are here. This project is currently paused until we put the network infraestructure in place. Later this work will be resumed to put this client-side infraestructure to work with the new set of networks.
https://drive.google.com/file/d/0B02V15ufCwR3UDNER3l2WGVmcE0/view
Other
2 stars 2 forks source link

fermat-android-api: Using Proguard #5477

Open sytolk opened 8 years ago

sytolk commented 8 years ago

How about to Proguard Android app (obfuscate & optimize) instead of using multidex? If then Dex will reach 65K methods limit ? Is anyone tested this?

leonacostaok commented 8 years ago

@furszy please check this

furszy commented 8 years ago

Yes, you are seeing only one module in the system. This is a huge platform in continuos growing. If you want more detail you can ask me in private via slack or email. Is easier and faster than wait for me here.

sytolk commented 8 years ago

@furszy I have open this issue why the search results for word "proguard" is missing in github fermat project. I`m no expecting faster fix and not waiting here for communication like slack. The idea of the github issue is if some new developer wants to find information about keyword "Proguard" he will not find it in chat or email, right? This is the right place for this alternative will be lost of time and do the same work many times from different developers. I expecting to view here the tehnical problems the new ideas and enhancement of this project.. and English please ;)

Using Proguard will reduce the fermat.apk size. Every dependency of Android app (no matter how many are) its need to have proguard.pro file. If project have dependency of Google Play Services aar libs they have included proguard.pro and gradle will automatically use it but for other libs its need manually to write it. I think that this snippets will be helpfull

https://github.com/krschultz/android-proguard-snippets

leonacostaok commented 8 years ago

We really appreciate your inputs, and I think that keeping this kind of things in issues is a good idea, but please, try to be "softer" with your comments. We're doing our best, and we take seriously each one of the reviews about our performance.

sytolk commented 8 years ago

@Inacosta I think for the github issues like a part of the source code.. for example this can be true with enhancement tag or false with something like "No we dont have any plan to use proguard" and close it. Question tag and so on.. I think that this issues is a important part of documentation for the project and not technical information here is unwanted but.. Its mean I will try to be "softer" Thanks ;)

Luis-Fernando-Molina commented 8 years ago

How about to Proguard Android app (obfuscate & optimize) instead of using multidex?

@furszy please answer the question.

If you haven't think about it or leave it for some future time please clarify.

@sytolk can you please provide pros and cons of using Proguard now at current stage? Specially the cons since the pros al clear.

furszy commented 8 years ago

@Luis-Fernando-Molina before @sytolk message we already talk vía slack... This is why i didnt respond. I have been working on this in the past but we have some issues to solve until i can put proguard in every single android module. This is one of the next things that i have to do in the near future when i finish some changes in the repository.

furszy commented 8 years ago

And one more thing, is not "instead of multidex" is "with", the 65k methods limit is easy to reach in this kind of project, we are growing every day. For example, the android support library alone have 15k methods and with proguard reduce to 8k. Imagine now how many methods Fermat will have in the future... This is why we have to deal with proguard and multidex for now but in the future we also could create our own custom class loader to deal with this, separate the repository in librarles and optimize every single one, among other things to do.

sytolk commented 8 years ago

Lets try

Pros:

  1. small Android apk size
  2. its hard to review Proguarded obfuscated source code output of the Java decompiler (for the closed source project Proguard = security)
  3. skip multidex library usage

Cons:

  1. I suppose that it will take a lots of time.. Its hard to configure Proguard on this stage of the development. Its much easy to add proguard rules when developer write source code from the scratch but now it will forget to keep some classes.. Exceptions and some strange things are also possible. Its need to test proguarded vs not proguarded version to fix it.
  2. If Proguarded source code have > 65K methods its need to use multidex too.
sytolk commented 8 years ago

@furszy you can set question label for this too.

For example, the android support library alone have 15k methods and with proguard reduce to 8k. Imagine now how many methods Fermat will have in the future

to be exact support-v4:21.0.0 have 8078 Overall Method Count before proguarding https://www.contentful.com/blog/2014/10/30/android-and-the-dex-64k-methods-limit/ If you not include google play services library here it will have < 65K but let`s DEX check this. We have slack talk with @furszy he told me that QA had problems activating Proguard I suppose that its have some issues with Gradle Proguard version = 5 (Java 8). From Android SDK proguard version=4 (Java 7)

This is why we have to deal with proguard and multidex for now but in the future we also could create our own custom class loader to deal with this, separate the repository in librarles and optimize every single one, among other things to do.

@furszy I agree that its better to dynamically include with class loader different plugins but dont forget to proguard them ;) I really not understand why its need to think for the temporary solutions only? there is a deadline ?

furszy commented 8 years ago

Yes, every single person in Fermat has a goal to reach, we are preparing Fermat to the big launch. I am working on this kind of things in my free time, improvements and optimizations that are importat but not extremely necessary at this time. These kinds of issues are things that i have to do with extremely patience and step by step because we have a lot of people in developing at this moment . I have written this on my to do list to do it without interfering with anyone. Thank you for your contributions.