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

Files app installed from Fdroid is not detected #899

Closed
nkakouros opened this issue Nov 19, 2020 · 16 comments · Fixed by nextcloud/Android-SingleSignOn#284
Closed

Files app installed from Fdroid is not detected #899

nkakouros opened this issue Nov 19, 2020 · 16 comments · Fixed by nextcloud/Android-SingleSignOn#284

Comments

@nkakouros
Copy link

nkakouros commented Nov 19, 2020

I am trying to use the "Login using Nextcloud Files App" option when setting up the News app. I get an error:

Nextcloud Files App is not installed. Please install it: https://play.google.com/store/apps/details?id=com.nextcloud.client

I have installed the News app from F-droid too, version 0.9.9.50.

@David-Development
Copy link
Member

@nkakouros Thank you for the report. Which Version of Android are you on? And whats the Nextcloud Files Version you are using? Are you using the official one or the dev build? (https://f-droid.org/en/packages/com.nextcloud.client/ or https://f-droid.org/en/packages/com.nextcloud.android.beta/)

@nkakouros
Copy link
Author

I am using an Android 10 based rom (Resurrection Remix). I am using the dev version of the Files app (version 20201114).

@David-Development
Copy link
Member

@nkakouros That is weird.. We used to have some issues with the dev app but that was over a year ago. It should be able to pick up the dev app as well.

Can you check if there are any suspicious logs when you start the app and click on "Login using Nextcloud Files App"? (you can check that with logcat).

Do you know if this custom rom has some special permission features so that it might block the visibility of other apps? Are you also using the deck or notes app? They are using SSO as well. Would be interesting to know if they have the same problem.

@nkakouros
Copy link
Author

I just tried with the Deck app, version 1.12.1 and Notes, version 2.17.1 and they pick up my account from the Files app.

I uninstalled the news app and re-installed from fdroid. I fired up a logcat viewer and filter by "news". This is the output:

<<< log_count = 7 >>>
[11-19 17:40:47.251 15882:15882 W/cloudnewsreader]
type=1400 audit(0.0:63309): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 17:40:47.255 15882:15882 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 1 line

[11-19 17:40:47.259 15882:15882 W/cloudnewsreader]
type=1400 audit(0.0:63312): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 17:40:47.263 15882:15882 W/cloudnewsreader]
type=1400 audit(0.0:63313): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 17:40:47.288 15882:15882 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 4 lines

[11-19 17:40:48.465 1017:7493 E/InputDispatcher]
Window handle Window{fad8aa2 u0 de.luhmer.owncloudnewsreader/de.luhmer.owncloudnewsreader.LoginDialogActivity} has no registered input channel

[11-19 17:40:48.484 1017:7493 E/InputDispatcher]
Window handle Window{fad8aa2 u0 de.luhmer.owncloudnewsreader/de.luhmer.owncloudnewsreader.LoginDialogActivity} has no registered input channel

I am not aware of any hiding/limitation in the rom. I grant permissions when asked.

@David-Development
Copy link
Member

That is quite weird. I'm using the same SSO Version as the Deck app (0.5.4).. @stefan-niedermann do you have an idea what might be going on here? 🤔

@stefan-niedermann
Copy link
Member

Hmm. I guess you did not yet raise your targetSdk to 30?

@David-Development
Copy link
Member

@stefan-niedermann No, I didn't raise it yet, I'm still on these settings:

ANDROID_BUILD_MIN_SDK_VERSION=17
ANDROID_BUILD_TARGET_SDK_VERSION=29
ANDROID_BUILD_SDK_VERSION=29

@nkakouros Are there any other logs / errors? There should be some more logs after starting the app / while you click on the login button.

@nkakouros
Copy link
Author

I fired the log reader before launching the news app. Here are the logs, again filtered for news (I hope I am not excluding anything useful this way):

<<< log_count = 60 >>>
[11-19 21:04:25.061 1017:1316 I/ActivityTaskManager]
START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.luhmer.owncloudnewsreader/.NewsReaderListActivity bnds=[55,1239][259,1475]} from uid 10214

