Android_repo和编译_烧录

git

参考文章:Git三大特色之Stage

三个区

Git本地数据管理,大概可以分为三个区,工作区、暂存区、版本库。

  1. 工作区(Working Directory)是我们直接编辑的地方,例如 Android Studio 打开的项目,记事本打开的文本等,肉眼可见,直接操作。
  2. 暂存区(Stage 或 Index)是数据暂时存放的区域,可在工作区和版本库之间进行数据的友好交流。
  3. 版本库(commit History)存放已经提交的数据,push 的时候,就是把这个区的数据 push 到远程仓库了。

Stage(暂存区)赋予Git更多灵活性

  • 修改了4个文件,在不放弃任何修改的情况下,其中一个文件不想提交,如何操作?(没add: git add;已经add: git reset --soft
  • 修改到一半的文件,突然间不需要或者放弃修改了,怎么恢复未修改前文件? (git checkout)
  • 代码写一半,被打断去做其他功能开发,未完成代码保存?(git stash)
  • 代码写一半,发现忘记切换分支了?(git stash & git checkout)
  • 代码需要回滚了?(git reset

上面提到的 checkout & stash & reset 等命令,通过不同的参数搭配使用,可以在工作区,暂存区和版本库之间,轻松进行数据的来回切换。

stash的使用场景

此时我在feature_666分支,非常聚精会神加持高专注地实现一个功能666模块,简直键盘如飞的编写代码。然后这时,客户反馈出一个bug,非常严重,必须立马解决,优先级为0!于是,我需要去到release分支去checkout新的分支去工作了,但是666功能还没完成怎么办?

此时面临着一个选择题:

A:提交后切换,代码保存到分支feature_666,却产生一个无意义的提交。

B:不提交直接切换,然而这个选项根本没人会选。

是不是很难选,此时,别忘记还有C选项!

C:使用git stash,将当前修改(未提交的代码)存入缓存区,切换分支修改bug,回来再通过git stash pop取出来。

repo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
usage: repo COMMAND [ARGS]
The most commonly used repo commands are:
abandon Permanently abandon a development branch
branch View current topic branches
branches View current topic branches
checkout Checkout a branch for development
cherry-pick Cherry-pick a change.
diff Show changes between commit and working tree
diffmanifests Manifest diff utility
download Download and checkout a change
gitc-delete Delete a GITC Client.
gitc-init Initialize a GITC Client.
grep Print lines matching a pattern
info Get info on the manifest branch, current branch or unmerged branches
init Initialize a repo client checkout in the current directory
list List projects and their associated directories
overview Display overview of unmerged project branches
prune Prune (delete) already merged topics
rebase Rebase local branches on upstream branch
smartsync Update working tree to the latest known good revision
stage Stage file(s) for commit
start Start a new branch for development
status Show the working tree status
sync Update working tree to the latest revision
upload Upload changes for code review
See 'repo help <command>' for more information on a specific command.
See 'repo help --all' for a complete list of recognized commands.

repo init

repo init -u git@gitlab.gz.cvte.cn:tc02_mtk_android10_0/manifest.git -m mtk8788_s..wo_tc02a_sys828.xml -b develop_dt15

repo init:Initialize a repo client checkout in the current directory,选项:(可通过repo help init查看)

选项 含义
-u URL, --manifest-url=URL manifest repository location
-m NAME.xml, --manifest-name=NAME.xml initial manifest file
-b REVISION, --manifest-branch=REVISION manifest branch or revision (use HEAD for default)

repo sync

repo sync:Update working tree to the latest revision。可带-j10指定并行数量。

描述

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Update working tree to the latest revision

Usage: repo sync [<project>...]

Options:
-h, --help show this help message and exit
-j JOBS, --jobs=JOBS number of jobs to run in parallel (default: 1; based
on number of CPU cores)
--jobs-network=JOBS number of network jobs to run in parallel (defaults to
--jobs)
--jobs-checkout=JOBS number of local checkout jobs to run in parallel
(defaults to --jobs)
-f, --force-broken obsolete option (to be deleted in the future)
--fail-fast stop syncing after first error is hit
--force-sync overwrite an existing git directory if it needs to
point to a different object directory. WARNING: this
may cause loss of data
--force-remove-dirty force remove projects with uncommitted modifications
if projects no longer exist in the manifest. WARNING:
this may cause loss of data
-l, --local-only only update working tree, don't fetch
--no-manifest-update, --nmu
use the existing manifest checkout as-is. (do not
update to the latest revision)
-n, --network-only fetch only, don't update working tree
-d, --detach detach projects back to manifest revision
-c, --current-branch fetch only current branch from server
--no-current-branch fetch all branches from server
-m NAME.xml, --manifest-name=NAME.xml
temporary manifest to use for this sync
--clone-bundle enable use of /clone.bundle on HTTP/HTTPS
--no-clone-bundle disable use of /clone.bundle on HTTP/HTTPS
-u MANIFEST_SERVER_USERNAME, --manifest-server-username=MANIFEST_SERVER_USERNAME
username to authenticate with the manifest server
-p MANIFEST_SERVER_PASSWORD, --manifest-server-password=MANIFEST_SERVER_PASSWORD
password to authenticate with the manifest server
--fetch-submodules fetch submodules from server
--use-superproject use the manifest superproject to sync projects;
implies -c
--no-use-superproject
disable use of manifest superprojects
--tags fetch tags
--no-tags don't fetch tags (default)
--optimized-fetch only fetch projects fixed to sha1 if revision does not
exist locally
--retry-fetches=RETRY_FETCHES
number of times to retry fetches on transient errors
--prune delete refs that no longer exist on the remote
(default)
--no-prune do not delete refs that no longer exist on the remote
-s, --smart-sync smart sync using manifest from the latest known good
build
-t SMART_TAG, --smart-tag=SMART_TAG
smart sync using manifest from a known tag

Logging options:
-v, --verbose show all output
-q, --quiet only show errors

Multi-manifest options:
--outer-manifest operate starting at the outermost manifest
--no-outer-manifest
do not operate on outer manifests
--this-manifest-only
only operate on this (sub)manifest
--no-this-manifest-only, --all-manifests
operate on this manifest and its submanifests

repo Version options:
--no-repo-verify do not verify repo source code

Description

The 'repo sync' command synchronizes local project directories with the remote
repositories specified in the manifest. If a local project does not yet exist,
it will clone a new local directory from the remote repository and set up
tracking branches as specified in the manifest. If the local project already
exists, 'repo sync' will update the remote branches and rebase any new local
changes on top of the new remote changes.

'repo sync' will synchronize all projects listed at the command line. Projects
can be specified either by name, or by a relative or absolute path to the
project's local directory. If no projects are specified, 'repo sync' will
synchronize all projects listed in the manifest.

The -d/--detach option can be used to switch specified projects back to the manifest revision. This option is especially helpful if the project is currently on a topic branch, but the manifest revision is temporarily needed.

The -s/--smart-sync option can be used to sync to a known good build as
specified by the manifest-server element in the current manifest. The
-t/--smart-tag option is similar and allows you to specify a custom tag/label.

The -u/--manifest-server-username and -p/--manifest-server-password options can
be used to specify a username and password to authenticate with the manifest
server when using the -s or -t option.

If -u and -p are not specified when using the -s or -t option, 'repo sync' will
attempt to read authentication credentials for the manifest server from the
user's .netrc file.

'repo sync' will not use authentication credentials from -u/-p or .netrc if the
manifest server specified in the manifest file already includes credentials.

By default, all projects will be synced. The --fail-fast option can be used to
halt syncing as soon as possible when the first project fails to sync.

The --force-sync option can be used to overwrite existing git directories if
they have previously been linked to a different object directory. WARNING: This
may cause data to be lost since refs may be removed when overwriting.

The --force-remove-dirty option can be used to remove previously used projects
with uncommitted changes. WARNING: This may cause data to be lost since
uncommitted changes may be removed with projects that no longer exist in the
manifest.

The --no-clone-bundle option disables any attempt to use $URL/clone.bundle to
bootstrap a new Git repository from a resumeable bundle file on a content
delivery network. This may be necessary if there are problems with the local
Python HTTP client or proxy configuration, but the Git binary works.

The --fetch-submodules option enables fetching Git submodules of a project from
server.

The -c/--current-branch option can be used to only fetch objects that are on the
branch specified by a project's revision.

The --optimized-fetch option can be used to only fetch projects that are fixed
to a sha1 revision if the sha1 revision does not already exist locally.

The --prune option can be used to remove any refs that no longer exist on the
remote.

SSH Connections

If at least one project remote URL uses an SSH connection (ssh://, git+ssh://,
or user@host:path syntax) repo will automatically enable the SSH ControlMaster
option when connecting to that host. This feature permits other projects in the
same 'repo sync' session to reuse the same SSH tunnel, saving connection setup
overheads.

To disable this behavior on UNIX platforms, set the GIT_SSH environment variable
to 'ssh'. For example:

export GIT_SSH=ssh
repo sync

Compatibility

This feature is automatically disabled on Windows, due to the lack of UNIX
domain socket support.

This feature is not compatible with url.insteadof rewrites in the user's
~/.gitconfig. 'repo sync' is currently not able to perform the rewrite early
enough to establish the ControlMaster tunnel.

If the remote SSH daemon is Gerrit Code Review, version 2.0.10 or later is
required to fix a server side protocol bug.

-d, --detach

参考文章:https://segmentfault.com/a/1190000021005727

使用repo sync命令来同步远端服务器的Android代码,如果本地修改了代码但还没有commit,会提示无法sync:error: android/frameworks/base/: contains uncommitted changes。此时,可以使用git reset命令丢弃本地修改(如果没有git add到暂存区,其实git checkout也可以),然后再执行repo sync来同步代码。如果想要不丢失本地修改,强制同步远端服务器代码,可以加上-d选项,repo sync -d命令会将HEAD强制指向repo manifest版本,而忽略本地的改动。

注意:加上-d选项只表示忽略本地改动,可以强制同步远端服务器的代码,但是本地修改的文件还是保持改动不变,不会强制覆盖掉本地修改。而且同步之后,本地的分支指向会发生变化,不再指向原来的分支。具体举例如下。

  1. 执行repo sync -d之前的分支信息:

    1
    2
    $ git branch
    * curent_branch_xxx
  2. 执行repo sync -d之后的分支信息:

    1
    2
    3
    $ git branch
    * (detached from 715faf5)
    curent_branch_xxx

    即,从远端服务器同步的代码,是同步到跟踪远端服务器的分支,还没有从git仓库把代码checkout到本地,而当前本地修改的代码处在未命名分支下,是不同的分支,互不干扰,才能在不丢弃本地修改的情况下,强制同步远端服务器代码。

  3. 执行git status命令,可以看到本地还是有修改过且还没有 commit 的文件,同步远端服务器代码后,并不会强制覆盖本地文件的修改:

    1
    2
    3
    4
    5
    6
    7
    $ git status
    HEAD detached at 715faf5
    Changes not staged for commit:
    (use "git add <file>..." to update what will be committed)
    (use "git checkout -- <file>..." to discard changes in working directory)
    modified: vendor/chioverride/default/g_pipelines.h
    modified: vendor/topology/g_usecase.xml

即,如果想要丢弃本地修改、让本地代码跟同步后的 git 仓库代码一致,repo sync -d命令达不到这个效果。

另外,repo sync有一个--force-sync选项,具体说明如下:

–force-sync
overwrite an existing git directory if it needs to point to a different object directory. WARNING: this may cause loss of data

从说明来看,像是可以强制同步,且可能丢失本地改动。但是实际测试发现,这个选项并不能强制覆盖本地的改动。如果本地文件发生改动,加上这个选项也是会 sync 报错:

1
2
3
$ repo sync --force-sync .
Fetching project tools/
error: tools/: contains uncommitted changes

如果想要覆盖本地修改的代码,则需要继续:

1
2
3
4
5
6
7
8
# 将HEAD强制指向manifest库,忽略本地的改动
repo sync -d
# Remove all working directory (and staged) changes
repo forall -c 'git reset --hard'
# Clean untracked files
repo forall -c 'git clean -f -d'
# 拉代码
repo sync -c # fetch only current branch from server

forall的作用:Run a shell command in each project

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Usage: repo forall [<project>...] -c <command> [<arg>...]
repo forall -r str1 [str2] ... -c <command> [<arg>...]

Options:
-h, --help show this help message and exit
-j JOBS, --jobs=JOBS number of jobs to run in parallel (default: 8; based
on number of CPU cores)
-r, --regex execute the command only on projects matching regex or
wildcard expression
-i, --inverse-regex execute the command only on projects not matching
regex or wildcard expression
-g GROUPS, --groups=GROUPS
execute the command only on projects matching the
specified groups
-c, --command command (and arguments) to execute
-e, --abort-on-errors
abort if a command exits unsuccessfully
--ignore-missing silently skip & do not exit non-zero due missing
checkouts
--interactive force interactive usage

Logging options:
-v, --verbose show all output
-q, --quiet only show errors
-p show project headers before output

Multi-manifest options:
--outer-manifest operate starting at the outermost manifest
--no-outer-manifest
do not operate on outer manifests
--this-manifest-only
only operate on this (sub)manifest
--no-this-manifest-only, --all-manifests
operate on this manifest and its submanifests

Run `repo help forall` to view the detailed manual.

Description

Executes the same shell command in each project.

The -r option allows running the command only on projects matching regex or
wildcard expression.

By default, projects are processed non-interactively in parallel. If you want to
run interactive commands, make sure to pass --interactive to force --jobs 1.
While the processing order of projects is not guaranteed, the order of project
output is stable.

因此,repo forall -c 'git reset --hard'表示,在每一个repo下属的git仓库目录中都执行git reset --hard指令。

repo start

repo start:Start a new branch for development。选项:--all, begin branch in all projects。

编译

参考文章:android编译分析之2—envsetup.sh

总的来说,android编译分两部分:

  1. 编译前的准备工作,主要是在shell环境中提前设置了很多变量和函数;
  2. 执行make进行编译,产生各种镜像文件。

流程

  1. source build/envsetup.sh
  2. lunch
  3. pick a combo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
$ . build/envsetup.sh
including device/mediatek/build/vendorsetup.sh
$ lunch
You're building on Linux

Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_blueline-userdebug
4. aosp_bonito-userdebug
5. aosp_car_arm-userdebug
6. aosp_car_arm64-userdebug
7. aosp_car_x86-userdebug
8. aosp_car_x86_64-userdebug
9. aosp_cf_arm64_phone-userdebug
10. aosp_cf_x86_64_phone-userdebug
11. aosp_cf_x86_auto-userdebug
12. aosp_cf_x86_phone-userdebug
13. aosp_cf_x86_tv-userdebug
14. aosp_crosshatch-userdebug
15. aosp_marlin-userdebug
16. aosp_sailfish-userdebug
17. aosp_sargo-userdebug
18. aosp_taimen-userdebug
19. aosp_walleye-userdebug
20. aosp_walleye_test-userdebug
21. aosp_x86-eng
22. aosp_x86_64-eng
23. beagle_x15-userdebug
24. fuchsia_arm64-eng
25. fuchsia_x86_64-eng
26. full_tb8321p2_bsp-eng
27. full_tb8321p2_bsp-user
28. full_tb8321p2_bsp-userdebug
29. full_tb8321p2_bsp_2g-eng
30. full_tb8321p2_bsp_2g-user
31. full_tb8321p2_bsp_2g-userdebug
32. full_tb8765ap1_64_bsp-eng
33. full_tb8765ap1_64_bsp-user
34. full_tb8765ap1_64_bsp-userdebug
35. full_tb8765ap1_bsp-eng
36. full_tb8765ap1_bsp-user
37. full_tb8765ap1_bsp-userdebug
38. full_tb8765ap1_bsp_1g-eng
39. full_tb8765ap1_bsp_1g-user
40. full_tb8765ap1_bsp_1g-userdebug
41. full_tb8766p1_64_bsp-eng
42. full_tb8766p1_64_bsp-user
43. full_tb8766p1_64_bsp-userdebug
44. full_tb8766p1_bsp_1g-eng
45. full_tb8766p1_bsp_1g-user
46. full_tb8766p1_bsp_1g-userdebug
47. full_tb8768p1_64_bsp-eng
48. full_tb8768p1_64_bsp-user
49. full_tb8768p1_64_bsp-userdebug
50. full_tb8768p2_64_bsp_sp-eng
51. full_tb8768p2_64_bsp_sp-user
52. full_tb8768p2_64_bsp_sp-userdebug
53. full_tb8768tp1_64_bsp-eng
54. full_tb8768tp1_64_bsp-user
55. full_tb8768tp1_64_bsp-userdebug
56. full_tb8788m1_64_wifi-eng
57. full_tb8788m1_64_wifi-user
58. full_tb8788m1_64_wifi-userdebug
59. full_tb8788p1_64_bsp-eng
60. full_tb8788p1_64_bsp-user
61. full_tb8788p1_64_bsp-userdebug
62. full_tb8788p1_64_wifi-eng
63. full_tb8788p1_64_wifi-user
64. full_tb8788p1_64_wifi-userdebug
...

Which would you like? [aosp_arm-eng] full_tb8788p1_64_wifi-userdebug
Enter customer product(default: s..wo):
not specific S..WO_CUSTOMER_PRODUCT, reset to s..wo.
device/mediateksample/tb8788p1_64_wifi/device.mk:196: warning: "---------Including s..wo apps---------"

lunch提示你做选择,可以直接回车,可以输入序号,也可以输入序号后的字符串。

编译时,直接执行make即可。AOSP代码的根目录下有一个Makefile,但是内容只有一句,包含了build/core目录下的main.mk,正如名字所示,main.mk是android编译系统中最主要的makefile。

1
2
3
### DO NOT EDIT THIS FILE ###
include build/make/core/main.mk
### DO NOT EDIT THIS FILE ###

m、mm、mmm的区别

首先,使用这三个编译命令,需要提前在源码目录下执行如下命令,否则会提示命令找不到:

1
2
$ . build/envsetup.sh # 或者 source build/envsetup.sh
including device/mediatek/build/vendorsetup.sh

build/envsetup.sh这个脚本包含了很多的shell函数,有些函数是非常有用的,envsetup.sh中的第一个函数为hmm,类似于-help的功能,提示当执行完source后,android系统目前能干些什么,执行hmm。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
~/myProject/DT15/alps$ hmm
Run "m help" for help with the build system itself.

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch: lunch <product_name>-<build_variant>
Selects <product_name> as the product to build, and <build_variant> as the variant to
build, and stores those selections in the environment to be read by subsequent
invocations of 'm' etc.
- tapas: tapas [<App1> <App2> ...] [arm|x86|mips|arm64|x86_64|mips64] [eng|userdebug|user]
- croot: Changes directory to the top of the tree, or a subdirectory thereof.
- m: Makes from the top of the tree.
- mm: Builds all of the modules in the current directory, but not their dependencies.
- mmm: Builds all of the modules in the supplied directories, but not their dependencies.
To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma: Builds all of the modules in the current directory, and their dependencies.
- mmma: Builds all of the modules in the supplied directories, and their dependencies.
- provision: Flash device with all required partitions. Options will be passed on to fastboot.
- cgrep: Greps on all local C/C++ files.
- ggrep: Greps on all local Gradle files.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- mangrep: Greps on all local AndroidManifest.xml files.
- mgrep: Greps on all local Makefiles files.
- sepgrep: Greps on all local sepolicy files.
- sgrep: Greps on all local source files.
- godir: Go to the directory containing a file.
- allmod: List all modules.
- gomod: Go to the directory containing a module.
- pathmod: Get the directory containing a module.
- refreshmod: Refresh list of modules for allmod/gomod.

Environment options:
- SANITIZE_HOST: Set to 'true' to use ASAN for all host modules. Note that
ASAN_OPTIONS=detect_leaks=0 will be set by default until the
build is leak-check clean.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.

Look at the source to view more functions. The complete list is:
addcompletions add_lunch_combo allmod build_build_var_cache cgrep check_product check_type check_variant choosecombo chooseproduct choosetype choosevariant _complete_android_module_names core coredump_enable coredump_setup cproj croot _croot destroy_build_var_cache enable_zsh_completion findmakefile get_abs_build_var getbugreports get_build_var getlastscreenshot get_make_command getprebuilt getscreenshotpath getsdcardpath gettargetarch gettop ggrep godir gomod hmm is isviewserverstarted jgrep key_back key_home key_menu lunch _lunch m make mangrep mgrep mm mma mmm mmma pathmod pez printconfig print_lunch_menu provision qpid rcgrep refreshmod resgrep runhat runtest sepgrep setpaths set_sequence_number set_stuff_for_environment sgrep should_add_completion smoketest source_s..wo_setup source_vendorsetup startviewserver stopviewserver systemstack tapas tracedmdump treegrep validate_current_shell _wrap_build

  • m:Makes from the top of the tree. 编译整个安卓源码树。即找到最顶层目录编译android。
  • mm:Builds all of the modules in the current directory, but not their dependencies. 编译当前目录下的模块,当前目录下需要有Android.mk这个makefile文件,否则就往上找最近的Android.mk文件。
  • mmm:Builds all of the modules in the supplied directories, but not their dependencies. To limit the modules being built use the syntax: mmm dir/:target1,target2. 编译指定路径下的模块,指定的路径下面需要有Android.mk这个文件。
1
2
~/myProject/DT15/alps$
mmm vendor/mediatek/proprietary/packages/apps/MtkSettings/

adb push

项目开发中需要向安卓的目录下传输一些文件,因此记录一下adb pull的使用方式和adb push的使用。摸索完毕后,做一个记录。

首先声明一下,这两种使用方式都仅能在adb device列表里只有一个设备的时候使用,否则需要带上ip。

由于adb push表示向设备传输,adb pull表示向设备外传输。但是二者的用法都是从地址1向地址2传输因此,只介绍adb push。

传输文件

可以指定目标地点文件的名字,此时会对该文件进行覆盖,不要求传输的目标文件后缀和待传输文件一致,例如:adb push C:\Users\Administrator\Desktop\123.txt /sdcard/test/321.c,相当于传输到目的后进行了一次重命名。

也可以省略目标地点的名字,此时会在目标地点生成一个和传输文件同名的文件,同样会对目的地同名文件进行覆盖,例如:adb push C:\Users\Administrator\Desktop\123.txt /sdcard/test/

传输文件夹

传输文件夹时,只会在目的目录下生成一个同名的子目录,不论传输前是否包含斜杠作为结尾,例如:adb push C:\Users\Administrator\Desktop\video\ /sdcard/test/。上面这个语句在video后面或者是test后面不论加不加斜杠,都会在test目录下创建一个叫video的文件夹,并且包含vidio内原本的内容。

如果希望传输文件夹内的文件而不是传输文件夹,那么需要加上.,例如:adb push C:\Users\Administrator\Desktop\video\. /sdcard/test/,此时就会在test文件夹下放置video文件夹内的内容了。

/drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb push . /product/priv-app/;adb shell stop;adb shell start

Android Q remount步骤

  1. adb shell am start com.android.settings/.Settings
  2. 关于,版本号,快速连续点击,进入开发者模式
  3. adb shell am start -a com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS
  4. 打开OEM解锁
  5. adb reboot bootloader
  6. fastboot flashing unlock
  7. press volume up-key(按音量上键)
  8. fastboot reboot
  9. adb root
  10. adb disable-verity
  11. adb reboot
  12. adb root
  13. adb remount

总结

大致测试了以上内容,基本够简单的使用了,如果连接了多个设备又想指定一台进行传输,那么指令上需要在adb和push直接加入-s deviceId,其中deviceId需要替换成用adb devices命令查看到的设备的名称(有可能是ip地址+端口)。例如:adb -s 192.168.10.12:5432 push

额外

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  11/08/2022   11:04.56   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb root;adb remount product
adbd is already running as root
E Skipping /product
W No partitions to remount
/system/bin/remount exited with status 7
remount failed


 11/08/2022   11:05.14   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb root;adb remount vendor
adbd is already running as root
E Skipping /vendor
W No partitions to remount
/system/bin/remount exited with status 7
remount failed


 11/08/2022   11:05.21   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb reboot bootloader


 11/08/2022   11:06.07   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  fastboot devices
S..WOS202110120008 fastboot


 11/08/2022   11:06.26   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  fastboot flashing unlock
(bootloader) Start unlock flow

OKAY [ 6.276s]
Finished. Total time: 6.276s


 11/08/2022   11:07.02   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  fastboot reboot
Rebooting OKAY [ 0.003s]
Finished. Total time: 0.003s

 11/08/2022   11:08.03   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb connect 192.168.137.230
connected to 192.168.137.230:5555

 11/08/2022   11:09.42   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb root
restarting adbd as root

 11/08/2022   11:09.45   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb disable-verity
using overlayfs
Successfully disabled verity
Now reboot your device for settings to take effect


 11/08/2022   11:09.51   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb reboot

 11/08/2022   11:10.37   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb root;adb remount
remount succeeded

 11/08/2022   11:10.48   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb root;adb remount ;adb push product/priv-app/MtkSettings/ /product/priv-app/
adbd is already running as root
remount succeeded
product/priv-app/MtkSettings/: 3 files pushed, 0 skipped. 11.3 MB/s (34525797 bytes in 2.918s)

 11/08/2022   11:11.11   /drives/q/myProject/DT15/alps/out/target/product/tb8788p1_64_wifi  adb root;adb remount ;adb push product/priv-app/MtkSettings/ /product/priv-app/;adb shell stop;adb shell start
adbd is already running as root
remount succeeded
product/priv-app/MtkSettings/: 3 files pushed, 0 skipped. 11.2 MB/s (34525817 bytes in 2.945s)

MTK烧录

准备流程

软件:Windows系统、MTK烧录工具及驱动包 - mtk_SP_Flash_Tool_+_Driver.zip

解压MTK烧录工具及驱动包,有以下文件:

image-20220815091907230

驱动安装:

  1. 打开SP驱动安装程序:
    Driver_Auto_Installer_EXE_v5.1632.00\Driver_Auto_Installer_SP_Drivers_20160804\DriverInstall.exe
  2. 打开USB驱动安装程序:usb_driver\setup.exe

烧录工具程序:SP_Flash_Tool_exe_Windows_v5.1916.00.000\flash_tool.exe

  1. 点击Download-Agent右边的choose按钮,选择当前烧录工具目录下的MTK_AllInOne_DA.bin文件;
  2. 点击Scatter-loading File栏右边的choose按钮,选择系统固件包里的MT6771_Android_scatter.txt
  3. 选择三种模式之一,最后点击Download准备烧录。
  4. 重启设备,进行烧录写入。
  5. 烧录完成后,拔插设备电源,开机即可进入系统。

三种模式的差异

  1. Format All + Download,对应的是全擦升级,会把各种标识擦除,比如写标识位、机器SN码。
  2. Firmware Upgrade,也会重写各种标识,常在不同开发版本之间转换时使用,如user和userdebug之间转换。
  3. Download Only,一般是同一开发版本下新旧版本号的切换,或者同版本号不同代码的调试使用。

Android_原生设置入口问题

问题引入

某沃学习机上面,出现几次系统的动画时长缩放被设置为0,导致应用动画异常。

某沃学习机Android版本:10。

transition_animation_scale 0.5
window_animation_scale 0.5
animator_duration_scale 1.0

实际上,这个是开发者选项中才能调整的参数,而且这个设置的入口在定制版系统上屏蔽掉了,不介入第三方应用或者开发工具不会直接打开,所以可能的原因有:

  1. 通过开发工具或者第三方应用进入了开发者选项,手动调整参数。
  2. 第三方应用修改了动画时长缩放配置;

针对第一种可能:网上下载了一个Open Settings(shortcut to settings)APK。尝试在某度学习机和某沃学习机上打开,发现,某度进入了厂家定制的设置中,而某沃却轻松地进入了Android的原生设置程序中。

实际上学习机这类产品是不想把原生设置的机会让度给普通用户的,所以,某沃的学习机进不去实属没有周全考虑系统安全性。

经自己模拟开发第三方应用设置参数,排除了第三方应用直接设置的可能,见下文。

Android Settings中System/Global/Secure

https://blog.csdn.net/qq_37580586/article/details/122327215

来电铃声、锁屏时间、日期格式等等这些属性的设置通常有Settings为入口,通过SettingsProvider来进行。SettingsProvider也是所有系统设置的管理者。

在Android 5.0版本之前,SettingsProvider中系统设置是存储在settings.db数据库中;但是在Android 6.0之后,SettingsProvider中系统设置改为由xml存储在data分区。

为何要从settings.db改为xml存储?

  1. 这次修改主要涉及到global, secure, system三个表。改为了settings_global.xmlsettings_secure.xmlsettings_system.xml,对应/frameworks/base/core/java/android/provider/Settings.java中的三个内部类:Global、Secure、System。其实还有两个xml,settings_config.xmlsettings_ssaid.xml
    1. Global:所有的偏好设置对系统的所有用户公开,第三方APP只读;
    2. System:包含各种各样的用户偏好系统设置,第三方APP只读;
    3. Secure:安全性的用户偏好系统设置,第三方APP只读。
  2. 实现方式从之前的数据库,改为异步性能更加优良的xml。
  3. 这次修改主要是基于性能的考量(写入一条耗时从400ms降低为10ms),同时也能够使得保存数据的过程更加可信。
  4. 实际上,使保存数据过程更加可信这一条并不是问题的关键,写入失败的情况非常罕见,而且上层应用修改SettingsProvider设置都是通过SettingsProvider来实现的。所以当上层APP下次再次启动的时候,并不知道数据写入失败。
  5. 从db改为xml以及相应逻辑,可以有效的防止某些恶意APP监听某些设置选项,进而频繁的进行操作。
  6. 每个用户都有自己的一份SettingsProvider设置xml文档。通常位于/data/system/users/userid/
  7. 控制APP针对SettingsProvider的写入,即合法性判断
  8. 控制SettingsProvider的大小(数据量大小,占用内存大小)

其实主要原因就是因为性能、安全两个原因。

与SystemProperties对比

settings_global.xmlsettings_secure.xmlsettings_system.xml,对应/frameworks/base/core/java/android/provider/Settings.java中的三个内部类。

它们三个都继承了NameValueTable,而NameValueTable都继承了BaseColumns。查看/frameworks/base/core/java/android/provider/BaseColumns.java可以看到:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
package android.provider;
public interface BaseColumns {
/**
* The unique ID for a row.
* <P>Type: INTEGER (long)</P>
*/
public static final String _ID = "_id";

/**
* The count of rows in a directory.
* <P>Type: INTEGER</P>
*/
public static final String _COUNT = "_count";
}

Settings中不论是Global、System还是Secure的数据都由键值对组成的。

SettingsProvider有点类似Android的properties系统(Android属性系统):SystemProperties。但是SettingsProvider和SystemProperties有以下不同点:

  1. 数据保存方式不同:SystemProperties的数据保存属性文件中(/system/build.prop等),开机后会被加载到system properties store;SettingsProvider的数据保存在文件/data/system/users/0/settings_***.xml和数据库settings.db中;
  2. 作用范围不同:SystemProperties可以实现跨进程、跨层次调用,即底层的c/c++可以调用,java层也可以调用;SettingsProvider只能能在java层(APP)使用;
  3. 公开程度不同:SystemProperties有部分功能上层第三方APP可以使用(对于加了@hide标记的第三方APP仅可读,不可修改);SettingsProvider上层第三方APP不可以使用;

Settings的修改方式

adb shell

通过adb shell进行修改,格式为:

1
2
3
adb shell settings get [global/system/secure] [key]
adb shell settings put [global/system/secure] [key] [value]
adb shell settings list [global/system/secure]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
PS C:\Users\ThinkPad> adb shell
tb8788p1_64_wifi:/ # settings put global transition_animation_scale 0.5
tb8788p1_64_wifi:/ # settings get global transition_animation_scale
0.5
tb8788p1_64_wifi:/ # settings list system
accelerometer_rotation=0
alarm_alert=content://media/internal/audio/media/35?title=Cesium&canonical=1
alarm_alert_set=1
background_power_saving_enable=1
dim_screen=1
display_paper_mode_activated=0
display_paper_mode_texture=255
dtmf_tone=1
dtmf_tone_type=0
end_button_behavior=2
ethernet_state=1
gsensor_change_all_process=0
haptic_feedback_enabled=0
hearing_aid=0
hide_rotation_lock_toggle_for_accessibility=0
import_remove_running=false
isEthernetOpen=0
is_ambient_sensor_adjust=1
is_gravity_sensor_adjust=1
is_light_sensor_adjust=1
is_proximity_sensor_adjust=1
lockscreen_sounds_enabled=0
machine_serial_number=62210304000055
mode_ringer_streams_affected=166
mute_streams_affected=111
notification_light_pulse=1
notification_sound=content://media/internal/audio/media/56?title=Pixie%20Dust&canonical=1
notification_sound_set=1
notification_vibration_intensity=0
pointer_speed=0
radio.data.stall.recovery.action=0
ring_vibration_intensity=0
ringtone=content://media/internal/audio/media/177?title=Flutey%20Phone&canonical=1
ringtone_set=1
screen_brightness=204
screen_brightness_for_vr=86
screen_brightness_mode=0
screen_off_timeout=600000
s..wo_close_voice_call=1
show_password=0
sound_effects_enabled=1
stu_fingerprint=.........
system_s..wo_sensor_value_report=1
system_user_login_state=1
time_12_24=24
tty_mode=0
user_rotation=0
vibrate_when_ringing=0
voice_trigger_active_command_id=1
voice_wakeup_mode=1
volume_alarm=5
volume_bluetooth_sco=5
volume_music=5
volume_music_speaker=1
volume_music_usb_headset=2
volume_notification=5
volume_ring=5
volume_system=5
volume_voice=3
website_control_state=0

应用修改

1
2
3
4
// 示例
import android.provider.Settings;//需要通过提供器中的settings类修改
Settings.Global.putString(mContext.getContentResolver(), "audio_test_result", value);//修改
Settings.Global.getString(mContext.getContentResolver(), "audio_test_result");//查询
1
2
3
4
5
6
7
8
9
10
11
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/change_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ChangeAppArgs">
</Button>
</LinearLayout>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import android.provider.Settings;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button = (Button) findViewById(R.id.change_button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Settings.Global.putString(getContentResolver(), "animator_duration_scale", "1.0");
String ads = Settings.Global.getString(getContentResolver(), "animator_duration_scale");
Log.d("MainActivity", "animator_duration_scale: " + ads);
}
});
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.appchangeargtest">
<!-- error: This Permission is only granted to system apps -->
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppChangeArgTest">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

