如何在 Android Studio 的项目中找到所有硬编码字符串 [英] How can I find all hard coded strings in my project in Android Studio

查看:41
本文介绍了如何在 Android Studio 的项目中找到所有硬编码字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 Android Studio(测试版)0.84 中查找并提取我项目中的所有硬编码字符串.我需要一个像 Find Bugs 这样的静态分析工具,一次性为我完成这项工作,并允许我单步执行每条消息并将字符串提取到资源文件中.如果整个过程是自动化的,那就更好了.

I need to find and extract all hard coded strings in my project in Android Studio (beta) 0.84. I need a static analysis tool like Find Bugs do this for me in one shot and allow me to step through each message and extract the string to resource files. Even better would be if the entire process is automated.

在 Android Studio(测试版)0.84 中,文件/设置/FindBugs-IDEA 将 I18N 显示为报告选项卡下的一个选项.但我就是不知道如何让它发挥作用.

In Android Studio (beta) 0.84 the File / Setting /FindBugs-IDEA shows I18N as an option under Reporting tab. But I just cannot figure out how to make it work.

感谢您的任何建议.

推荐答案

As @Maor Hadad 和其他赞成票建议我:我将我的评论转换为答案,所以:

As @Maor Hadad and other upvotes suggested me : I convert my comment in an answer, so :

从 Android Studio 1.2.2 开始,在

Since Android Studio 1.2.2, there is a new option in

分析>按名称运行检查"=>硬编码字符串".

我使用了它,它在当前版本中似乎比硬编码文本"(仅检查 xml 文件)更可靠.

I used it and it seems quite more reliable with current version than "hardcoded text" (that checks only xml files).

见这里链接

这篇关于如何在 Android Studio 的项目中找到所有硬编码字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