-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Changes to make minifyEnabled work... #1063
base: master
Are you sure you want to change the base?
Conversation
Is it necessary to add the |
Everything seems fine after applying this commit. I also tried removing the proguard and slf4j changes since they did not seem to be necessary. |
Oh, I see now that slf4j and additional proguard rules are required for minify. Sorry about that.. |
is |
Also, since the resources become obfuscated by R8, maybe |
@bitmold When I started testing this on the master branch, I ran into an error because of AGP 8. This is what I did to solve the issue: syphyr@7ec449f |
Minify is causing a bug with retrofit2 by renaming the classes. This causes a fatal exception when selecting the "Ask Tor" feature. I have tried to fix this issue by using the examples here, but so far I have been unsuccessful: @bitmold if you have any further suggestions on this issue, please let me know. |
One suggestion on fixing the retrofit2 issue was to add Keep annotations, but that seems to also not be working.
|
I don't have any suggestions at the time being. Appreciate you posting what you tried here though. My strategy is just to experiment with building orbot with minify until everything works. It's just gonna b a lot of trial and error until it's done but as of right now it's hard to suggest anything without compiling+deploying & recompiling+redeploying, etc
…On Sunday, January 28th, 2024 at 9:27 PM, Deltadroid ***@***.***> wrote:
One suggestion on fixing the retrofit2 issue was to add Keep annotations, but that seems to also not be working.
--- a/app/src/main/java/org/torproject/android/circumvention/CircumventionApi.kt
+++ b/app/src/main/java/org/torproject/android/circumvention/CircumventionApi.kt
@@ -12,10 +12,11 @@ import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
+import androidx.annotation.Keep
import java.net.InetSocketAddress
import java.net.Proxy
-
***@***.***
interface CircumventionEndpoints {
@get("countries")
—
Reply to this email directly, [view it on GitHub](#1063 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFIZYDLW6DY5H7W7EGJGE4LYQ27D3AVCNFSM6AAAAABCJ4PIXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTG4ZDOMBXGA).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Using the @keep annotations seems like the easiest approach. Here is some further info that seems useful: |
Was testing this and it seems to work, shaves off some megabytes.
It ought to be tested more thoroughly, but I'm confident with what I've seen so far. Open to feedback, of coruse.
You either need to make release builds, or do what I was doing and just change the
release
part ofbuildTypes
in each module's build.gradle todebug
...Again, would kindly appreciate your thoroughness here @syphyr