当前位置:   article > 正文

怎样修改安卓源码5.1默认语言及语言包屏蔽方法总结_b/17190407 isindevelopermode

b/17190407 isindevelopermode

1. 修改开机默认语言:

(1).进入build/target/product目录,修改文件core.mk的PRODUCT_PROPERTY_OVERRIDES 值,例如,欲修改为默认中文,则增加

“\persist.sys.language=zh \ persist.sys.country=CN”

增加后的语句如PRODUCT_PROPERTY_OVERRIDES:= \

ro.config.notification_sound=OnTheHunt.ogg\

ro.config.alarm_alert=Alarm_Classic.ogg\ persist.sys.language=zh \ persist.sys.country=CN.

 

2. 屏蔽语言包:

进入frameworks\base\core\java\com\android\internal\app\LocalePicker.java

 

public staticList<LocaleInfo> getAllAssetLocales(Context context, booleanisInDeveloperMode) {

   final Resources resources =context.getResources();

 

  finalString[] locales = Resources.getSystem().getAssets().getLocales();

        List<String> localeList = newArrayList<String>(locales.length);

        Collections.addAll(localeList,locales);

 

        // Don't show the pseudolocales unlesswe're in developer mode. http://b/17190407.

        if (!isInDeveloperMode) {

            localeList.remove("ar-XB");

           localeList.remove("en-XA");

        }

 

        Collections.sort(localeList);

  final String[] specialLocaleCodes =resources.getStringArray(R.array.special_locale_codes);

  finalString[] specialLocaleNames = resources.getStringArray(R.array.special_locale_names);

 

找到这段函数很明显

  final String[] locales =Resources.getSystem().getAssets().getLocales();

  List<String> localeList= new ArrayList<String>(locales.length);

这段函数是调用语言包;

在下面一句函数下面屏蔽比如我们屏蔽英文

  Collections.addAll(localeList, locales);

  localeList.remove("en-US");

好了成功屏蔽掉英文了  重新make镜像烧写进去就没有英文语言选项了。希望可以帮到大家!

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/255619
推荐阅读
相关标签
  

闽ICP备14008679号