Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to cleanup tmp folder during cleanup phase #772

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jupe
Copy link

@jupe jupe commented Apr 22, 2024

To keep phones stable for longer duration, e.g. /data/local/tmp folder seem to be needed to cleanup every now and then. This was earlier done in separate apk/tool, but simpler to do it directly by stf, so bring such functionality natively here. If folder/file removing fails, error message are written to logs. Cleanup ignore stf service files ( minicap.apk, minicap, minicap.so, minitouch, minirev).

NOTE: "fool detection" is very simple and it's easy to round up if user really want to make harm for phone. Feature is still deployment configuration so it's admin who can mess up devices, who normally won't do such thing, so I think it's okay.

  --cleanup-folders            Whether to remove pre-defined folder during
                               cleanup.                    [array] [default: []]

Logs e.g.:

2024-04-22T12:17:47.165Z INF/device:plugins:cleanup 72122 [39261JEHN08067] Cleanup /data/local/tmp folder
2024-04-22T12:17:47.196Z DBG/device:plugins:cleanup 72122 [39261JEHN08067] Skipping /data/local/tmp/minicap.apk
2024-04-22T12:17:47.196Z DBG/device:plugins:cleanup 72122 [39261JEHN08067] Skipping /data/local/tmp/minitouch
2024-04-22T12:17:47.197Z DBG/device:plugins:cleanup 72122 [39261JEHN08067] Skipping /data/local/tmp/minirev
2024-04-22T12:17:47.197Z INF/device:plugins:cleanup 72122 [39261JEHN08067] Removing /data/local/tmp/minicap.log
2024-04-22T12:17:47.197Z INF/device:plugins:cleanup 72122 [39261JEHN08067] Removing /data/local/tmp/test-file

Signed-off-by: Jussi Vatjus-Anttila <jussiva@gmail.com>
@jupe jupe marked this pull request as draft April 25, 2024 07:44
Added generic ignore for stf service files and simple fool detection in case user tried to clean system folder.

NOTE: "fool detection" is very simple and it's easy to round up if user really want to make harm for devices. This is still deployment configuration so it's admin who can mess up devices, who normally won't do such thing, so I think it's okay.
Signed-off-by: Jussi Vatjus-Anttila <jussiva@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants