Hot answers tagged

6

How about Chainfire's tool Pry-Fi which was announced over at XDA? It works great and it is available via the official Google play-store at: https://play.google.com/store/apps/details?id=eu.chainfire.pryfi Here’s a screenshot showing the tool in action…


6

Well it's obviously not #2, updates would not work so well if they could not update existing items. The script as a whole might do #1, but package_extract_* does #3. You can see the code here: https://android.googlesource.com/platform/bootable/recovery/+/7d0542f28045640dfab6a259ae7bd796e653d66f/updater/install.c


6

How much is the possibility that Android will kill my executable? Privileged native processes usually don't get killed by Android except if they can't handle an error occurred inside, such as some system resource not available or permission denied because of SELinux etc. To free up memory, Android only kills processes within its framework i.e. running under ...


5

/storage/emulated/0 is usually mounted in a way that prevents execution of programs from this location. Therefore even with a set executable bit for your script you won't be able to execute it directly. Of course you can still execute it via sh: /system/bin/sh /storage/emulated/0/test.sh Alternatively there is the directory /data/local/tmp which is ...


5

Android turns off some of CPUs and/or don't let apps use them when it's dozing. It's achieved through Linux kernel's Control Groups. One of the cgroups is cpuset that controls which CPU is assigned to which processes. Android creates multiple descendant cgroups in cpuset e.g. background, foreground, system-background, top-apps etc. Apps are normally in ...


4

Look to /etc/ directory. Usually it is placed in /system/ partition which you can mount as RW: $ ls -l /etc lrwxrwxrwx 1 root root 11 Jan 1 2009 /etc -> /system/etc $ su $ mount -o remount,rw /system $ chmod o+w /system/etc # for "adb push" Some above steps may be replaces with: $ adb root $ adb remount and later remount RO: $ chmod o-w /system/etc ...


4

