Merge pull request #345 from kyelbek/dev
Fix crashes in root variant after device reboots.
This commit is contained in:
commit
3a8722bdc8
|
@ -88,10 +88,10 @@ object Extensions {
|
|||
}
|
||||
}
|
||||
|
||||
fun Context.writeServiceDScript(path: String, apkFPath: String, app: String) {
|
||||
fun Context.writeServiceDScript(apkFPath: String, path: String, app: String) {
|
||||
val shellFileZ = SuFile.open("/data/adb/service.d/$app.sh")
|
||||
shellFileZ.createNewFile()
|
||||
val code = """#!/system/bin/sh${"\n"}while [ "`getprop sys.boot_completed | tr -d '\r' `" != "1" ]; do sleep ${getDefaultPrefs().getInt("serviced_sleep_timer", 1)}; done${"\n"}mount -o bind $apkFPath $path"""
|
||||
val code = """#!/system/bin/sh${"\n"}while [ "`getprop sys.boot_completed | tr -d '\r' `" != "1" ]; do sleep ${getDefaultPrefs().getInt("serviced_sleep_timer", 1)}; done${"\n"}chcon u:object_r:apk_data_file:s0 $apkFPath${"\n"}mount -o bind $apkFPath $path"""
|
||||
SuFileOutputStream(shellFileZ).use { out -> out.write(code.toByteArray())}
|
||||
}
|
||||
|
||||
|
|
|
@ -524,8 +524,8 @@ object PackageHelper {
|
|||
}
|
||||
|
||||
//set chcon to apk_data_file
|
||||
private fun chConV(path: String, context: Context): Boolean {
|
||||
val response = Shell.su("chcon u:object_r:apk_data_file:s0 $path").exec()
|
||||
private fun chConV(apkFPath: String, context: Context): Boolean {
|
||||
val response = Shell.su("chcon u:object_r:apk_data_file:s0 $apkFPath").exec()
|
||||
//val response = Shell.su("chcon -R u:object_r:system_file:s0 $path").exec()
|
||||
return if (response.isSuccess) {
|
||||
true
|
||||
|
|
Loading…
Reference in New Issue