n76 / DejaVu

Yet another network location backend for the UnifiedNLP/microG project
GNU General Public License v3.0
100 stars 18 forks source link

Database files permissions #14

Closed Dr-Cool closed 6 years ago

Dr-Cool commented 6 years ago

Hi, I have DejaVu installed in a Fairphone 2 with their latest Open FP OS, microG and Xposed. The backend worked initially but it tended to crash frequently. It crashed every time I deactivated and reactivated DejaVu in the microG framework app, and sometimes when there was database recording activity. I solved the problem by assigning full file system permissions (-rwxrwxrwx) to the two database files in /data/data/.

n76 commented 6 years ago

This seems really odd. . . Those database files should be owned by the backend APK under the normal Android permissions scheme. Does Fairphone do something non-standard with permissions?

Can you send me a logcat covering the force close when it fails?

Dr-Cool commented 6 years ago

Please follow this link for the relevant logcat file and see below two pictures with file permissions and the crash screen. This is based on the crash that happens after I reactivate the module in the microG menu. It's a fully reproducible crash, not random. Turning location off and then on reproduces the same crash. Random crashes also happen when the module adds data to the database. As I told you, generalizing permissions to rwxrwxrwx solves the crash problem. Increasing to rw-rw-rw- seems to solve it too, but I got random crashes twice during one day with this set of permissions, while I had none with the other set that includes "execute" - but this could be a coincidence. This behavior started after something was added to the database a few days ago. If I erase all app data and start again from scratch the crashes stop, but as soon as I recopy a backup of the database file back into the /data/data directory (using TWRP) the crashes restart. I don't think the Open FP OS does anything extraordinary to permissions, except that I had problems once when I copied a SyncMe app database backup back into /data/data and it refused to work with the original permissions, so I had to extend them to rw-rw-rw-. Let me know if I can help you with more info please.

screenshot_20180222-105322

screenshot_20180222-105529

Dr-Cool commented 6 years ago

Never mind, I suspected there was something wrong with app and system permissions so I downloaded an app called "Fix Permissions" and applied it to DejaVu. No more crashes with the original large database, problem solved. Sorry for wasting your time.

Dr-Cool commented 6 years ago

And thanks for your feedback!