提示:error: This Permission is only granted to system apps。说明第三方App肯定是无法修改这个动画缩放的,而是系统应用才有权修改,因此也排除了三方应用直接修改动画时长缩放参数。

推测如何找到原生设置入口

通过Intent来测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.intenttosetting">
<application ...>
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent">

<Button
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SETTINGS">
</Button>
<Button
android:id="@+id/develop_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="APPLICATION_DEVELOPMENT_SETTINGS">
</Button>
<Button
android:id="@+id/accessibility_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ACCESSIBILITY_SETTINGS">
</Button>
<Button
android:id="@+id/device_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="DEVICE_INFO">
</Button>
<Button
android:id="@+id/top_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="top_settings">
</Button>

<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text="packageName" />

<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text="className" />

<Button
android:id="@+id/package_class"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="package_class" />

<EditText
android:id="@+id/editText3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text="actionName" />

<Button
android:id="@+id/action"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ACTION" />
</LinearLayout>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button b1 = (Button) findViewById(R.id.settings);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent("android.settings.SETTINGS");
startActivity(intent);
}
});
Button b2 = (Button) findViewById(R.id.develop_settings);
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent("com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS");
startActivity(intent);
}
});
Button b3 = (Button) findViewById(R.id.accessibility_settings);
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent("android.settings.ACCESSIBILITY_SETTINGS");
startActivity(intent);
}
});
Button b4 = (Button) findViewById(R.id.device_info);
b4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent("android.settings.DEVICE_INFO_SETTINGS");
startActivity(intent);
}
});
Button b5 = (Button) findViewById(R.id.top_settings);
b5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.SubSettings");
startActivity(intent);
}
});
Button b_package_class = (Button) findViewById(R.id.package_class);
b_package_class.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText t1 = (EditText) findViewById(R.id.editText);
EditText t2 = (EditText) findViewById(R.id.editText2);
Intent intent = new Intent();
intent.setClassName(t1.getText().toString(), t2.getText().toString());
startActivity(intent);
}
});
Button b_action = (Button) findViewById(R.id.action);
b_action.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
EditText t3 = (EditText) findViewById(R.id.editText3);
Intent intent = new Intent(t3.getText().toString());
startActivity(intent);
}
});
}
}

