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

updates #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Gradle
.gradle
build
app/build
/local.properties
/captures

Expand All @@ -15,6 +16,5 @@ build
TrebleApp.apk

# Sdk
/sdk/platform-tools/
/sdk/platforms/
/sdk/build-tools/
sdk
sdk/.knownPackages
20 changes: 9 additions & 11 deletions app/src/main/java/me/phh/treble/app/MiscSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.AlertDialog
import android.app.Application
import android.hardware.display.DisplayManager
import android.os.Bundle
import android.os.SystemProperties
import android.util.Log
import androidx.preference.ListPreference
import androidx.preference.Preference
Expand Down Expand Up @@ -37,6 +38,7 @@ object MiscSettings : Settings {
val aod = "key_misc_aod"
val dt2w = "key_misc_dt2w"
val restartSystemUI = "key_misc_restart_systemui"
val dumpLogs = "key_misc_dump_logs"

override fun enabled() = true
}
Expand Down Expand Up @@ -129,17 +131,13 @@ class MiscSettingsFragment : SettingsFragment() {

val restartSystemUIPref = findPreference<Preference>(MiscSettings.restartSystemUI)
restartSystemUIPref!!.setOnPreferenceClickListener {
var cmds = listOf(
"/sbin/su -c /system/bin/killall com.android.systemui",
"/system/xbin/su -c /system/bin/killall com.android.systemui",
"/system/xbin/phh-su -c /system/bin/killall com.android.systemui",
"/sbin/su 0 /system/bin/killall com.android.systemui",
"/system/xbin/su 0 /system/bin/killall com.android.systemui",
"/system/xbin/phh-su 0 /system/bin/killall com.android.systemui"
)
for (cmd in cmds) {
Runtime.getRuntime().exec(cmd).waitFor()
}
SystemProperties.set("sys.phh.restart_sysui", "true")
return@setOnPreferenceClickListener true
}

val dumpLogsPref = findPreference<Preference>(MiscSettings.dumpLogs)
dumpLogsPref!!.setOnPreferenceClickListener {
SystemProperties.set("sys.phh.dump_logs", "true")
return@setOnPreferenceClickListener true
}
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/pref_misc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
android:targetPackage="me.phh.treble.app"
android:targetClass="me.phh.treble.app.DebugSensors" />
</Preference>
<Preference
android:key="key_misc_dump_logs"
android:title="Dump system logs"
android:summary="Logs will be stored in the file /sdcard/logs.txt" />
<CheckBoxPreference
android:defaultValue="false"
android:key="key_misc_remotectl"
Expand Down