-
Notifications
You must be signed in to change notification settings - Fork 159
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
ISSUE-576: Allow complex ADB server commands execution #597
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
32984da
ISSUE-576: Allow complex ADB server commands execution
Nikitae57 8b4ecbb
ISSUE-576: Introduce new constructors instead of separate types; chan…
Nikitae57 8ca3a8c
ISSUE-576: Update docs
Nikitae57 bbbe71c
ISSUE-576: Update adbserver-desktop.jar
Nikitae57 858bd99
ISSUE-576: Use single method
Nikitae57 329a5df
ISSUE-576: Deprecate methods
Nikitae57 3537b68
ISSUE-576: Update docs
Nikitae57 f3b688a
ISSUE-576: Add test
Nikitae57 87390fc
ISSUE-576: Update docs; fix perform adb
Nikitae57 4c78a17
Merge branch 'master' into ISSUE-576-Complex-adb-command
Nikitae57 faf482e
ISSUE-576: minor test refactoring
Nikitae57 d6ac80d
Merge branch 'master' into ISSUE-576-Complex-adb-command
Nikitae57 1c609a4
ISSUE-576: lint
Nikitae57 64e67c2
ISSUE-576: remove test log from adb-server binary; fix test on androi…
Nikitae57 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,7 @@ package com.kaspersky.adbserver.commandtypes | |
|
||
import com.kaspersky.adbserver.common.api.Command | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also reflect all these cases in tests? I mean testing a single command, a command with arguments and a command with commands in arguments (complex commands with pipes and etc.). |
||
|
||
data class AdbCommand(override val body: String) : Command(body) | ||
data class AdbCommand( | ||
override val command: String, | ||
override val arguments: List<String> = emptyList() | ||
) : Command(command, arguments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
build-logic/kotlin/src/main/kotlin/convention.kotlin-app.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import org.gradle.kotlin.dsl.application | ||
|
||
plugins { | ||
id("kotlin") | ||
id("convention.kotlin-base") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General feedback.
I guess we can use
Runtime::exec(String[] cmdarray)
instead ofRuntime::exec(String command)
inCmdCommandPerformer.perform
. Have a look atjava.lang.Runtime
, where both methods call the same method andcommand
param inRuntime::exec(String command)
is parsing into the array of strings.I don't support introducing separate classes like
ComplexAdbCommand
. I think we need to add the new constructors likeCommand(command: String, arguments: List<String>)
and the correspondent methods inAdbTerminal
and etc.I don't support syntaxis like
(command: List<String>)
and(command): String
. It's confusing. Also, the most popular syntaxis in these cases is(command: String, arguments: List<String>)
. Yes, another command is an argument of the main command. Cases likesh -c "adb shell dumpsys deviceidle | grep mForceIdle"
should be described in the documentation and examples.