{"id":18593787,"url":"https://github.com/git-xuhao/switchlanguage","last_synced_at":"2025-04-10T16:30:50.660Z","repository":{"id":205310963,"uuid":"53031897","full_name":"git-xuhao/SwitchLanguage","owner":"git-xuhao","description":"利用反射切换系统语言,调用hide的方法。","archived":false,"fork":false,"pushed_at":"2016-06-16T03:05:13.000Z","size":4408,"stargazers_count":11,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T00:41:44.629Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/git-xuhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-03-03T07:56:28.000Z","updated_at":"2024-11-27T18:55:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"355903c6-adca-468c-90f6-72b4d7809edd","html_url":"https://github.com/git-xuhao/SwitchLanguage","commit_stats":null,"previous_names":["git-xuhao/switchlanguage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-xuhao%2FSwitchLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-xuhao%2FSwitchLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-xuhao%2FSwitchLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-xuhao%2FSwitchLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git-xuhao","download_url":"https://codeload.github.com/git-xuhao/SwitchLanguage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252690,"owners_count":21072700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T01:13:33.650Z","updated_at":"2025-04-10T16:30:47.758Z","avatar_url":"https://github.com/git-xuhao.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwitchLanguage\n    关于我，欢迎关注~\n [我的博客](http://blog.csdn.net/u011974987) 本Demo地址:[click here](http://blog.csdn.net/u011974987/article/details/50801770);\n* 项目描述：\n    本Demo主要运用于切换系统语言的功能，一般会在做出厂设置的App 会有这需求，但是Google并没有开放更改系统语言的接口，查看‘FrameWork’ 层'Settings' 源码下，有相关的功能，属于隐藏接口，所以我们利用反射机制来调用系统的API，虽然不是很靠谱，但是满足了我们的需求，我把项目整理的下，放在[GitHub](https://github.com/git-xuhao/SwitchLanguage) 上面了。\n\n* 本Demo效果截图示例如下：\n\n ![](https://github.com/git-xuhao/SwitchLanguage/raw/master/SwitchLanguage/screenshot/language.gif)  \n\n更新日志：\n---------\n  * v1.0:\n    初始化该项目\n    添加了icon。\n###NOTICE!!!\n----------\n   * 需要注意的是调用此方法：\n// objIActMag.updateConfiguration(config);\nmtdIActMag$updateConfiguration.invoke(objIActMag, config);\n\n    *需要加上权限：android.permission.CHANGE_CONFIGURATION\n并且此处会重新调用onCreate方法，我就在这个地方处被坑了一把。（如果调用此方法的时候做了一些逻辑，就注意下）。\n\n最后声明：\n----------------\n既然是更改系统的配置当然你的签名也应该是系统签名和sharedUserId。不然会类似以下的错误！\n\nerror：\n------\njava.lang.SecurityException: Permission Denial: updateConfiguration() from pid=31594, uid=10099 requires android.permission.CHANGE_CONFIGURATION\n\n各位都注意下吧~\n\n##Thanks!\n\n*[SwitchLanguage](https://github.com/git-xuhao/SwitchLanguage)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-xuhao%2Fswitchlanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-xuhao%2Fswitchlanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-xuhao%2Fswitchlanguage/lists"}