Prevent fake clicks on SuRequest

This commit is contained in:
Fox2Code 2020-02-10 10:08:53 +00:00 committed by GitHub
parent 3b8d2fe8b7
commit 022151fefd

View File

@ -6,6 +6,7 @@ import android.content.res.Resources
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.Window import android.view.Window
import android.view.WindowManager
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.core.su.SuCallbackHandler import com.topjohnwu.magisk.core.su.SuCallbackHandler
import com.topjohnwu.magisk.core.su.SuCallbackHandler.REQUEST import com.topjohnwu.magisk.core.su.SuCallbackHandler.REQUEST
@ -32,6 +33,8 @@ open class SuRequestActivity : BaseUIActivity<SuRequestViewModel, ActivityReques
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
supportRequestWindowFeature(Window.FEATURE_NO_TITLE) supportRequestWindowFeature(Window.FEATURE_NO_TITLE)
lockOrientation() lockOrientation()
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE)
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
fun showRequest() { fun showRequest() {
@ -40,11 +43,7 @@ open class SuRequestActivity : BaseUIActivity<SuRequestViewModel, ActivityReques
} }
fun runHandler(action: String?) { fun runHandler(action: String?) {
SuCallbackHandler( SuCallbackHandler(this, action, intent.extras)
this,
action,
intent.extras
)
finish() finish()
} }