FART:ART环境下基于主动调用的自动化脱壳方案

5379 public static void main(String[] args) {

5380 Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, “ActivityThreadMain”);

5381 SamplingProfilerIntegration.start();

5382

5383 // CloseGuard defaults to true and can be quite spammy. We

5384 // disable it here, but selectively enable it later (via

5385 // StrictMode) on debug builds, but using DropBox, not logs.

5386 CloseGuard.setEnabled(false);

5387

5388 Environment.initForCurrentUser();

5389

5390 // Set the reporter for event logging in libcore

5391 EventLogger.setReporter(new EventLoggingReporter());

5392

5393 AndroidKeyStoreProvider.install();

5394

5395 // Make sure TrustedCertificateStore looks in the right place for CA certificates

5396 final File configDir = Environment.getUserConfigDirectory(UserHandle.myUserId());

5397 TrustedCertificateStore.setDefaultUserDirectory(configDir);

5398

5399 Process.setArgV0("");

5400

5401 Looper.prepareMainLooper();

5402

5403 ActivityThread thread = new ActivityThread();

5404 thread.attach(false);

5405

5406 if (sMainThreadHandler == null) {

5407 sMainThreadHandler = thread.getHandler();

5408 }

5409

5410 if (false) {

5411 Looper.myLooper().setMessageLogging(new

5412 LogPrinter(Log.DEBUG, “ActivityThread”));

5413 }

5414

5415 // End of event ActivityThreadMain.

5416 Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);

5417 Looper.loop();

5418

5419 throw new RuntimeException(“Main thread loop unexpectedly exited”);

5420 }

5421}

对于ActivityThread这个类,其中的sCurrentActivityThread静态变量用于全局保存创建的ActivityThread实例,同时还提供了public static ActivityThread currentActivityThread()静态函数用于获取当前虚拟机创建的ActivityThread实例。ActivityThread.main()函数是java中的入口main函数,这里会启动主消息循环,并创建ActivityThread实例,之后调用thread.attach(false)完成一系列初始化准备工作,并完成全局静态变量sCurrentActivityThread的初始化。之后主线程进入消息循环,等待接收来自系统的消息。当收到系统发送来的bindapplication的进程间调用时,调用函数handlebindapplication来处理该请求

private void handleBindApplication(AppBindData

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值