[11-19 21:04:25.109 2757:2757 E/cloudnewsreade]
Not starting debugger since process cannot load the jdwp agent.

[11-19 21:04:25.111 2757:2757 W/cloudnewsreade]
Core platform API violation: Ljava/lang/reflect/Field;->accessFlags:I from Landroid/os/Build; using reflection

[11-19 21:04:25.116 1017:1117 I/ActivityManager]
Start proc 2757:de.luhmer.owncloudnewsreader/u0a290 for pre-top-activity {de.luhmer.owncloudnewsreader/de.luhmer.owncloudnewsreader.NewsReaderListActivity}

[11-19 21:04:25.161 2757:8210 I/cloudnewsreade]
Starting a blocking GC Alloc

[11-19 21:04:25.161 2757:8210 I/cloudnewsreade]
Starting a blocking GC Alloc

[11-19 21:04:25.164 2757:2757 I/cloudnewsreade]
Waiting for a blocking GC Alloc

[11-19 21:04:25.174 2757:2757 I/cloudnewsreade]
WaitForGcToComplete blocked Alloc on AddRemoveAppImageSpace for 10.710ms

[11-19 21:04:25.174 2757:2757 I/cloudnewsreade]
Starting a blocking GC Alloc

[11-19 21:04:25.253 2757:2757 V/de.luhmer.owncloudnewsreader.helper.ThemeChooser]
Auto (Light / Dark)

[11-19 21:04:25.260 2757:2757 V/de.luhmer.owncloudnewsreader.helper.ThemeChooser]
MODE_NIGHT_AUTO (Dark Theme)

[11-19 21:04:25.332 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 1 line

[11-19 21:04:25.326 2757:2757 W/cloudnewsreader]
type=1400 audit(0.0:67079): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 21:04:25.330 2757:2757 W/cloudnewsreader]
type=1400 audit(0.0:67081): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 21:04:25.338 2757:2757 W/cloudnewsreader]
type=1400 audit(0.0:67082): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 21:04:25.378 2757:2757 W/cloudnewsreader]
type=1400 audit(0.0:67084): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 21:04:25.382 2757:2757 W/cloudnewsreader]
type=1400 audit(0.0:67085): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 21:04:25.401 1017:10504 I/ActivityTaskManager]
START u0 {cmp=de.luhmer.owncloudnewsreader/.LoginDialogActivity} from uid 10290

[11-19 21:04:25.421 2757:2757 V/de.luhmer.owncloudnewsreader.NewsReaderDetailFragment]
Creating new instance

[11-19 21:04:25.421 2757:2757 V/de.luhmer.owncloudnewsreader.NewsReaderDetailFragment]
updateCurrentRssView

[11-19 21:04:25.432 2757:8210 V/de.luhmer.owncloudnewsreader.database.DatabaseConnectionOrm]
Time needed for insert: 0:0:0.0

[11-19 21:04:25.435 2757:8210 V/de.luhmer.owncloudnewsreader.NewsReaderDetailFragment]
Time needed (init loading): 0:0:0.0