情况如下:

intent 某沃 某度
android.settings.SETTINGS 直接进原生设置。 进厂家设置。
com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS 提示请先启用开发者选项。如果处于开发者模式,则直接进。 提示请先启用开发者选项。如果处于开发者模式,则直接进。
android.settings.ACCESSIBILITY_SETTINGS 直接进无障碍设置。 直接进无障碍设置。
android.settings.DEVICE_INFO_SETTINGS 直接进关于本机信息,下拉菜单点击若干次版本号,可以进入开发者模式。 直接进关于本机信息,下拉菜单点击若干次版本号,可以进入开发者模式。
com.android.settings, com.android.settings.SubSettings 崩溃,日志报错,permission denial, id = 1000。疑似是此操作只有系统应用才可操作。 直接进原生设置顶层界面!
某一子设置项目的左上角返回按键流向 可以返回到设置顶层界面 经过处理,统一返回到桌面,即不可返回到设置顶层界面。

由以上实验,推测,某沃用户可以通过各种第三方应用先转到原生设置下点按版本号进入开发者模式,后进入开发者选项调整动画时长缩放。

由此,为了避免用户进入原生设置进行配置,造成不可预测的异常现象,需要定制一个设置程序,屏蔽掉原生设置的活动入口。有以下几个方向:

  1. 把原来action指向的原生设置程序指向厂家定制设置程序。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // 以下信息来自.../vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
    <activity android:name=".homepage.SettingsHomepageActivity"
    android:label="@string/settings_label_launcher"
    android:theme="@style/Theme.Settings.Home"
    android:launchMode="singleTask">
    <intent-filter android:priority="1">
    <action android:name="android.settings.SETTINGS" />
    <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
    android:value="true" />
    </activity>

