Catfriend1 / syncthing-android

Syncthing-Fork - A Syncthing Wrapper for Android.
Mozilla Public License 2.0
1.8k stars 53 forks source link

Cannot use syncthing fork, instead opens camera #838

Closed jdbosser closed 3 years ago

jdbosser commented 3 years ago

Description of the issue

I just installed syncthing-fork. I have never installed the app before (though I have used the original syncthing android application before). I touch to open the app, and syncthing-fork asks me to give it permissions. I grant the permissions, and my camera application pops up. Now, if I close the app (or even force close it from the settings) and reopen it, my camera opens. If I take a picture, it says that the app failed to take a picture, and reopens the camera app. I am thus unable to configure the app, add folders that want to sync, etc. I think that the syncthing-fork activity opens syncthing-camera instead, which I can only assume should not be happening.

Note that, I noticed that if I open the app from F-Droid (from where I installed the app), I think I can open the correct activity. Though, even if I found a solution to my problem, I was first met with some initial confusion after installing the app and opening it from the app drawer. Thus, I still find this to be a relevant issue, and that it should be considered to be fixed.

The provided logs are from when I open the syncthing-fork in my app drawer and try to take a picture. Note that this is the first time I have submitted an issue regarding an android app. I do not know which parts of the log are relevant for you. I searched for syncthing in the log, and took the parts that I thought would be relevant for you. If I missed something, and you want me to repeat the logging procedure, I would gladly help you out provided that you give me some instructions on how to gather them and what is relevant for you.

Reproduction Steps

Version Information

Device platform info

