Hook APP 记录(一)

Hook APP 记录(一)

前提了解刷机(线刷、卡刷),第三方Rom包,了解Hook的大致意思,了解Xposed、Magisk面具、墙

我也是刚入手hook这方面,作为学习记录,这方面资料少和大家一起共享学习。



前言

准备工作:
1、测试机:我的测试机是红米note5,已是开发版
2、EdXposed安装:是app
3、Magisk Manager安装:是app

大致hook效果功能
在这里插入图片描述


一、编写一个简单的目标app

TargetApplication

1、xml界面布局

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">


    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />


    <TextView
        android:id="@+id/show_tv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="this is msg"
        app:layout_constraintTop_toBottomOf="@+id/button"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        />

</androidx.constraintlayout.widget.ConstraintLayout>

2、MainActivity

class MainActivity : AppCompatActivity(), View.OnClickListener {

    var btn: Button? = null

    var tv: TextView? = null

    private var msg = "null"

    override fun onCreate(savedInstanceState: Bundle?) {

        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_main)

        btn = findViewById<Button>(R.id.button)
        tv = findViewById<TextView>(R.id.show_tv)

        btn?.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        Toast.makeText(this@MainActivity, "123", Toast.LENGTH_LONG).show()
    }

}

二、编写Xposed模块,用来hook目标APP

TestXposed APP

1.引入依赖

引入接口包


                
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值