拦截进入开发者模式

进入版本号界面后,快速连续点按版本号,会显示信息:“现在只需再执行n步操作即可进入开发者模式”。以此为入口,检索这个字符串的代号。

1
2
3
4
~/myProject/DT15/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/src$ rg "步操作即可进入开发者模式" ..
../res/values-zh-rCN/strings.xml
26: <item quantity="other">现在只需再执行 <xliff:g id="STEP_COUNT_1">%1$d</xliff:g> 步操作即可进入开发者模式。</item>
27: <item quantity="one">现在只需再执行 <xliff:g id="STEP_COUNT_0">%1$d</xliff:g> 步操作即可进入开发者模式。</item>

可以看到,这个信息的字符串在.../res/values-zh-rCN/strings.xml中定义。

1
2
3
4
25     <plurals name="show_dev_countdown" formatted="false" msgid="7201398282729229649">
26 <item quantity="other">现在只需再执行 <xliff:g id="STEP_COUNT_1">%1$d</xliff:g> 步操作即可进入开发者模式。</item>
27 <item quantity="one">现在只需再执行 <xliff:g id="STEP_COUNT_0">%1$d</xliff:g> 步操作即可进入开发者模式。</item>
28 </plurals>

这个字符串的name为show_dev_countdown,顺藤摸瓜。