[ro.product.board]: [exynos9820]
[ro.product.brand]: [samsung]
[ro.product.build.date]: [Tue Aug 10 07:09:54 UTC 2021]
[ro.product.build.date.utc]: [1628579394]
[ro.product.build.fingerprint]: [samsung/lineage_beyond1lte/beyond1lte:11/RQ3A.210805.001.A1/root08100709:userdebug/dev-keys]
[ro.product.build.id]: [RQ3A.210805.001.A1]
[ro.product.build.tags]: [dev-keys]
[ro.product.build.type]: [userdebug]
[ro.product.build.version.incremental]: [eng.root.20210810.071238]
[ro.product.build.version.release]: [11]
[ro.product.build.version.release_or_codename]: [11]
[ro.product.build.version.sdk]: [30]
[ro.product.cpu.abi]: [arm64-v8a]
[ro.product.cpu.abilist]: [arm64-v8a,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: [arm64-v8a]
[ro.product.device]: [beyond1lte]
[ro.product.first_api_level]: [28]
[ro.product.locale]: [en-US]
[ro.product.manufacturer]: [samsung]
[ro.product.model]: [SM-G973F]
[ro.product.name]: [lineage_beyond1lte]
[ro.product.odm.brand]: [samsung]
[ro.product.odm.device]: [beyond1lte]
[ro.product.odm.manufacturer]: [samsung]
[ro.product.odm.model]: [SM-G973F]
[ro.product.odm.name]: [lineage_beyond1lte]
[ro.product.product.brand]: [samsung]
[ro.product.product.device]: [beyond1lte]
[ro.product.product.manufacturer]: [samsung]
[ro.product.product.model]: [SM-G973F]
[ro.product.product.name]: [lineage_beyond1lte]
[ro.product.system.brand]: [samsung]
[ro.product.system.device]: [beyond1lte]
[ro.product.system.manufacturer]: [samsung]
[ro.product.system.model]: [SM-G973F]
[ro.product.system.name]: [lineage_beyond1lte]
[ro.product.system_ext.brand]: [samsung]
[ro.product.system_ext.device]: [beyond1lte]
[ro.product.system_ext.manufacturer]: [samsung]
[ro.product.system_ext.model]: [SM-G973F]
[ro.product.system_ext.name]: [lineage_beyond1lte]
[ro.product.vendor.brand]: [samsung]
[ro.product.vendor.device]: [beyond1lte]
[ro.product.vendor.manufacturer]: [samsung]
[ro.product.vendor.model]: [SM-G973F]
[ro.product.vendor.name]: [lineage_beyond1lte]
[ro.product_ship]: [true]

Android Log

08-24 10:28:52.507 27619 27638 W Role    : com.github.catfriend1.syncthingandroid not qualified for android.app.role.HOME due to missing RequiredComponent{mIntentFilterData=IntentFilterData{mAction='android.intent.action.MAIN', mCategories='[android.intent.category.HOME]', mDataScheme='null', mDataType='null'}, mPermission='null'}
08-24 10:28:52.509 27619 27638 W Role    : com.github.catfriend1.syncthingandroid not qualified for android.app.role.DIALER due to missing RequiredComponent{mIntentFilterData=IntentFilterData{mAction='android.intent.action.DIAL', mCategories='[]', mDataScheme='null', mDataType='null'}, mPermission='null'}
08-24 10:28:52.512 27619 31005 W Role    : com.github.catfriend1.syncthingandroid not qualified for android.app.role.SMS due to missing RequiredComponent{mIntentFilterData=IntentFilterData{mAction='android.provider.Telephony.SMS_DELIVER', mCategories='[]', mDataScheme='null', mDataType='null'}, mPermission='android.permission.BROADCAST_SMS'}
08-24 10:28:54.120 32181 32181 D AppButtonsPrefCtl: Stopping package com.github.catfriend1.syncthingandroid
08-24 10:28:54.122  5888 19953 I ActivityManager: Force stopping com.github.catfriend1.syncthingandroid appid=10216 user=0: from pid 32181
08-24 10:28:54.122  5888 19953 I ActivityManager: Killing 32185:com.github.catfriend1.syncthingandroid/u0a216 (adj 900): stop com.github.catfriend1.syncthingandroid due to from pid 32181
08-24 10:28:54.123  5888 19953 W ActivityTaskManager: Force removing ActivityRecord{7acbc13 u0 com.github.catfriend1.syncthingandroid/com.nutomic.syncthingandroid.activities.PhotoShootActivity t731 f}}: app died, no saved state
08-24 10:28:54.134  5786  5871 I bauth_FPBAuthService: pcf : 0x1012, 0 ,3 ,0 ,0 ,0 ,0, 5.1.0.1
08-24 10:28:54.134  5786  5871 I bauth_FPBAuthService: thread id : 3, preenroll_flag : 0, nd cnt : 0, cso : 0, et : 0
08-24 10:28:54.134  5786  5871 I bauth_FPBAuthService: FPBAuthService, 11556
08-24 10:28:54.134 32181 32181 D AppButtonsPrefCtl: Sending broadcast to query restart status for com.github.catfriend1.syncthingandroid
08-24 10:28:54.136  5888  5933 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_RESTARTED dat=package:com.github.catfriend1.syncthingandroid flg=0x10 (has extras) } to com.google.android.gms/org.microg.nlp.service.PackageChangedReceiver
08-24 10:29:19.497  5888  6907 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.github.catfriend1.syncthingandroid/com.nutomic.syncthingandroid.activities.PhotoShootActivity} from uid 10181
08-24 10:29:19.499  5647  5688 D audio_hw_primary: fast_out-out_update_source_metadata: called, but not implemented yet
08-24 10:29:19.499  5647  5688 D audio_hw_primary: fast_out-out_update_source_metadata: This stream has 1 tracks
08-24 10:29:19.499  5647  5688 D audio_hw_primary: 1 Track has Usage(13), Content Type(4), Gain(0.028182)
08-24 10:29:19.499  5647 14954 I audio_hw_primary: fast_out-out_write: transited to Ready
08-24 10:29:19.500  5647 14954 D audio_hw_primary: fast_out-check_and_set_backend_mixer: no need to update backend 2 -> 2, out->backend_mode:2 
08-24 10:29:19.500  5647 14954 I audio_hw_primary: fast_out-out_write: try to route for playback
08-24 10:29:19.500  5647 14954 D audio_route: Apply path: media-dual-speaker
08-24 10:29:19.500  5647 14954 I audio_route: > audio_route_update_path : "media-dual-speaker" reverse(0)
08-24 10:29:19.500  5888 10503 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-24 10:29:19.513  5888  5924 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10216; state: DISABLED
08-24 10:29:19.513  5888  5934 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10216; state: ENABLED
08-24 10:29:19.516  5888  5934 I ActivityManager: Start proc 464:com.github.catfriend1.syncthingandroid/u0a216 for pre-top-activity {com.github.catfriend1.syncthingandroid/com.nutomic.syncthingandroid.activities.PhotoShootActivity}
0
08-24 10:29:25.941   464  1784 E DatabaseUtils: java.lang.SecurityException: Permission Denial: writing androidx.core.content.FileProvider uri content://com.github.catfriend1.syncthingandroid.provider/my_images/Pictures/IMG_20210824_102304_3465459050056934276.jpg from pid=32183, uid=10151 requires the provider be exported, or grantUriPermission()
08-24 10:29:25.941   464  1784 E DatabaseUtils:     at android.content.ContentProvider.enforceWritePermissionInner(ContentProvider.java:896)
08-24 10:29:25.941   464  1784 E DatabaseUtils:     at android.content.ContentProvider$Transport.enforceWritePermission(ContentProvider.java:696)
08-24 10:29:25.941   464  1784 E DatabaseUtils:     at android.content.ContentProvider$Transport.enforceFilePermission(ContentProvider.java:669)
08-24 10:29:25.941   464  1784 E DatabaseUtils:     at android.content.ContentProvider$Transport.openAssetFile(ContentProvider.java:493)
08-24 10:29:25.941   464  1784 E DatabaseUtils:     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:272)
08-24 10:29:25.941   464  1784 E DatabaseUtils:     at android.os.Binder.execTransactInternal(Binder.java:1159)
08-24 10:29:25.941   464  1784 E DatabaseUtils:     at android.os.Binder.execTransact(Binder.java:1123)
08-24 10:29:24.861     0     0 I         : [2:         writer:14954] samsung-abox-rdma 18c51100.abox-rdma: abox_qos_request_aud(0xda100011, 394000)
08-24 10:29:25.941  5888  6444 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-24 10:29:25.942 32183 32183 D AndroidRuntime: Shutting down VM
08-24 10:29:24.862     0     0 I         : [2:         writer:14954] samsung-abox 18c50000.abox: asrc_config(7, 0, 1, 48000Hz, 1, 48000Hz, 24bit, 0)
08-24 10:29:25.942 32183 32183 E AndroidRuntime: FATAL EXCEPTION: main
08-24 10:29:25.942 32183 32183 E AndroidRuntime: Process: org.lineageos.snap, PID: 32183
08-24 10:29:25.942 32183 32183 E AndroidRuntime: java.lang.SecurityException: Permission Denial: writing androidx.core.content.FileProvider uri content://com.github.catfriend1.syncthingandroid.provider/my_images/Pictures/IMG_20210824_102304_3465459050056934276.jpg from pid=32183, uid=10151 requires the provider be exported, or grantUriPermission()
Catfriend1 commented 3 years ago

Hi @jdbosser

thank you for your detailed report. Honestly, I'm no longer working on improving the camera feature and just didn't get so far to remove it for everybody (as some little group of people seem to like it). Maybe it'll get a QuickSetting tile some day.

Your issue that by default the camera opens even if it's not the default activity declared in the app's manifest doesn't give me a hint where to start to look at in code. I'm not 100% sure, but this may be a ROM issue so I'd suggest you contact your ROM venvor on this, especially the team that made your launcher app.

Thank you.

Kind regards, Catfriend1

Catfriend1 commented 3 years ago

Solved by PR #845