Meituan-Dianping / Meituan-Dianping/Robust

插件中使用Robust后无法使用context.getString获取到字符串

Open
#286 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.5k
Forks
806
PR merge metrics
No merged PRs in 30d

Description

在提交issue之前,我们应该先查询是否已经有相关的issue和ReadMe中的注意事项,比如说Robust在0.3.3版本才支持windows开发。提交issue时,我们需要写明issue的原因,最好可以携带编译或运行过程的日志或者截图。issue最好以下面的格式提出:

异常类型:app运行时异常

手机型号:如:华为P20 (其他手机也都出现了 应该跟机型无关)

手机系统版本:如:Android 8.1

Robust版本:如:0.4.82

Gradle版本:如:2.2.2

系统:如:ubuntu

我们是把Robust使用在插件中的,不是真正独立的apk,使用后,能正常编译出patch文件,也能加载patch,并且也能修复相关代码,出现了负面影响
表现是mContext.getString(R.string.launch_privilege_receive_fail_content)通过这种方式获取的字符串为null 加载patch之前正常
打印了mContext的信息如下截图

patch
patch

从日志看mContext的信息都一致,为啥加载patch后获取不到string了?
求大佬帮忙看看~

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Robust's plugin patch-loading and Android resource/context handling; the issue provides no source files, tests, or entry points. Reproduce the reported behavior using the supplied screenshots and logs, then determine why mContext.getString returns null after patch loading and verify the behavior before and after the fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.