Skip to content

Conversation

@jredrejo
Copy link
Member

@jredrejo jredrejo commented Aug 30, 2023

With the latest changes in the android build, remoteshell does not start by default when the app is started.
This PR creates the needed intent to start remoteshell using an adb command.

When using an intent, the start method of the service is not called, the onStartCommand is called directly in the service lifecycle. For this reason this method has been overriden in the ServiceRemoteShell.java file. If we don't call the service anymore from the android app using startservice we could remove most of the code that handles the start, only the onStartCommand method would be needed.

In order to start the shell:
adb shell am startservice -n org.learningequality.Kolibri/org.learningequality.Kolibri.ServiceRemoteshell -a org.learningequality.Kolibri.START_REMOTESHELL

to stop it:
adb shell am stopservice -n org.learningequality.Kolibri/org.learningequality.Kolibri.ServiceRemoteshell -a org.learningequality.Kolibri.START_REMOTESHELL

Closes: #150

NOTE: If this is approved, https://github.com/learningequality/kolibri-provisioning-tools/blob/master/kolibri_provisioning_tools/clients.py must be modified to use this mechanism. Then #143 can be solved.

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

Tested locally, started the service with the intent, was able to gain shell access. Stopped the service, and could no longer access. Good to go!

@rtibbles rtibbles merged commit 8eaaf89 into develop Sep 12, 2023
@rtibbles rtibbles deleted the intent_for_remoteshell branch September 12, 2023 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No intent to launch remoteshell service

3 participants