Getting variables to python script?

Post your questions and help other users.

Moderator: Martin

Post Reply
hmast
Posts: 26
Joined: 17 Jan 2019 14:50

Getting variables to python script?

Post by hmast » 17 Jan 2019 18:37

How could I get Automagic to send variables to python script and vice versa?
Possible=ISeeAWay, Impossible=IDontSeeNow, ImpossibleButImportant=WeNeedToFindAWay

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Getting variables to python script?

Post by Desmanto » 18 Jan 2019 06:15

There is no action to run the python script. But we have the action to execute bash script (terminal emulator command). So, most likely you have to convert the script into automagic scripting. I am currently also studying the EFE exploit POC.py and converting it to Automagic scripting.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

hmast
Posts: 26
Joined: 17 Jan 2019 14:50

Re: Getting variables to python script?

Post by hmast » 18 Jan 2019 16:28

Umn, sounds good. Could you give quick example/tutorial as to how it could specifically be done?
Possible=ISeeAWay, Impossible=IDontSeeNow, ImpossibleButImportant=WeNeedToFindAWay

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Getting variables to python script?

Post by Desmanto » 18 Jan 2019 17:50

It is just some different syntax. For example at the python we have

Code: Select all

  if package != '':
        data = '{ "command":' + cmd + ', "appPackageName":' + package + ' }'
    else:
        data = '{ "command":' + cmd + ' }'
Then in Automagic, it will become

Code: Select all

if(package != '')
  data = '{ "command":' + cmd + ', "appPackageName":' + package + ' }'
else
  data = '{ "command":' + cmd + ' }'
It is just like switching from learning new language and syntax. But of course there are limitation and things you can or can't do in Automagic
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

hmast
Posts: 26
Joined: 17 Jan 2019 14:50

Re: Getting variables to python script?

Post by hmast » 18 Jan 2019 19:56

Cheers! By the way, just found this: https://www.reddit.com/r/tasker/comment ... l4a_tasks/

That plugin there, which Automagic can most likely use too, sounds rather promising.
Possible=ISeeAWay, Impossible=IDontSeeNow, ImpossibleButImportant=WeNeedToFindAWay

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Getting variables to python script?

Post by Desmanto » 19 Jan 2019 18:29

Oh, I don't know that it exists. Running a python script probably only to save some time from converting it. There are limits you can do with running python in plugin, the environment is most likely sandboxed only for those script only. But yeah, it can be done, that's more important.

BTW, I stop converting the python now, as the dev has patched out the app. So seems I am too late to exploit this to scare them to uninstall the shady app. :(
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply