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

modules/android-integration: add am command and many termux-tools ones #382

Merged
merged 5 commits into from
Jul 7, 2024

Conversation

t184256
Copy link
Collaborator

@t184256 t184256 commented Jul 5, 2024

(sorry, there will be a CI failure in test_channels_uiautomator because a warning pushes success message off-screen. will deal with it tomorrow) fixed

@t184256 t184256 requested a review from Gerschtli July 6, 2024 20:06
@t184256 t184256 changed the title modules/android-integration: add am command modules/android-integration: add am command and many termux-tools ones Jul 6, 2024
Provide an `am` (activity manager) command.
Is not guaranteed to be a real deal, could be of limited compatibility
with real `am` (like `termux-am`).
'';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is phrased weirdly, the "is not garunteed/could be" language is unnecessary. A link to more details on the limitations would be great (if they exist). I would suggest:

Provide an `am` (activity manager) command.
It is not the real deal, and has limited capabilities compared to the real `am`, similar to `termux-am`. See [here](insert link here) for more details.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thing is, I'm not well-versed in Android and don't know its exact limitations. It's very different from the real deal in /system/bin/am, which is a shell wrapper against some java thing, in that it sends the command-line over a socket and something in Termux app handles that. The help message is very different, I wouldn't be surprised if it had different error reporting or differed in exit codes, etc., etc., but I don't know the exact details. All I know it's the best am we can currently have because it works.

--replace @TERMUX_APP_PACKAGE@ com.termux.nix
substituteInPlace scripts/termux-reload-settings.in \
--replace @TERMUX_APP_PACKAGE@ com.termux.nix
${gnused}/bin/sed -i 's|^am |${termux-am}/bin/am |' scripts/*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use substituteInPlace above but gnused here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because substituteInPlace is the recommended Nix way, being more explicit and less surprising and everything...

... and then there are 6 calls to am that need to be patched to use the real path, but you can't just replace all am, it has to be at the beginning of the line, so I whip up a sed and use a regexp.

@t184256 t184256 merged commit e0216d3 into master Jul 7, 2024
22 checks passed
@t184256
Copy link
Collaborator Author

t184256 commented Jul 7, 2024

Thank you both for the reviews!

@t184256 t184256 deleted the android-integration branch July 7, 2024 23:43
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.

3 participants