1
2
3
~/myProject/DT15/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com$ rg show_dev_countdown
android/settings/deviceinfo/BuildNumberPreferenceController.java
196: R.plurals.show_dev_countdown, mDevHitCountdown,

可以看到,输出此字符串的代码文件只有一个,BuildNumberPreferenceController.java,拦截进入开发者模式的解决之道则聚焦在了此文件上。

原生设置入口跳转

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public class SettingsHomepageActivity extends FragmentActivity {
private static final String TAG = SettingsHomepageActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String password = getIntent().getStringExtra("password");
if(password != null && password.equals(".........")) {
Log.w(TAG, "Origin Action");
setContentView(R.layout.settings_homepage_container);
final View root = findViewById(R.id.settings_homepage_container);
root.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);

setHomepageContainerPaddingTop();

final Toolbar toolbar = findViewById(R.id.search_action_bar);
FeatureFactory.getFactory(this).getSearchFeatureProvider()
.initSearchToolbar(this /* activity */, toolbar, SettingsEnums.SETTINGS_HOMEPAGE);

final ImageView avatarView = findViewById(R.id.account_avatar);
final AvatarViewMixin avatarViewMixin = new AvatarViewMixin(this, avatarView);
getLifecycle().addObserver(avatarViewMixin);

if (!getSystemService(ActivityManager.class).isLowRamDevice()) {
// Only allow contextual feature on high ram devices.
showFragment(new ContextualCardsFragment(), R.id.contextual_cards_content);
}
showFragment(new TopLevelSettings(), R.id.main_content);
((FrameLayout) findViewById(R.id.main_content))
.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
} else {
Log.w(TAG, "s..wo's Action");
Intent intent = new Intent();
intent.setClassName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity");
startActivity(intent);
finish();
}
}
// ...
}

