Comments (12)
Shrinking apps can definitely get troublesome, let me expand further:
Could you please elaborate a bit more what a 3rd party app needs to do? As I understand you, we should
* Merge your branch into the official SSO lib (would you mind opening a PR for that?)
Yes by declaring them as consumer rules R8/ProGuard automatically picks them up.
Ideally there would be separate modules for sso-rxjava2/3 like in retrofit
. Regardless of minification, apps end up with deps they don't use as they probably won't use rxjava
version 2 and 3 at same time. Just merging my branch would feel a bit dirty, though it would be better than now. Splitting into modules can always happen afterwards.
* The 3rd party apps should still need to add the flag `-dontobfuscate`? Where exactly?
This goes into the proguard-rules.pro
of a 3rd party app like news-android for example.
Enabling obfuscation always breaks SSO in my experiments and isn't needed in OSS in my view.
* Maybe we could add a section in the `README.md` that explains this and your instructions for `android.r8.fullMode` before merging your branch?
Sure, I can add a R8/ProGuard section with some references to the README
.
from android-singlesignon.
I assume because the classes have to have the exact same name on both sides (sso / 3rd party app and Nextcloud).
We had similar issues with the Notes app once and stopped our minifying experiments because of it, but i assume if you define exception rules for the sso package, it should work. Feedback welcome 😉
from android-singlesignon.
At least I'm not the only one who have seen this issue 😄
I will probably experiment a bit around it soon.
Nevertheless that information should probably be somewhere in the readme ?
from android-singlesignon.
Actually, it makes sense in an architectural way - the method and class names are part of an API (between the apps) - minifying one end changes the method and class names to random stuff - a breaking change.
However, I absolutely agree with you, and I propose to add the documentation as soon as
I will probably experiment a bit around it soon.
we know some rules which work 😉 if you share the result with us.
from android-singlesignon.
Using the following works
postprocessing {
removeUnusedCode false
removeUnusedResources true
obfuscate false
optimizeCode true
}
Instead of
minifyEnabled true
shrinkResources true
Note that it might be possible to set removeUnusedCode
to true
depending on the application.
In that case, using @SerializedName()
for all parameters of the models (and the nested classes) - for instance here - will make that library work with obfuscated applications (== minifyEnabled true
).
from android-singlesignon.
Awesome, thanks for the update! I'll test the proposed configuration.
from android-singlesignon.
You will test on Notes ? Let me know if removeUnusedCode
to true
works :)
from android-singlesignon.
Guy's just to let you know Bookmarks also faild with the similer error.
from android-singlesignon.
This branch https://github.com/Unpublished/Android-SingleSignOn/tree/proguardRules contains proguard consumer rules.
The provided rules work quite good together with -dontobfuscate
. If you additionally use android.r8.fullMode=true
you need to keep your retrofit and gson related classes, as following for UP-NextPush:
# retrofit
-keep class org.unifiedpush.distributor.nextpush.api.ApiResponse
# gson
-keep class org.unifiedpush.distributor.nextpush.api.SSEResponse { <fields>; }
from android-singlesignon.
@Unpublished I don't have much experience with shrinking and / or obfuscating apps (due to issues with Nextcloud SSO I just disabled it and did not think about it again).
Could you please elaborate a bit more what a 3rd party app needs to do? As I understand you, we should
- Merge your branch into the official SSO lib (would you mind opening a PR for that?)
- The 3rd party apps should still need to add the flag
-dontobfuscate
? Where exactly? - Maybe we could add a section in the
README.md
that explains this and your instructions forandroid.r8.fullMode
before merging your branch?
from android-singlesignon.
@p1gp1g would you mind testing the changes from #545 and do a review? 🙂 🚀
from android-singlesignon.
I think this issue can be closed (see #545).
Feel free to reopen.
from android-singlesignon.
Related Issues (20)
- Provide convenience class for OCS requests HOT 4
- Support .qa package id of the files app
- Convenience features for `NextcloudRequest.Builder`
- Handle `QueryParam` with key "`c`" HOT 4
- SEARCH HTTP method is not supported HOT 7
- Support Activity Result API HOT 3
- Rotation issues
- i18n: `Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE).` HOT 7
- If only dev app is installed SSO doesn't work HOT 8
- Migrate to Material 3 theme HOT 1
- Option to create new token on `TokenMismatchException` HOT 3
- Availablity on Amazon store HOT 1
- Instantiating `Void` does no longer work with AGP 8 HOT 18
- Improve SSO error dialogs shown by 3rd-party-apps HOT 2
- Check `NetworkRequest#mDestroyed` before each network request? HOT 1
- Readme contains bad R8 advice HOT 1
- Reportedly not working when used within Samsung Knox HOT 1
- Possibility to get WebDAV-capable app password/token from SSO HOT 5
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-singlesignon.