Closed spotlightishere closed 7 years ago
Since this prints error traces to console, maybe it should print results that are too long to console as well. Alternatively, it could upload a txt file with the results
After messing around with the command for a bit, I found out that Runtime.getRuntime().exec
halts the program if anything is sent to stderr for the error's InputStream to be read. Instead of finding some way to incorporate the two, I switched to using ProcessBuilder instead.
See also, https://stackoverflow.com/a/23878137/3874884
(Also, I added in outputting to console. Uploading a file wouldn't be fun as we'd have to check permissions and blek.)
What about instead of uploading a file it just posts to pastebin or something like that? Would there have to be a perm check for the file upload? Wouldn't it just fail silently?
Doing pastebin could work indeed, though we'd have to bring up an API and even then I'd rather use Ghostbin (or a user might want to use Hastebin, etc). If jag wants it I could add it, otherwise output to the console is good for now.
Or writting it to a .txt file and uploading it to Discord?
El ago 13, 2017 6:59 PM, "Spotlight" notifications@github.com escribió:
Doing pastebin could work indeed, though we'd have to bring up an API and even then I'd rather use Ghostbin for that point. If jag wants it I could add it, otherwise output to the console is good for now.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jagrosh/Selfbot/pull/41#issuecomment-322075717, or mute the thread https://github.com/notifications/unsubscribe-auth/AI2CdddNnBiPFR7mqpc5LF1GO8JJ5EpNks5sX43OgaJpZM4OgpMK .
Yeah the text file sounds fine, he just said it'd be a pain because of upload perms.
On Sun, Aug 13, 2017 at 11:14 PM, Artuto notifications@github.com wrote:
Or writting it to a .txt file and uploading it to Discord?
El ago 13, 2017 6:59 PM, "Spotlight" notifications@github.com escribió:
Doing pastebin could work indeed, though we'd have to bring up an API and even then I'd rather use Ghostbin for that point. If jag wants it I could add it, otherwise output to the console is good for now.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jagrosh/Selfbot/pull/41#issuecomment-322075717, or mute the thread https://github.com/notifications/unsubscribe-auth/ AI2CdddNnBiPFR7mqpc5LF1GO8JJ5EpNks5sX43OgaJpZM4OgpMK
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jagrosh/Selfbot/pull/41#issuecomment-322096264, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTY8Pnr0Rn6PkEwbtwQGTr1C3OFtsTsks5sX8m2gaJpZM4OgpMK .
-- Yours Truly, Alexander Wallen
Gonna merge this now, might be a good idea to add the txt file upload at some point in the future though
This PR would fix #38 if merged. It outputs the command in a similar format to eval (saying both input and output) but has a major drawback.
It would appear that
Runtime.getRuntime().exec
has issues with relative commands. For example, you're unable tobash ls -l ~
but you're able tobash ls /home/spotlight
, which I find odd. I have no idea what the issue is and it would appear that Google doesn't either.Special thanks to @ArtutoGamer for helping me out with this as well. This PR is 10000x better than #39 😅