Is there any specific command or script to be put on the flash drive, to acquire image of Android smartphone and store the acquired image to the flash drive On-The-Go? Nope. No special command or script is needed other than cat or dd, the binaries thankfully Android comes with. Often, the auto mount point of a flash drive is /mnt/usbotg (may differ for ...


4

It worked by just doing sh /mnt/sdcard/touch.sh & after having started a shell with adb shell. Then, when I closed the terminal forcibly while the process was in the background, the process remained running in the background of my phone as expected. I was able to kill the process later by getting with adb shell the using ps to find the process ID and ...


4

You can use this command: adb shell settings get secure location_providers_allowed Possible outcomes: returns nothing, implying the GPS is switched off. gps,wifi,network or gps,network -- High accuracy mode wifi,network or network only -- Battery saving mode gps -- Device only


4

Just pulling all files via adb to a WIndows computer has multiple problems: Android/Linux allows multiple files in one directory that just differ in their case. The file-system on Linux allow characters in file- and directory names that are disallowed on Windows Some file-names are completely disallowed on Windows which are just regular file-names on Linux/...


3

Is there a way to create an icon on the home screen that will launch one of these scripts? There is another way (other than this one) if you happen to use Terminal Emulator for Android app. It allows a widget which can be used to execute a script. Install that app, choose Term Shortcut widget in your current launcher. Corresponding to Arguments enter: sh ...


3

One thing I haven't seen mentioned yet is SL4A, the Scripting Layer for Android. This allows you run various types of scripts on your phone, Python scripts being one of them. Since SL4A isn't directly in the Play store, you may want something like QPython instead (which incorporates SL4A). Tasker, also mentioned by Izzy, has the ability to launch SL4A ...


3

Your SD card isn't prepared at the time that the bind command is executed, because the mounting process hasn't ended yet. To bind, you have to wait several seconds for the mounting of SD card & external SD to be finished. #!system/bin/sh sleep 10 n="$(dumpsys mount | grep -c 'external')" until [ $n -eq 1 ] do sleep 1 n="$(dumpsys ...


3

You could do that using e.g. Tasker, the mighty automation tool: Condition: Monitor Start (i.e., Tasker was started; alternatively: Device Boot, i.e. boot process finished) Task: Run Shell, with your command as parameter If you like it more fancy, you could even use Variable Randomize to generate a different MAC each time...


3

Many thanks to beeshyams. Here is a way to do what I wanted. This app allows to parse chosen content from any web page and use it as a widget. In order to have a Spreadsheets document as a web page one can publish it (File → Publish to the web...). The cells of interest can be linked from another page of this document (or even from another document) using ...


3

A great app for that is Automate. I've used it with great success. There are a few plugins that exist; you may or may not need them The main app is here Based on your use case, you may want this, this and maybe this extensions but it all depends on how you use the main app


3

The best one I've ever come across is Tasker. It isn't necessarily coding but you do get to script your tasks in a scratch fashion. Although I don't see how it might be different from Automate which is another great choice. Tasks created for tasker can also be download from the internet of which Tasker Wiki is my favourite source.


3

Source-reddit, which references Android documentation to DISABLE the h/w composer: adb shell service call SurfaceFlinger 1008 i32 1 to ENABLE the h/w composer: adb shell service call SurfaceFlinger 1008 i32 0 These need to be run as root and can be in a script or using the Termux Boot app as described in wiki For some reason, this works the opposite way ...


2

You might want to take a look at ScriptManager: Manage and execute shell scripts and programs in file system. All executions run over vt100 terminal accepting user input and esc codes (colors, bel, cursor movement ..) Run them at boot-up and/or on network status change possibility. Schedule at selected time. (cron jobs) Alternatively, Tasker can be ...


2

Adding extensions will solve this type of requirements. But Chrome for android does not support any extensions yet. Look at the Chrome for Android FAQ Or else you can use Dolphin Browser to achieve this. It supports extensions. If you are willing to use Dolphin Browser instead of Chrome, use this Auto Reload Extension. You can set time intervals in it.


2

If you have magisk installed you can place the .sh to: /sbin/.magisk/img/.core/service.d/ or to /sbin/.magisk/img/.core/post-fs-data.d/ Don't forget to make it executable: chmod +x your-script.sh. More info: https://github.com/topjohnwu/Magisk/blob/master/docs/guides.md#boot-scripts


2

I tried all these methods and none of them worked for me. What worked however was based on lord-ralf-adolf's answer here How to run a script on boot in CM12.1? basically, find the file /system/etc/install-recovery.sh and add the following line at the beginning /data/init.sh & then touch /data/init.sh chmod 755 /data/init.sh Done! You can now put ...


2

Copy a file (-p preserves permissions and ownership): run_program("/sbin/cp", "-p", "/system/framework/file-to-copy.apk", "/system/file-to-copy.apk"); Rename a file (-f forces overwriting the existing file): run_program("/sbin/mv", "-f", "/system/file-to-copy.apk", "/system/renamed-file.apk"); For reference, the syntax for Edify scripts (that's what they'...


2

In addition to the other answer with Tasker ("You could do that using e.g. Tasker, the mighty automation tool:"), here a little Task (description export) with randomizing the MAC: TestMacChanger (130) A1: Variable Set [ Name:%count To:0 Do Maths:On Append:Off ] <randomstart> A2: Variable Randomize [ Name:%random Min:0 Max:15 ] A3: ...


2

Wrong syntax :) adb shell "mount -o rw,remount /system" would do in your case (i.e. passing the command you want to run on the device to adb shell in double-quotes; the "exit" is not needed here as it is "implied"), provided your device's ADB daemon runs in root mode. You can even run multiple commands at once this way, e.g.: adb shell "mount -o rw,...


2

In your script you forgot # , and what is more the command to delete is not delete(as you wrote) but rm, along with at least one option: -r for recursive -f for force -v for verbose so try For a single file #!/system/bin/sh rm /path/to/file/filename.extension For a group of files @ location by extension with wildcard: #!/system/bin/sh rm /path/to/...


2

Matthew already pointed to tasker for this task (uh) – an app I already use for years. So let me add the steps to achieve this. Obviously, a pre-condition is the device is rooted – but the su command in the question tells me it is. So here we go: Condition: State › Net › WiFi Connected As parameter, include the SSID of your WiFi network, so it doesn't fire ...


2

The Reason for this failure is that Android blocked chroot for som reason. Like Death Mask Salesman pointed out, it is possible to get information about the command type via type commandName e.g. in this case type chroot. To solve the tmp-mksh: chroot: not found-error it is only required to install BusyBox.


2

I've just stumbled upon a project at Github, and remembered your question here. It seems like inception should perfectly fit your needs (except for the Google account, maybe, where it's a bad idea anyway to use the same one for all your employees). Quoting from the project description: Inception is a set of tools for auto configuring android devices. You ...


2

Processes receive signals from other processes or kernel as a warning or as a request to make some change in state. Receiving processes can block, ignore or catch signals, except SIGKILL which does what the name says. A process receives SIGHUP (hangup signal) when its controlling terminal (virtual or pseudo) disconnects or its controlling process (which is ...


Only top voted, non community-wiki answers of a minimum length are eligible