版本信息入口屏蔽

目的是隐藏设置主页面最下面的“关于平板电脑”子项目。

在源码目录中检索“关于平板电脑”一词。发现此属性名为"about_settings"

1
2
3
<string name="about_settings" product="tablet" msgid="593457295516533765">"关于平板电脑"</string>
<string name="about_settings" product="default" msgid="1743378368185371685">"关于手机"</string>
<string name="about_settings" product="device" msgid="6717640957897546887">"关于设备"</string>

在源码目录中检索“about_settings”一词。发现在AndroidManifest.xml中被引用

1
2
vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
1009: android:label="@string/about_settings"

AndroidManifest.xml中涉及关于设备信息的完整部分:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<activity android:name=".Settings$MyDeviceInfoActivity"
android:label="@string/about_settings"
android:icon="@drawable/ic_homepage_about">
<intent-filter android:priority="1">
<action android:name="android.settings.DEVICE_INFO_SETTINGS" />
<action android:name="android.settings.DEVICE_NAME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:priority="71">
<action android:name="android.intent.action.MAIN" />
<category android:name="com.android.settings.SHORTCUT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
</activity>

说明,屏蔽版本信息入口后,依然可以通过“adb shell am start -a android.settings.DEVICE_INFO_SETTINGS”进入版本信息界面。

接着检索android.settings.DEVICE_INFO_SETTINGS

1
2
3
4
5
frameworks/base/core/java/android/provider/Settings.java

@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_DEVICE_INFO_SETTINGS =
"android.settings.DEVICE_INFO_SETTINGS";

检索ACTION_DEVICE_INFO_SETTINGS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
frameworks/base/core/java/android/provider/Settings.java
1177: public static final String ACTION_DEVICE_INFO_SETTINGS =

development/apps/BuildWidget/src/com/android/buildwidget/BuildWidget.java
69: new Intent(android.provider.Settings.ACTION_DEVICE_INFO_SETTINGS),

frameworks/base/core/tests/coretests/src/android/provider/SettingsProviderTest.java
339: assertCanBeHandled(new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS));

cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/IntentFiltersTestHelper.java
73: new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS),

cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/UserRestrictions.java
125: Settings.ACTION_DEVICE_INFO_SETTINGS,
127: Settings.ACTION_DEVICE_INFO_SETTINGS,

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/uitests/src/com/android/settings/ui/AboutPhoneSettingsTests.java
76: launchAboutPhoneSettings(Settings.ACTION_DEVICE_INFO_SETTINGS);
1
vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/core/gateway/SettingsGateway.java

应用信息打开按钮屏蔽

全局搜索“打开”。

  1. mtk_strings.xml: vendor/mediatek/proprietary/packages/apps/Mms/res/values-zh-rCN
  2. strings.xml: vendor/mediatek/proprietary/frameworks/base/res/res/values-zh-rCN
1
<string name="launch_instant_app" msgid="391581144859010499">"打开"</string>

全局搜索“强行停止”

  1. strings.xml: vendor/mediatek/proprietary/frameworks/apps/MtkSettings/res/values-zh-rCN
    1. 649958863744041872
    2. 7435006169872876756

修改的文件

DT15/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings

进入android.settings.SETTINGS时会判断调用者或校验extra参数;进入设备信息页面时会判断调用者;去除应用信息页面中“打开”的按钮;

1
2
3
4
5
[feature][SettingsEntryBlock] Intercept the entry of AOSP config

