mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-01 08:15:37 +08:00
refactor: migration layout to Hikage
This commit is contained in:
@@ -56,6 +56,17 @@ libraries:
|
||||
dev.zacsweers.autoservice:
|
||||
auto-service-ksp:
|
||||
version: 1.2.0
|
||||
com.highcapable.hikage:
|
||||
hikage-core:
|
||||
version: 1.0.1
|
||||
hikage-compiler:
|
||||
version: 1.0.0
|
||||
hikage-extension:
|
||||
version: 1.0.0
|
||||
hikage-widget-androidx:
|
||||
version: 1.0.0
|
||||
hikage-widget-material:
|
||||
version: 1.0.0
|
||||
androidx.annotation:
|
||||
annotation:
|
||||
version: 1.9.1
|
||||
|
@@ -1,6 +1,7 @@
|
||||
plugins {
|
||||
autowire(libs.plugins.android.application)
|
||||
autowire(libs.plugins.kotlin.android)
|
||||
autowire(libs.plugins.kotlin.ksp)
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -41,6 +42,11 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
ksp(com.highcapable.hikage.hikage.compiler)
|
||||
implementation(com.highcapable.hikage.hikage.core)
|
||||
implementation(com.highcapable.hikage.hikage.extension)
|
||||
implementation(com.highcapable.hikage.hikage.widget.androidx)
|
||||
implementation(com.highcapable.hikage.hikage.widget.material)
|
||||
implementation(androidx.core.core.ktx)
|
||||
implementation(androidx.appcompat.appcompat)
|
||||
implementation(androidx.lifecycle.lifecycle.viewmodel.ktx)
|
||||
|
@@ -19,35 +19,99 @@
|
||||
*
|
||||
* This file is created by fankes on 2022/2/9.
|
||||
*/
|
||||
@file:Suppress("SameParameterValue", "UsePropertyAccessSyntax")
|
||||
@file:Suppress("SetTextI18n", "SameParameterValue", "UsePropertyAccessSyntax")
|
||||
|
||||
package com.highcapable.yukihookapi.demo_app.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.widget.Toast
|
||||
import android.view.Gravity
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.highcapable.yukihookapi.demo_app.databinding.ActivityMainBinding
|
||||
import com.highcapable.betterandroid.ui.extension.view.toast
|
||||
import com.highcapable.betterandroid.ui.extension.view.updateMargins
|
||||
import com.highcapable.hikage.extension.setContentView
|
||||
import com.highcapable.hikage.widget.android.widget.Button
|
||||
import com.highcapable.hikage.widget.android.widget.ImageView
|
||||
import com.highcapable.hikage.widget.android.widget.LinearLayout
|
||||
import com.highcapable.hikage.widget.android.widget.TextView
|
||||
import com.highcapable.hikage.widget.androidx.core.widget.NestedScrollView
|
||||
import com.highcapable.yukihookapi.demo_app.R
|
||||
import com.highcapable.yukihookapi.demo_app.test.Main
|
||||
import android.R as Android_R
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ActivityMainBinding.inflate(layoutInflater).apply {
|
||||
setContentView(root)
|
||||
appDemoFirstText.text = getFirstText()
|
||||
appDemoSecondText.text = secondText
|
||||
appDemoThirdText.text = Main("Feel real").getString()
|
||||
appDemoFourthText.text = getRegularText("Have fun day")
|
||||
appDemoFifthText.text = getDataText()
|
||||
appDemoSixthText.text = getArray(arrayOf("apple", "banana")).let { "${it[0]}, ${it[1]}" }
|
||||
appDemoSeventhText.text = Main().getTestResultFirst()
|
||||
appDemoEighthText.text = Main().getTestResultFirst("Find something interesting")
|
||||
appDemoNinthText.text = Main().getTestResultLast()
|
||||
appDemoTenthText.text = Main().getTestResultLast("This is the last sentence")
|
||||
appDemoEleventhText.text = Main().getSuperString()
|
||||
appDemoButton.setOnClickListener { toast() }
|
||||
val hikage = setContentView {
|
||||
NestedScrollView(
|
||||
lparams = LayoutParams(matchParent = true),
|
||||
init = {
|
||||
isFillViewport = true
|
||||
isVerticalScrollBarEnabled = false
|
||||
}
|
||||
) {
|
||||
LinearLayout(
|
||||
lparams = LayoutParams(widthMatchParent = true) {
|
||||
updateMargins(vertical = 20.dp)
|
||||
},
|
||||
init = {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
gravity = Gravity.CENTER
|
||||
}
|
||||
) {
|
||||
ImageView(
|
||||
lparams = LayoutParams(50.dp, 50.dp) {
|
||||
bottomMargin = 15.dp
|
||||
}
|
||||
) {
|
||||
setImageResource(R.mipmap.ic_face_unhappy)
|
||||
}
|
||||
TextView(
|
||||
lparams = LayoutParams {
|
||||
bottomMargin = 25.dp
|
||||
}
|
||||
) {
|
||||
text = stringResource(R.string.test_string)
|
||||
textSize = 17.5f
|
||||
}
|
||||
repeat(11) {
|
||||
TextView(
|
||||
id = "sample_text_$it",
|
||||
lparams = LayoutParams {
|
||||
bottomMargin = 15.dp
|
||||
}
|
||||
) {
|
||||
text = stringResource(R.string.test_string)
|
||||
textSize = 17.5f
|
||||
}
|
||||
}
|
||||
ImageView(
|
||||
lparams = LayoutParams(30.dp, 30.dp) {
|
||||
bottomMargin = 15.dp
|
||||
}
|
||||
) {
|
||||
setImageResource(Android_R.mipmap.sym_def_app_icon)
|
||||
}
|
||||
Button {
|
||||
text = "Click Me!"
|
||||
setOnClickListener { toast() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
hikage.get<TextView>("sample_text_0").text = getFirstText()
|
||||
hikage.get<TextView>("sample_text_1").text = secondText
|
||||
hikage.get<TextView>("sample_text_2").text = Main("Feel real").getString()
|
||||
hikage.get<TextView>("sample_text_3").text = getRegularText("Have fun day")
|
||||
hikage.get<TextView>("sample_text_4").text = getDataText()
|
||||
hikage.get<TextView>("sample_text_5").text = getArray(arrayOf("apple", "banana")).let { "${it[0]}, ${it[1]}" }
|
||||
hikage.get<TextView>("sample_text_6").text = Main().getTestResultFirst()
|
||||
hikage.get<TextView>("sample_text_7").text = Main().getTestResultFirst("Find something interesting")
|
||||
hikage.get<TextView>("sample_text_8").text = Main().getTestResultLast()
|
||||
hikage.get<TextView>("sample_text_9").text = Main().getTestResultLast("This is the last sentence")
|
||||
hikage.get<TextView>("sample_text_10").text = Main().getSuperString()
|
||||
}
|
||||
|
||||
private val secondText = "This is a miracle"
|
||||
@@ -60,5 +124,5 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
private fun getDataText() = "No data found"
|
||||
|
||||
private fun toast() = Toast.makeText(this, "Nothing to show", Toast.LENGTH_SHORT).show()
|
||||
private fun toast() = toast("Nothing to show")
|
||||
}
|
@@ -1,132 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
tools:ignore="HardcodedText,ContentDescription">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:src="@mipmap/ic_face_unhappy" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:text="@string/test_string"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_first_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_second_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_eleventh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_third_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_fourth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_seventh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_eighth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_ninth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_tenth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_sixth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_demo_fifth_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="sample"
|
||||
android:textSize="17.5sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:src="@android:mipmap/sym_def_app_icon" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/app_demo_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Click Me!"
|
||||
android:textAllCaps="false" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
@@ -46,6 +46,11 @@ dependencies {
|
||||
compileOnly(de.robv.android.xposed.api)
|
||||
implementation(projects.yukihookapiCore)
|
||||
ksp(projects.yukihookapiKspXposed)
|
||||
ksp(com.highcapable.hikage.hikage.compiler)
|
||||
implementation(com.highcapable.hikage.hikage.core)
|
||||
implementation(com.highcapable.hikage.hikage.extension)
|
||||
implementation(com.highcapable.hikage.hikage.widget.androidx)
|
||||
implementation(com.highcapable.hikage.hikage.widget.material)
|
||||
implementation(androidx.preference.preference.ktx)
|
||||
implementation(androidx.core.core.ktx)
|
||||
implementation(androidx.appcompat.appcompat)
|
||||
|
@@ -23,13 +23,26 @@
|
||||
|
||||
package com.highcapable.yukihookapi.demo_module.ui
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.Gravity
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.updateMargins
|
||||
import com.highcapable.betterandroid.ui.extension.component.startActivity
|
||||
import com.highcapable.betterandroid.ui.extension.view.textToString
|
||||
import com.highcapable.betterandroid.ui.extension.view.toast
|
||||
import com.highcapable.betterandroid.ui.extension.view.updateMargins
|
||||
import com.highcapable.hikage.extension.setContentView
|
||||
import com.highcapable.hikage.widget.android.widget.Button
|
||||
import com.highcapable.hikage.widget.android.widget.EditText
|
||||
import com.highcapable.hikage.widget.android.widget.LinearLayout
|
||||
import com.highcapable.hikage.widget.android.widget.TextView
|
||||
import com.highcapable.hikage.widget.androidx.core.widget.NestedScrollView
|
||||
import com.highcapable.yukihookapi.YukiHookAPI
|
||||
import com.highcapable.yukihookapi.demo_module.R
|
||||
import com.highcapable.yukihookapi.demo_module.data.DataConst
|
||||
import com.highcapable.yukihookapi.demo_module.databinding.ActivityMainBinding
|
||||
import com.highcapable.yukihookapi.hook.factory.dataChannel
|
||||
import com.highcapable.yukihookapi.hook.factory.prefs
|
||||
import com.highcapable.yukihookapi.hook.xposed.parasitic.activity.base.ModuleAppCompatActivity
|
||||
@@ -42,48 +55,140 @@ class MainActivity : ModuleAppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ActivityMainBinding.inflate(layoutInflater).apply {
|
||||
setContentView(root)
|
||||
moduleEnvironment {
|
||||
dataChannel(packageName = "com.highcapable.yukihookapi.demo_app").with {
|
||||
wait(DataConst.TEST_CN_DATA) {
|
||||
Toast.makeText(applicationContext, it, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
moduleEnvironment {
|
||||
dataChannel(packageName = "com.highcapable.yukihookapi.demo_app").with {
|
||||
wait(DataConst.TEST_CN_DATA) {
|
||||
Toast.makeText(applicationContext, it, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
moduleDemoActiveText.text = "Module is Active: ${YukiHookAPI.Status.isModuleActive}"
|
||||
moduleDemoActiveZhText.text = "Xposed 模块激活状态"
|
||||
moduleDemoFrameworkText.text = "Hook Framework: ${YukiHookAPI.Status.Executor.name}"
|
||||
moduleDemoFrameworkZhText.text = "当前的 Hook 框架"
|
||||
moduleDemoApiVersionText.text = "Xposed API Version: ${YukiHookAPI.Status.Executor.apiLevel}"
|
||||
moduleDemoApiVersionZhText.text = "Xposed API 版本"
|
||||
moduleDemoYukiHookApiVersionText.text = "${YukiHookAPI.TAG} Version: ${YukiHookAPI.VERSION}"
|
||||
moduleDemoYukiHookApiVersionZhText.text = "${YukiHookAPI.TAG} 版本"
|
||||
moduleDemoNewXshareText.text =
|
||||
"${if (YukiHookAPI.Status.isXposedEnvironment) "XSharedPreferences Readable" else "New XSharedPreferences"}: ${prefs().isPreferencesAvailable}"
|
||||
moduleDemoNewXshareZhText.text =
|
||||
if (YukiHookAPI.Status.isXposedEnvironment) "XSharedPreferences 是否可用" else "New XSharedPreferences 支持状态"
|
||||
moduleDemoResHookText.text = "Support Resources Hook: ${YukiHookAPI.Status.isSupportResourcesHook}"
|
||||
moduleDemoResHookZhText.text = "资源钩子支持状态"
|
||||
moduleDemoComTimeStampText.text =
|
||||
"Compiled Time:${SimpleDateFormat.getDateTimeInstance().format(Date(YukiHookAPI.Status.compiledTimestamp))}"
|
||||
moduleDemoEditText.also {
|
||||
hostEnvironment {
|
||||
it.isEnabled = false
|
||||
moduleDemoButton.isEnabled = false
|
||||
}
|
||||
it.setText(prefs().get(DataConst.TEST_KV_DATA))
|
||||
moduleDemoButton.setOnClickListener { _ ->
|
||||
moduleEnvironment {
|
||||
if (it.text.toString().isNotEmpty()) {
|
||||
prefs().edit { put(DataConst.TEST_KV_DATA, it.text.toString()) }
|
||||
Toast.makeText(applicationContext, "Saved", Toast.LENGTH_SHORT).show()
|
||||
} else Toast.makeText(applicationContext, "Please enter the text", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
moduleDemoFrgButton.setOnClickListener { startActivity(Intent(this@MainActivity, PreferenceActivity::class.java)) }
|
||||
}
|
||||
val hikage = setContentView {
|
||||
NestedScrollView(
|
||||
lparams = LayoutParams(matchParent = true),
|
||||
init = {
|
||||
isFillViewport = true
|
||||
isVerticalScrollBarEnabled = false
|
||||
}
|
||||
) {
|
||||
LinearLayout(
|
||||
lparams = LayoutParams(widthMatchParent = true) {
|
||||
updateMargins(vertical = 20.dp)
|
||||
},
|
||||
init = {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
gravity = Gravity.CENTER
|
||||
}
|
||||
) {
|
||||
lateinit var editText: TextView
|
||||
LinearLayout(
|
||||
lparams = LayoutParams(widthMatchParent = true) {
|
||||
updateMargins(horizontal = 50.dp)
|
||||
updateMargins(bottom = 15.dp)
|
||||
},
|
||||
init = {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
gravity = Gravity.CENTER or Gravity.START
|
||||
}
|
||||
) {
|
||||
repeat(6) { index ->
|
||||
TextView(
|
||||
id = "sample_title_text_$index",
|
||||
lparams = LayoutParams {
|
||||
bottomMargin = 5.dp
|
||||
}
|
||||
) {
|
||||
textSize = 18f
|
||||
isSingleLine = true
|
||||
ellipsize = TextUtils.TruncateAt.END
|
||||
gravity = Gravity.CENTER or Gravity.START
|
||||
}
|
||||
TextView(
|
||||
id = "sample_subtitle_text_$index",
|
||||
lparams = LayoutParams {
|
||||
bottomMargin = if (index < 5) 15.dp else 25.dp
|
||||
}
|
||||
) {
|
||||
alpha = 0.85f
|
||||
textSize = 15f
|
||||
isSingleLine = true
|
||||
ellipsize = TextUtils.TruncateAt.END
|
||||
gravity = Gravity.CENTER or Gravity.START
|
||||
}
|
||||
}
|
||||
TextView(
|
||||
lparams = LayoutParams {
|
||||
leftMargin = 5.dp
|
||||
bottomMargin = 25.dp
|
||||
}
|
||||
) {
|
||||
textSize = 15f
|
||||
isSingleLine = true
|
||||
ellipsize = TextUtils.TruncateAt.END
|
||||
gravity = Gravity.CENTER or Gravity.START
|
||||
text = "Leave something in there"
|
||||
}
|
||||
editText = EditText(
|
||||
lparams = LayoutParams(width = 250.dp)
|
||||
) {
|
||||
hint = "Please enter the text"
|
||||
isSingleLine = true
|
||||
textSize = 18f
|
||||
hostEnvironment { isEnabled = false }
|
||||
setText(prefs().get(DataConst.TEST_KV_DATA))
|
||||
}
|
||||
}
|
||||
Button(
|
||||
id = "button",
|
||||
lparams = LayoutParams {
|
||||
bottomMargin = 15.dp
|
||||
}
|
||||
) {
|
||||
text = "Save Test Data"
|
||||
hostEnvironment { isEnabled = false }
|
||||
setOnClickListener { _ ->
|
||||
moduleEnvironment {
|
||||
if (editText.textToString().isNotEmpty()) {
|
||||
prefs().edit { put(DataConst.TEST_KV_DATA, editText.textToString()) }
|
||||
toast("Saved")
|
||||
} else toast("Please enter the text")
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
text = "Open PreferenceFragment"
|
||||
setOnClickListener { startActivity<PreferenceActivity>() }
|
||||
}
|
||||
TextView(
|
||||
lparams = LayoutParams {
|
||||
topMargin = 25.dp
|
||||
}
|
||||
) {
|
||||
alpha = 0.45f
|
||||
textSize = 13f
|
||||
isSingleLine = true
|
||||
ellipsize = TextUtils.TruncateAt.END
|
||||
gravity = Gravity.CENTER or Gravity.START
|
||||
text = "Compiled Time:${SimpleDateFormat.getDateTimeInstance().format(Date(YukiHookAPI.Status.compiledTimestamp))}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
hikage.get<TextView>("sample_title_text_0").text = "Module is Active: ${YukiHookAPI.Status.isModuleActive}"
|
||||
hikage.get<TextView>("sample_subtitle_text_0").text = "Xposed 模块激活状态"
|
||||
hikage.get<TextView>("sample_title_text_1").text = "Hook Framework: ${YukiHookAPI.Status.Executor.name}"
|
||||
hikage.get<TextView>("sample_subtitle_text_1").text = "当前的 Hook 框架"
|
||||
hikage.get<TextView>("sample_title_text_2").text = "Xposed API Version: ${YukiHookAPI.Status.Executor.apiLevel}"
|
||||
hikage.get<TextView>("sample_subtitle_text_2").text = "Xposed API 版本"
|
||||
hikage.get<TextView>("sample_title_text_3").text = "${YukiHookAPI.TAG} Version: ${YukiHookAPI.VERSION}"
|
||||
hikage.get<TextView>("sample_subtitle_text_3").text = "${YukiHookAPI.TAG} 版本"
|
||||
hikage.get<TextView>("sample_title_text_4").text = "${if (YukiHookAPI.Status.isXposedEnvironment)
|
||||
"XSharedPreferences Readable"
|
||||
else "New XSharedPreferences"}: ${prefs().isPreferencesAvailable}"
|
||||
hikage.get<TextView>("sample_subtitle_text_4").text = if (YukiHookAPI.Status.isXposedEnvironment)
|
||||
"XSharedPreferences 是否可用"
|
||||
else "New XSharedPreferences 支持状态"
|
||||
hikage.get<TextView>("sample_title_text_5").text = "Support Resources Hook: ${YukiHookAPI.Status.isSupportResourcesHook}"
|
||||
hikage.get<TextView>("sample_subtitle_text_5").text = "资源钩子支持状态"
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,213 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
tools:ignore="HardcodedText">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginRight="50dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:gravity="center|start"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_active_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_active_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_framework_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_framework_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_api_version_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_api_version_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_yuki_hook_api_version_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_yuki_hook_api_version_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_new_xshare_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_new_xshare_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_res_hook_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_res_hook_zh_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:alpha="0.85"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="sample"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="Leave something in there"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/module_demo_edit_text"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Please enter the text"
|
||||
android:singleLine="true"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="Autofill,LabelFor,TextFields" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_demo_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="Save Test Data"
|
||||
android:textAllCaps="false" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/module_demo_frg_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Open PreferenceFragment"
|
||||
android:textAllCaps="false" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_demo_com_time_stamp_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:alpha="0.45"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center|start"
|
||||
android:singleLine="true"
|
||||
android:text="placeholder"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
Reference in New Issue
Block a user