FEAT: Added ROOT user features: AutoOpening, Slient Installing#511
FEAT: Added ROOT user features: AutoOpening, Slient Installing#511j-px merged 8 commits intoSketchware-Pro:mainfrom Maks-gaming:main
Conversation
- Auto-opening the application after installation - Silent installation without dialog boxes
|
If anything, I have placed the settings for enabling these options in the Mod menu |
j-px
left a comment
There was a problem hiding this comment.
Thanks for your contribution! Some changes would be good, but this feature in general seems great.
| DataOutputStream os = new DataOutputStream(p.getOutputStream()); | ||
| os.writeBytes("echo \"Do I have root?\" >/system/sd/temporary.txt\n"); |
There was a problem hiding this comment.
Did you test this out? Writing to a process' output stream seems suspicious. Also, what if /system was mounted read-only? That'd false-positively assume that root isn't available. Just checking if executing su works is enough imo.
There was a problem hiding this comment.
Maybe a library for checking for root access is better. I'm pretty sure there are some, maybe even by Magisk's developer. I'll check.
There was a problem hiding this comment.
This solution was found on StackOverflow, however I have tested it on 3 smartphones and it works
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| true); | ||
| addTextInputPreference("Grant ROOT access", | ||
| "Brings app-autoinstallation", v -> { | ||
| //TODO |
There was a problem hiding this comment.
what's to do here?
There should be a dialog here in case of an error, for example, if a person simply does not have a ROOT device
There was a problem hiding this comment.
Okay. I just noticed though, why is it a text input preference?
There was a problem hiding this comment.
Okay. I just noticed though, why is it a text input preference?
So, are there other options to open a dialog box with a ROOT request?
There was a problem hiding this comment.
As far as I know, the app managing root access opens a dialog asking the user if the app should be granted root access. Also, why make it a setting? The user could just allow root access when it's asked for, after building a project and trying to install the APK automatically.
There was a problem hiding this comment.
I hoped that it would be possible to turn this feature on or off, suddenly it would not work correctly for someone, or simply it would be unusual for a person to use it
There was a problem hiding this comment.
Then I think the setting should be changed to be a simple setting whether Sketchware Pro should (try to) auto-install APKs with root or not. If it fails after having built the APK, e.g. a Toast could be shown, and the installation be done with Package installer.
There was a problem hiding this comment.
I understand what you mean, I'll do it later, then I'll redo it in the draft for now
There was a problem hiding this comment.
That's fine! Thank you for your efforts.
|
I think John Wu's libsu should instead be used, its API looks clean and abstracts root access nicely: https://github.com/topjohnwu/libsu |
I think for the first time, while root is not much needed, the library is not needed |
I'd love to start seeing clean code in Sketchware Pro's codebase instead of hack-ish ways. Since it's also a Gradle project, adding a library's not hard anymore, and pretty easily manageable. |
Okay, I heard it, I'll redo it |
Added turn off script Added 2,5 sec sleeping before app auto-open
|
I'm working on decompiling com.besome.sketch.editor.manage.ManageCollectionActivity right now, so I'll merge it when I'm done. |
|
Hi, when is the merge? |
|
I'll get to this soon! |
Uh oh!
There was an error while loading. Please reload this page.