[what] 1. when intent to AOSP settings page, it will judge the caller or verify extra parameters; 2. when intent to the AOSP device info page, it will judge the caller; 3. remove the "Open" button in the ASOP app info page;
[why] avoid user mistakenly or deliberately configure parameters to cause exceptions
[how] modify intent logic; hide entries

AppButtonsPreferenceController.java

src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
@@ -169,9 +169,10 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
if (isAvailable()) {
mButtonsPref = ((ActionButtonsPreference) screen.findPreference(
KEY_ACTION_BUTTONS))
- .setButton1Text(R.string.launch_instant_app)
- .setButton1Icon(R.drawable.ic_settings_open)
- .setButton1OnClickListener(v -> launchApplication())
+ //.setButton1Text(R.string.launch_instant_app)
+ //.setButton1Icon(R.drawable.ic_settings_open)
+ //.setButton1OnClickListener(v -> launchApplication())
+ .setButton1Visible(false)
.setButton2Text(R.string.uninstall_text)
.setButton2Icon(R.drawable.ic_settings_delete)
.setButton2OnClickListener(new UninstallAndDisableButtonListener())

SettingsGateway.java【去除版本号入口】

src/com/android/settings/core/gateway/SettingsGateway.java

1
2
3
4
5
6
7
8
9
@@ -190,7 +190,7 @@ public class SettingsGateway {
UserDictionaryList.class.getName(),
UserDictionarySettings.class.getName(),
DisplaySettings.class.getName(),
- MyDeviceInfoFragment.class.getName(),
+ //MyDeviceInfoFragment.class.getName(),
ModuleLicensesDashboard.class.getName(),
ManageApplications.class.getName(),
FirmwareVersionSettings.class.getName(),

SettingsHomepageActivity.java

src/com/android/settings/homepage/SettingsHomepageActivity.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import android.util.Log;

@@ -37,33 +39,42 @@ import com.android.settings.homepage.contextualcards.ContextualCardsFragment;
import com.android.settings.overlay.FeatureFactory;

public class SettingsHomepageActivity extends FragmentActivity {
-
+ private static final String TAG = SettingsHomepageActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
- setContentView(R.layout.settings_homepage_container);
- final View root = findViewById(R.id.settings_homepage_container);
- root.setSystemUiVisibility(
- View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
-
- setHomepageContainerPaddingTop();
-
- final Toolbar toolbar = findViewById(R.id.search_action_bar);
- FeatureFactory.getFactory(this).getSearchFeatureProvider()
- .initSearchToolbar(this /* activity */, toolbar, SettingsEnums.SETTINGS_HOMEPAGE);
-
- final ImageView avatarView = findViewById(R.id.account_avatar);
- final AvatarViewMixin avatarViewMixin = new AvatarViewMixin(this, avatarView);
- getLifecycle().addObserver(avatarViewMixin);
-
- if (!getSystemService(ActivityManager.class).isLowRamDevice()) {
- // Only allow contextual feature on high ram devices.
- showFragment(new ContextualCardsFragment(), R.id.contextual_cards_content);
+ String password = getIntent().getStringExtra("password");
+ if(password != null && password.equals(".........")) {
+ Log.w(TAG, "Origin Action");
+ setContentView(R.layout.settings_homepage_container);
+ final View root = findViewById(R.id.settings_homepage_container);
+ root.setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+
+ setHomepageContainerPaddingTop();
+
+ final Toolbar toolbar = findViewById(R.id.search_action_bar);
+ FeatureFactory.getFactory(this).getSearchFeatureProvider()
+ .initSearchToolbar(this /* activity */, toolbar, SettingsEnums.SETTINGS_HOMEPAGE);
+
+ final ImageView avatarView = findViewById(R.id.account_avatar);
+ final AvatarViewMixin avatarViewMixin = new AvatarViewMixin(this, avatarView);
+ getLifecycle().addObserver(avatarViewMixin);
+
+ if (!getSystemService(ActivityManager.class).isLowRamDevice()) {
+ // Only allow contextual feature on high ram devices.
+ showFragment(new ContextualCardsFragment(), R.id.contextual_cards_content);
+ }
+ showFragment(new TopLevelSettings(), R.id.main_content);
+ ((FrameLayout) findViewById(R.id.main_content))
+ .getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
+ } else {
+ Log.w(TAG, "s..wo's Action");
+ Intent intent = new Intent();
+ intent.setClassName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity");
+ startActivity(intent);
+ finish();
}
- showFragment(new TopLevelSettings(), R.id.main_content);
- ((FrameLayout) findViewById(R.id.main_content))
- .getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
}

MyDeviceInfoFragment.java

com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import android.widget.Toast;
@Override
public void onAttach(Context context) {
super.onAttach(context);
if("android-app://com.android.settings".equals(this.getActivity().getReferrer().toString()))
{
use(ImeiInfoPreferenceController.class).setHost(this /* parent */);
use(DeviceNamePreferenceController.class).setHost(this /* parent */);
mBuildNumberPreferenceController = use(BuildNumberPreferenceController.class);
mBuildNumberPreferenceController.setHost(this /* parent */);
} else {
Toast.makeText(context, R.string.cannot_into_device_info, Toast.LENGTH_SHORT).show();
finish();
}
}

strings.xml

vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml

1
<string name="cannot_into_device_info">Only debuggers can access the Device-Info Page</string>

vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml

1
<string name="cannot_into_device_info" msgid="2196318436963951285">非调试者无法进入版本信息页面</string>

编译冲突

vendor/mediatek/proprietary/packages/apps/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java

日志

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
development/apps/Fallback/AndroidManifest.xml
55: <action android:name="android.settings.SETTINGS" />

vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
160: <action android:name="android.settings.SETTINGS" />

frameworks/base/core/java/android/provider/Settings.java
122: public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
633: executeShellCommand("am start -a android.settings.SETTINGS");

development/samples/MultiWindow/src/com/example/android/multiwindow/LaunchingAdjacentActivity.java
53: Intent intent = new Intent("android.settings.SETTINGS");

vendor/mediatek/proprietary/operator/packages/apps/Browser/OP07/src/com/mediatek/op07/browser/OP07NetworkStateHandlerExt.java
158: Intent intent = new Intent("android.settings.SETTINGS");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
frameworks/base/api/current.txt
38705: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

development/apps/Fallback/AndroidManifest.xml
55: <action android:name="android.settings.SETTINGS" />

prebuilts/sdk/5/public/api/android.txt
11335: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/7/public/api/android.txt
11389: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/2/public/api/android.txt
7654: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/6/public/api/android.txt
11342: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/12/public/api/android.txt
15925: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/10/public/api/android.txt
13613: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/22/public/api/android.txt
25214: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/22/system/api/android.txt
26813: field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/25/public/api/android.txt
32341: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/25/system/api/android.txt
35173: field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/8/public/api/android.txt
12573: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/11/public/api/android.txt
15541: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/17/public/api/android.txt
18754: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/20/public/api/android.txt
21186: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/28/public/api/android.txt
36463: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/15/public/api/android.txt
17382: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/21/public/api/android.txt
25141: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/14/public/api/android.txt
17255: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/3/public/api/android.txt
8708: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/1/public/api/android.txt
7650: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/13/public/api/android.txt
16020: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/19/public/api/android.txt
21028: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/18/public/api/android.txt
19874: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/4/public/api/android.txt
9945: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/27/public/api/android.txt
34744: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/24/public/api/android.txt
32236: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/27/system/api/android.txt
37925: field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/23/public/api/android.txt
26448: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/24/system/api/android.txt
35019: field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/23/system/api/android.txt
28511: field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/29/public/api/android.txt
38674: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/9/public/api/android.txt
13384: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/16/public/api/android.txt
18326: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/26/public/api/android.txt
34646: field public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

prebuilts/sdk/26/system/api/android.txt
37772: field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";

frameworks/opt/setupwizard/tools/docs/android-22.txt
25229: field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";

vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
160: <action android:name="android.settings.SETTINGS" />

external/autotest/client/common_lib/cros/arc.py
657: output = adb_shell('am start -W -a android.settings.SETTINGS')

frameworks/base/core/java/android/provider/Settings.java
122: public static final String ACTION_SETTINGS = "android.settings.SETTINGS";

out/target/common/obj/APPS/MtkSettings_intermediates/manifest/AndroidManifest.xml.fixed
141: <action android:name="android.settings.SETTINGS"/>

out/target/common/obj/APPS/MtkSettings_intermediates/manifest/AndroidManifest.xml
168: <action android:name="android.settings.SETTINGS" />

cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
633: executeShellCommand("am start -a android.settings.SETTINGS");

development/samples/MultiWindow/src/com/example/android/multiwindow/LaunchingAdjacentActivity.java
53: Intent intent = new Intent("android.settings.SETTINGS");

vendor/mediatek/proprietary/operator/packages/apps/Browser/OP07/src/com/mediatek/op07/browser/OP07NetworkStateHandlerExt.java
158: Intent intent = new Intent("android.settings.SETTINGS");

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
xurui@ubuntu:~/myProject/DT15/alps$
rg 'package com.android.settings;' . -j56
./external/flatbuffers/.gitignore: line 114: error parsing glob '.corpus**': invalid use of **; must be one path component
./external/flatbuffers/.gitignore: line 115: error parsing glob '.seed**': invalid use of **; must be one path component
out/target/common/R/com/android/settings/Manifest.java
8:package com.android.settings;

out/target/common/R/com/android/settings/R.java
8:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ProgressCategoryBase.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/CustomListPreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SummaryPreference.java
15:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/DateTimeSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/LinkifyUtils.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/CancellablePreference.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/TestingSettingsBroadcastReceiver.java
1:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/EncryptionInterstitial.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/AccessiblePreferenceCategory.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SettingsDumpService.java
15:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ProgressCategory.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/DisplaySettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/BrightnessPreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/TestingSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/BandMode.java
1:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/HelpTrampoline.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SetFullBackupPassword.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/MasterClearConfirm.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SettingsLicenseActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/MonitoringCertInfoActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/AirplaneModeEnabler.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ResetNetworkConfirm.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ResetNetwork.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/TrustedCredentialsDialogBuilder.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ActivityPicker.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/IccLockSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/FallbackHome.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SetupWizardUtils.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ManualDisplayActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RingtonePreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/DialogCreatable.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RestrictedCheckBox.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SetupRedactionInterstitial.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RadioInfo.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/MasterClear.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/CryptKeeper.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RegulatoryInfoDisplayActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SelfAvailablePreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/AirplaneModeVoiceActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/Utils.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RestrictedSettingsFragment.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/TetherSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/DefaultRingtonePreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SetupEncryptionInterstitial.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/UsageStatsActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/AppWidgetLoader.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/TouchBlockingFrameLayout.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RestrictedRadioButton.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SubSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/EditPinPreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/Settings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/UserCredentialsSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SeekBarDialogPreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SettingsInitialize.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/PointerSpeedPreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SettingsActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/BugreportPreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/AllowBindAppWidgetActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/CheckableLinearLayout.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/CryptKeeperConfirm.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ButtonBarHandler.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SettingsPreferenceFragment.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SettingsTutorialDialogWrapperActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RestrictedListPreference.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/RemoteBugreportActivity.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/LegalSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/TrustedCredentialsSettings.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/AppWidgetPickActivity.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/ProxySelector.java
17:package com.android.settings;

out/target/common/obj/APPS/MtkSettings_intermediates/srcjars/com/android/settings/Manifest.java
8:package com.android.settings;

out/target/common/obj/APPS/MtkSettings_intermediates/srcjars/com/android/settings/R.java
8:package com.android.settings;

out/target/common/obj/APPS/MtkSettings_intermediates/aapt2/com/android/settings/Manifest.java
8:package com.android.settings;

out/target/common/obj/APPS/MtkSettings_intermediates/aapt2/com/android/settings/R.java
8:package com.android.settings;

out/target/common/obj/JAVA_LIBRARIES/settings-logtags_intermediates/logtags/src/com/android/settings/EventLogTags.java
5:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/HelpTrampolineTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/TetherSettingsTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/unit/src/com/android/settings/UserCredentialsTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/unit/src/com/android/settings/UtilsTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/RestrictedSettingsFragmentTest.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/unit/src/com/android/settings/RegulatoryInfoDisplayActivityTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SettingsDumpServiceTest.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SetupWizardUtilsTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/RestrictedListPreferenceTest.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/UtilsTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SettingsActivityTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/TestUtils.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/LegalSettingsTest.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/ResetNetworkConfirmTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SettingsPreferenceFragmentTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/RegulatoryInfoDisplayActivityTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SettingsDialogFragmentTest.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/MasterClearConfirmTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/DisplaySettingsTest.java
1:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/ResetNetworkTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SettingsLicenseActivityTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java
16:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/SettingsInitializeTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/MasterClearTest.java
17:package com.android.settings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/unit/src/com/android/settings/notification/ZenModeSettingsIntegrationTest.java
1:package com.android.settings;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
xurui@ubuntu:~/myProject/DT15/alps$
rg 'com.s..wo.eclass.settings' . -j56
./external/flatbuffers/.gitignore: line 114: error parsing glob '.corpus**': invalid use of **; must be one path component
./external/flatbuffers/.gitignore: line 115: error parsing glob '.seed**': invalid use of **; must be one path component
frameworks/base/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
624: "com.s..wo.eclass.settings",

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/custom/UtilsAc.java
37: new ComponentName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity"));
49: new ComponentName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity"));
61: new ComponentName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity"));
88: new ComponentName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity"));
98: new ComponentName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity"));
161: intent.setClassName("com.s..wo.eclass.settings", "com.s..wo.eclass.settings.SettingsActivity");

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
out/target/common/obj/APPS/MtkSettings_intermediates/proguard_dictionary
21825:com.android.settings.SubSettings -> com.android.settings.SubSettings:

out/target/common/obj/APPS/MtkSettings_intermediates/manifest/AndroidManifest.xml
216: android:name="com.android.settings.SubSettings"

vendor/mediatek/proprietary/hardware/power/config/mt6739/app_list/power_app_cfg.xml
25: <Activity name="com.android.settings.SubSettings">

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/location/LocationSlice.java
38:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/core/SubSettingLauncher.java
31:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/core/SettingsBaseActivity.java
42:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java
37:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/panel/NfcPanel.java
25:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/search/SearchResultTrampoline.java
27:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/panel/WifiPanel.java
25:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/slices/SliceBuilderUtils.java
47:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/notification/ZenModeSliceBuilder.java
38:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/wifi/slice/WifiSlice.java
49:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
51:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/homepage/contextualcards/deviceinfo/DataUsageSlice.java
37:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
49:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java
45:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/homepage/contextualcards/slices/LowStorageSlice.java
34:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
37:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
37:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/homepage/contextualcards/deviceinfo/StorageSlice.java
34:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceTest.java
45:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/deviceinfo/storage/UserProfileControllerTest.java
39:import com.android.settings.SubSettings;

vendor/mediatek/proprietary/packages/apps/MtkSettings/tests/robotests/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceControllerTest.java
52:import com.android.settings.SubSettings;