[11-19 21:04:25.528 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 5 lines

[11-19 21:04:25.551 2757:8210 V/de.luhmer.owncloudnewsreader.ListView.SubscriptionExpandableListAdapter]
Time needed (fetch folder list): 0:0:0.0

[11-19 21:04:25.554 2757:8210 V/de.luhmer.owncloudnewsreader.ListView.SubscriptionExpandableListAdapter]
Reload Adapter - time taken: 0:0:0.0

[11-19 21:04:25.558 2757:2757 D/de.luhmer.owncloudnewsreader.services.OwnCloudSyncService]
isSyncRunning() called

[11-19 21:04:25.559 2757:8210 V/de.luhmer.owncloudnewsreader.ListView.SubscriptionExpandableListAdapter]
Time needed (fetch folder list): 0:0:0.0

[11-19 21:04:25.561 2757:8210 V/de.luhmer.owncloudnewsreader.ListView.SubscriptionExpandableListAdapter]
Reload Adapter - time taken: 0:0:0.0

[11-19 21:04:25.567 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 1 line

[11-19 21:04:25.575 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 6 lines

[11-19 21:04:25.589 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 5 lines

[11-19 21:04:25.597 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 7 lines

[11-19 21:04:25.606 2757:2757 V/de.luhmer.owncloudnewsreader.NewsReaderDetailFragment]
onResume called!

[11-19 21:04:25.623 584:584 E/Layer]
[Surface(name=AppWindowToken{1860d90 token=Token{1de3053 ActivityRecord{577e842 u0 de.luhmer.owncloudnewsreader/.NewsReaderListActivity t681}}})/@0x25719f - animation-leash#0] No local sync point found

[11-19 21:04:25.623 584:584 E/Layer]
[Surface(name=AppWindowToken{1860d90 token=Token{1de3053 ActivityRecord{577e842 u0 de.luhmer.owncloudnewsreader/.NewsReaderListActivity t681}}})/@0x25719f - animation-leash#0] No local sync point found

[11-19 21:04:25.632 1017:10504 I/ActivityTaskManager]
The Process de.luhmer.owncloudnewsreader Already Exists in BG. So sending its PID: 2757

[11-19 21:04:25.653 2757:8210 V/de.luhmer.owncloudnewsreader.ListView.SubscriptionExpandableListAdapter]
Fetched folder/feed counts in 0:0:0.0

[11-19 21:04:25.658 2757:8218 V/de.luhmer.owncloudnewsreader.ListView.SubscriptionExpandableListAdapter]
Fetched folder/feed counts in 0:0:0.0

[11-19 21:04:25.678 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 1 line

[11-19 21:04:25.705 2757:8211 I/GED]
[GT]_getprocess name(de.luhmer.owncloudnewsreader)

[11-19 21:04:25.711 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 2 lines

[11-19 21:04:25.721 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 3 lines

[11-19 21:04:25.782 1017:1115 I/ActivityTaskManager]
Displayed de.luhmer.owncloudnewsreader/.LoginDialogActivity: +718ms

[11-19 21:04:25.866 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 5 lines

[11-19 21:04:25.878 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 5 lines

[11-19 21:04:25.942 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 6 lines

[11-19 21:04:25.946 2757:2757 W/cloudnewsreade]
Accessing hidden field Landroid/widget/TextView;->mCursorDrawableRes:I (greylist-max-p, reflection, denied)

[11-19 21:04:25.947 2757:2757 W/de.luhmer.owncloudnewsreader.helper.ThemeUtils]
Couldn't apply color to search view cursor
java.lang.NoSuchFieldException: No field mCursorDrawableRes in class Landroid/widget/TextView; (declaration of 'android.widget.TextView' appears in /system/framework/framework.jar!classes3.dex)
	at java.lang.Class.getDeclaredField(Native Method)
	at de.luhmer.owncloudnewsreader.helper.ThemeUtils.colorSearchViewCursorColor(SourceFile:4)
	at de.luhmer.owncloudnewsreader.NewsReaderListActivity.onCreateOptionsMenu(SourceFile:10)
	at android.app.Activity.onCreatePanelMenu(Activity.java:4092)
	at androidx.fragment.app.FragmentActivity.onCreatePanelMenu(SourceFile:1)
	at androidx.appcompat.view.WindowCallbackWrapper.onCreatePanelMenu(SourceFile:1)
	at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.onCreatePanelMenu(SourceFile:2)
	at androidx.appcompat.view.WindowCallbackWrapper.onCreatePanelMenu(SourceFile:1)
	at androidx.appcompat.app.ToolbarActionBar.populateOptionsMenu(SourceFile:5)
	at androidx.appcompat.app.ToolbarActionBar$1.run(SourceFile:1)
	at android.os.Handler.handleCallback(Handler.java:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7398)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)

[11-19 21:04:25.947 2757:2757 D/de.luhmer.owncloudnewsreader.services.OwnCloudSyncService]
isSyncRunning() called

[11-19 21:04:25.953 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 2 lines

[11-19 21:04:26.021 2757:2757 D/de.luhmer.owncloudnewsreader.PodcastFragment]
onConnected() called

[11-19 21:04:26.024 2757:2757 D/EventBus]
No subscribers registered for event class de.luhmer.owncloudnewsreader.events.podcast.CollapsePodcastView

[11-19 21:04:26.094 2757:2757 D/PodcastPlaybackService]
onUnbind() called with: intent = [Intent { act=android.media.browse.MediaBrowserService cmp=de.luhmer.owncloudnewsreader/.services.PodcastPlaybackService }]

[11-19 21:04:28.306 2757:2757 W/cloudnewsreader]
type=1400 audit(0.0:67165): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 21:04:28.310 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 1 line

[11-19 21:04:28.314 2757:2757 W/cloudnewsreader]
type=1400 audit(0.0:67168): avc: denied { read } for name="u:object_r:theme_prop:s0" dev="tmpfs" ino=11930 scontext=u:r:untrusted_app:s0:c34,c257,c512,c768 tcontext=u:object_r:theme_prop:s0 tclass=file permissive=0 app=de.luhmer.owncloudnewsreader

[11-19 21:04:28.341 2757:2757 I/chatty]
uid=10290(de.luhmer.owncloudnewsreader) identical 6 lines

[11-19 21:04:29.727 1017:10505 E/InputDispatcher]
Window handle Window{ceb41b9 u0 de.luhmer.owncloudnewsreader/de.luhmer.owncloudnewsreader.LoginDialogActivity} has no registered input channel

[11-19 21:04:29.740 1017:4578 E/InputDispatcher]
Window handle Window{ceb41b9 u0 de.luhmer.owncloudnewsreader/de.luhmer.owncloudnewsreader.LoginDialogActivity} has no registered input channel

[11-19 21:04:30.660 2757:8218 W/de.luhmer.owncloudnewsreader.services.SyncItemStateService]
API is not initialized

@nkakouros
Copy link
Author

nkakouros commented Nov 20, 2020

I installed the stable version of the files app from fdroid and News picked up the account OK.

@David-Development
Copy link
Member

@nkakouros Thanks for the update! I can't seem to identify any issues in the stacktrace you provided. It looks good to me! There is only one error message that is due to some theming issues which can be ignored.

I'll have to run some tests to identify the issue.

It's good to know that the stable version is working for you in the meantime!

@nkakouros
Copy link
Author

I don't know if this is related, but when using the stable version I get twice the single account I have used to log in the Files app.

@stefan-niedermann
Copy link
Member

One account is from the stable version and the other one from the dev version....

So it is basically working, but the dev app hasn't been recognized when it is installed without the stable version. Interesting...

@David-Development
Copy link
Member

David-Development commented Nov 24, 2020

Thank you for the troubleshooting. I managed to reproduce the issue. It looks like I'm running some version checks on the single sign on api and stefan is not 😅 That's why his apps were still working. It will be fixed in the next release


Btw. it should be enough for now to have the stable app installed (you don't need to create an account in it)

@stefan-niedermann
Copy link
Member

uumm 🤔 at least for the notes app i am pretty sure that i am doing a check... but now you are talking about it, i think i haven't updated it for a while - on the other side for the notes app an increased version number is not necessary because it doesn't use retrofit yet and all breaking changes have been in the retrofit requests 🤣

But yeah, i maybe should add a check for the deck app, that's a pretty good hint, thanks!

@stefan-niedermann
Copy link
Member

But given a user has an old stable app and a current dev app and both configured example@example.com, both accounts are presented to the user as a choice.

The user can't know which account is from the current app.

What happens if he picks the account from the outdated app?

@David-Development
Copy link
Member

But yeah, i maybe should add a check for the deck app, that's a pretty good hint, thanks!

Sounds good! 😀

The user can't know which account is from the current app.

That is correct. I believe we have to postpone this until we implement our own Account Manager as I believe that this is limitation of the Build-In Account Manager. --> nextcloud/Android-SingleSignOn#49

What happens if he picks the account from the outdated app?

Well.. probably nothing good.. 😅 Or we need to introduce two min-versions (one for the beta app and one for the stable app).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants