topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
47.6k stars 12.09k forks source link

Molotov.tv crash after rooting through Magisk even after MagiskHide because of Magisk default permissions changes #2674

Closed ytrezq closed 4 years ago

ytrezq commented 4 years ago

The only way to get some Free French tv channels over the Internet for free.

The app can be installed normally without root. But on BootUp it crashes after showing the logo.

04-10 23:28:15.608 27986 28012 W ContextImpl: Failed to ensure /data/user/0/tv.molotov.app/databases: mkdir failed: EACCES (Permission denied)
04-10 23:28:15.608 27986 28012 E SQLiteLog: (14) cannot open file at line 37853 of [c255889bd9]
04-10 23:28:15.608 27986 28012 E SQLiteLog: (14) os_unix.c:37853: (13) lstat(/data/user/0/tv.molotov.app/databases/androidx.work.workdb) - 
04-10 23:28:15.608 27986 28012 E SQLiteLog: (1) Process tv.molotov.app : Pid (27986) Uid (10260) Euid (10260) Gid (10260) Egid (10260)
04-10 23:28:15.608 27986 28012 E SQLiteLog: (1) osStat failed "/data/user/0/tv.molotov.app/databases/androidx.work.workdb" due to error (13)
04-10 23:28:15.608 27986 28012 E SQLiteLog: (1) osStat failed "/data/user/0/tv.molotov.app/databases" due to error (13)
04-10 23:28:15.608 27986 28012 E SQLiteLog: (1) Stat of /data/user/0/tv.molotov.app : st_mode(40700) st_uid(10246) st_gid(10246) st_ino(12714565)
04-10 23:28:15.608 27986 28012 E SQLiteLog: (1) Stat of /data/user/0 : st_mode(40771) st_uid(1000) st_gid(1000) st_ino(12058625)
04-10 23:28:15.608 27986 28012 E SQLiteLog: (1) Stat of /data/user : st_mode(40711) st_uid(1000) st_gid(1000) st_ino(11665409)
04-10 23:28:15.608 27986 28012 E SQLiteLog: (1) Stat of /data : st_mode(40771) st_uid(1000) st_gid(1000) st_ino(2)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase: Failed to open database '/data/user/0/tv.molotov.app/databases/androidx.work.workdb'.
04-10 23:28:15.609 27986 28012 E SQLiteDatabase: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 1806 SQLITE_CANTOPEN_EACCES[1806]): Could not open database
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:284)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:705)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:272)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:239)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:1292)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:1247)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:903)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:893)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:355)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:298)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(SourceFile:92)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(SourceFile:53)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at androidx.room.RoomDatabase.beginTransaction(SourceFile:352)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at androidx.work.impl.utils.ForceStopRunnable.cleanUp(SourceFile:135)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at androidx.work.impl.utils.ForceStopRunnable.run(SourceFile:79)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at androidx.work.impl.utils.SerialExecutor$Task.run(SourceFile:75)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
04-10 23:28:15.609 27986 28012 E SQLiteDatabase:        at java.lang.Thread.run(Thread.java:764)
04-10 23:28:15.609 27986 28012 I Process : Sending signal. PID: 27986 SIG: 9

So it seems the reason is when using a System Service based on Sqlite that it can’t create a directory in the same folder of the app. Because of unusual Selinux changes?

In the meantime, the Linux version of the app is working the same way it does without root. But having to open a command prompt along with an Xorg app just for watching the first channel is annoying.

osm0sis commented 4 years ago

1152

ytrezq commented 4 years ago

@osm0sis this seems to be different and I found why. This happens when the app is restored through adb restore with Magisk enabled (with both the apk and the data at the same time).

osm0sis commented 4 years ago

@topjohnwu, was there a fix to the sepolicy change that will fix adb restore? Otherwise, sounds like this should still be open.