-
Notifications
You must be signed in to change notification settings - Fork 260
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
FEAT: Async Shell Script Execution whenever Sketchware Starts #538
Conversation
currently only for root users
currently only for root users
currently only for root users
currently only for root users
Setting is in Mod Settings, by default it is turned off. Root and non-root users can use this script. Must manually create the script in root of Internal Storage. Name file sketchwarescript.sh |
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.
There's a few things that I think should be addressed, though I don't see this feature be useful for many people. Don't automatization apps already provide app launches as triggers? For example, Automate already has such a thing.
AsyncTask.execute(() -> { | ||
if (ConfigActivity.isSettingEnabled(ConfigActivity.SETTING_EXECUTE_SHELL_SCRIPT)) { | ||
try { | ||
Runtime.getRuntime().exec("sh /sdcard/sketchwarescript.sh"); |
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.
Would a file at the root of Internal storage really be a good idea? I'd say put it into /Internal storage/.sketchware/ or /Internal storage/sketchware/ at least.
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.
this was actually where i had it in my last uodate but i had to do a revert so yes ill update that
try { | ||
Runtime.getRuntime().exec("sh /sdcard/sketchwarescript.sh"); | ||
} catch (Exception e) { | ||
System.out.println("Error " + e.getMessage()); |
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.
Maybe make it show a toast or at least an entry in debug.txt, no average user's gonna be looking in logcat for script errors.
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.
i tried doing a toast but it never showed up after i made this asynchronous. maybe you know a solution?
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.
Sounds like a thread issue. UI things like toasts can only happen on the main/UI thread, and since AsyncTasks run in a new thread, try using runOnUiThread(Runnable)
to display a toast.
public static final String SETTING_BLOCKMANAGER_DIRECTORY_PALETTE_FILE_PATH = "palletteDir"; | ||
public static final String SETTING_BLOCKMANAGER_DIRECTORY_PALETTE_FILE_PATH = "paletteDir"; |
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.
Why? This will only break compatibility with older Sketchware Pro versions.
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.
the pallete part ill change it back lol i just thought it was a spelling error sorry
It's been almost a year now. @1tsMeMario will you make any changes to this pull request anytime soon? |
|
yall never wanted to approve it, thats on yall. i gave up on it on the
public end and just improved it on my end only.
…On Fri, Aug 11, 2023, 5:08 PM Javkhlan K. ***@***.***> wrote:
It's been almost a year now. @ 1tsMeMario will you make any changes to
this pull request anytime soon?
though I don't see this feature be useful for many people. Don't
automatization apps already provide app launches as triggers? For example,
Automate already has such a thing.
—
Reply to this email directly, view it on GitHub
<#538 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2UGZKA56WW73HURHQXI5DXU2UODANCNFSM56RDRDTA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@1tsMeMario As long as this pull request is active, we're still waiting for your changes. We love people who contribute to making Sketchware Pro even better. However, any contribution must be thoroughly reviewed before merging it to make sure it won't affect our users. You know, they have projects that must stay safe and we're responsible for that. The last thing you said is "the pallete part ill change it back lol i just thought it was a spelling error sorry". So, we're waiting for your change to merge this pull request. You didn't even get back to us about this pull request. We would have clarified what is wrong/should be done. Again, we're waiting for your changes, and why not some new awesome contributions in the future? Thanks for the time you've spent contributing to Sketchware Pro. |
Run a custom shell script whenever you start sketchware. Can be used for restoration or backup purposes or if you are advanced in shell scripting then whatever you can think of.