Skip to content

Commit

Permalink
Fix kernel params list with no busybox
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennoard committed Dec 29, 2019
1 parent e39b4e5 commit 3ea491a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class KernelParamsListActivity : AppCompatActivity() {
private suspend fun getKernelParams() = withContext(Dispatchers.Default) {
delay(500)
val kernelParams = mutableListOf<KernelParameter>()
RootUtils.executeWithOutput("busybox sysctl -a", "") { line ->
val command = if (RootUtils.isBusyboxAvailable()) "busybox sysctl -a" else "sysctl -a"
RootUtils.executeWithOutput(command, "") { line ->
line?.let {
if (!it.contains("denied") && !it.startsWith("sysctl") && it.contains("=")) {
val kernelParam = it.split("=").first().trim()
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/fast_scroll_thumb.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/colorAccentLight" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="#ccc" />
</shape>
</item>
</selector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/fast_scroll_track.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#1FFFFFFF" />
</shape>
8 changes: 7 additions & 1 deletion app/src/main/res/layout/activity_kernel_params_list.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/paramsListSwipeLayout">
Expand All @@ -8,6 +9,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/paramsListRecyclerView"
android:scrollbars="vertical"/>
app:fastScrollEnabled="true"
app:fastScrollHorizontalThumbDrawable="@drawable/fast_scroll_thumb"
app:fastScrollHorizontalTrackDrawable="@drawable/fast_scroll_track"
app:fastScrollVerticalThumbDrawable="@drawable/fast_scroll_thumb"
app:fastScrollVerticalTrackDrawable="@drawable/fast_scroll_track"
/>

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

0 comments on commit 3ea491a

Please sign in to comment.