Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夜猫逐梦
MyOpen
提交
6df111db
M
MyOpen
项目概览
夜猫逐梦
/
MyOpen
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MyOpen
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6df111db
编写于
11月 07, 2020
作者:
K
khz_pc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试程序修改
上级
275c29b6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
90 addition
and
5 deletion
+90
-5
course/frida/MyFridaExample/app/src/main/java/com/ninecents/MainActivity.java
...Example/app/src/main/java/com/ninecents/MainActivity.java
+63
-1
course/frida/MyFridaExample/app/src/main/res/layout/activity_main.xml
.../MyFridaExample/app/src/main/res/layout/activity_main.xml
+27
-4
未找到文件。
course/frida/MyFridaExample/app/src/main/java/com/ninecents/MainActivity.java
浏览文件 @
6df111db
...
@@ -2,13 +2,75 @@ package com.ninecents;
...
@@ -2,13 +2,75 @@ package com.ninecents;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Toast
;
public
class
MainActivity
extends
AppCompatActivity
{
public
class
MainActivity
extends
AppCompatActivity
implements
View
.
OnClickListener
{
Button
button_member_method
;
Button
button_static_method
;
Button
button_overload_method
;
static
MainActivity
_this
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
setContentView
(
R
.
layout
.
activity_main
);
// 绑定事件
button_member_method
=
(
Button
)
findViewById
(
R
.
id
.
button_member_method
);
button_member_method
.
setOnClickListener
(
this
);
button_static_method
=
(
Button
)
findViewById
(
R
.
id
.
button_static_method
);
button_static_method
.
setOnClickListener
(
this
);
button_overload_method
=
(
Button
)
findViewById
(
R
.
id
.
button_overload_method
);
button_overload_method
.
setOnClickListener
(
this
);
_this
=
this
;
}
private
int
_member_method
(
String
text
)
{
Toast
.
makeText
(
getApplicationContext
(),
text
,
Toast
.
LENGTH_SHORT
).
show
();
// 返回值为0:展示红色,否则展示蓝色
return
0
;
}
private
static
void
_static_method
()
{
Toast
.
makeText
(
MainActivity
.
_this
,
"button_static_method"
,
Toast
.
LENGTH_SHORT
).
show
();
}
private
void
_overload_method
(
String
text
)
{
Toast
.
makeText
(
getApplicationContext
(),
text
,
Toast
.
LENGTH_SHORT
).
show
();
}
private
void
_overload_method
(
int
val
)
{
String
text
;
if
(
val
==
1
)
{
text
=
"111111111"
;
}
else
{
text
=
"222222222"
;
}
Toast
.
makeText
(
getApplicationContext
(),
text
,
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
button_member_method
:
int
ret
=
_member_method
(
"这是button_member_method"
);
if
(
ret
==
0
)
{
button_member_method
.
setBackgroundColor
(
Color
.
parseColor
(
"#FF0000"
));
}
else
{
button_member_method
.
setBackgroundColor
(
Color
.
parseColor
(
"#0000FF"
));
}
break
;
case
R
.
id
.
button_static_method
:
MainActivity
.
_static_method
();
break
;
case
R
.
id
.
button_overload_method
:
_overload_method
(
1
);
break
;
}
}
}
}
}
\ No newline at end of file
course/frida/MyFridaExample/app/src/main/res/layout/activity_main.xml
浏览文件 @
6df111db
...
@@ -7,12 +7,35 @@
...
@@ -7,12 +7,35 @@
tools:context=
".MainActivity"
>
tools:context=
".MainActivity"
>
<TextView
<TextView
android:id=
"@+id/hello"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"96px"
android:text=
"Hello World!"
android:text=
"Hello Frida!"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<Button
android:id=
"@+id/button_member_method"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"成员函数"
app:layout_constraintTop_toBottomOf=
"@+id/hello"
app:layout_constraintLeft_toLeftOf=
"parent"
/>
<Button
android:id=
"@+id/button_static_method"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"静态函数"
app:layout_constraintTop_toBottomOf=
"@+id/button_member_method"
app:layout_constraintLeft_toLeftOf=
"parent"
/>
<Button
android:id=
"@+id/button_overload_method"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"重载函数"
app:layout_constraintTop_toBottomOf=
"@+id/button_static_method"
app:layout_constraintLeft_toLeftOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录