[Q] any app to increase thread priority? - Android Software/Hacking General [Developers Only]

by default android seems to royally suck at it. i'm hoping for a way to force android to give all available resources to the active app? to me it seems like common sense but it seems that everything is ran on an average priority which means whatever i'm doing is battling it out with random other things in the background whereas the active app (the one i'm using) is more important than anything else android is doing.

It was one of the root-required task managers on the market... It allowed you to increase some number that might have been priority-related, but that's all I remember. Hopefully those hints will give you something to look for.
Sent from my Wildfire S

Just use zeppelinrox's V6-turbocharger and the "bulletproof" tweaks, you'll have to do it manually for each app you want to stick around, but it works like a charm. And it's free, unlike the Market apps...

hmm, any idea for the market app?
Searched around the bulletprof, but its a little difficult

Why not use "htop"?
With a rooted phone & terminal emulator & hackers keyboard this is not a problem
The only difficulty is to find the right process - they are all named app_(?) (or similar).
But if the process really needs the whole system resources you could easily identify it!

Yup, all it takes is :
-a rooted phone (you need it to modify the system settings)
- a terminal emulator [any one will do. I use Better Terminal Emulator but it's the Rolls Royce of terminals, because I spend quite a lot of time scripting with the BASH shell, so a good terminal is mandatory for comfort of use ]
- a little knowledge of shell (all you need to know is how to open the terminal, the "su" command to switch to superuser mode, "top" to see which are the running processes, "echo" to send the value into the required variable, and "kill" to kill a running process if need be), not really rocket science...
Now if you insist on using an app (that's probably not free), be my guest..
But don't ask me which one to use, because I ain't got a friggin' clue about that..

Related

Root access file manager

I have Astro and Linda file manager, but they won't let me access the folders on my phone. Do I not have them set correctly, or do they just not let you get into the directories on the phone? Would be easier to go poking around instead of doing lots of cd ./folder and ls to see, and so on. wish i couldadd Astro to the superuser whitelist if that is all you have to do.
Shaggy
I asked the same thing, and got flamed saying I shouldn't be allowed to have root access.
I did some research on this, because I was trying to see if there was an easy way to launch an apk as su. As far as I can tell, when launching an apk, as soon as zygote takes over, and creates the vm process it applies predefined permissions to the running process. I don't know if these permissions can be changed by the devs, but apparently the ASTRO dev didn't really want to make a root version.
I do know, however, that if the application uses console commands, that the developer can prefix commands with su to all the program to have root access from inside the app's vm.
Would also like to know how to do this- with a GUI interface file browser such as these, it would be MUCH easier to navigate and figure out where specific files are located.
I'm glad I'm not the only one that prefers a GUI over typing tons of commands on a little keyboard. Even worse trying to read that little font, plus my screen has many spider web cracks in it, making it a pain in the ass to read.
Shaggy
Shagman68 said:
I'm glad I'm not the only one that prefers a GUI over typing tons of commands on a little keyboard. Even worse trying to read that little font, plus my screen has many spider web cracks in it, making it a pain in the ass to read.
Shaggy
Click to expand...
Click to collapse
There is an option to make the font size larger-- press Menu and hit Font Size, then click whatever size you want
I prefer command line over GUI in most cases, but here a file manager would make life a lot easier. The keyboard is just a pain to type .'s and /'s in. For file deletion etc a gui would be easier.
Darkrift said:
I prefer command line over GUI in most cases, but here a file manager would make life a lot easier. The keyboard is just a pain to type .'s and /'s in. For file deletion etc a gui would be easier.
Click to expand...
Click to collapse
Yea! I love a blinking cursor, #, or $ as much as the next *nix sysadmin, but seriously, I wipe my phone quite frequently, and everytime I do, I either have to fire up adb shell (I work a lot and when I get home the last thing I want to do is sit behind a computer again) or terminal emulator (annoying with small keyboard) to delete the crap apps that come stock on the different builds...although when I get around to it I'm just going to figure out how to make my own update.zip

Android Fork Bomb

Just out of curiosity does anyone know if any android devices can be affected by a fork bomb sent via text or email?
It is Linux so I'm guessing it will be affected. Maybe it won't be like OMG but it will be some what affected.
If a text or email could execute a custom script on being received, there is probably a lot worse that it could do than a fork bomb... Might be possible to get two views to keep calling each other, in which case the bundle for that program will expand until it runs out of memory and android will kill the app. This is very much an app specific bug though, and isn't related to the "fork bomb" of a program making a new instance of itself.
I thought Android runs on the sandbox environment for applications, which means the app can't execute much permissions as compared to Windows.
Just my $0.02
Yes, the apps are sandboxed for the most part.
Now that I think on it, there is a launch flag to open a new instance of a program leaving any currently running ones alone, which could be used to make a forkbomb. In this case, it would not be stopped by memory as the earlier instances will shut down but the exponentially increasing new instances will keep going, probably making the phone unusable until a reboot.
This can only be done by compiling and launching a signed app though, no email client can do this unless it has a backdoor to trigger this code from itself or from a trojan-esque feature to download, install, and launch apps on its own. The user would be promted to ok the new app's permissions anyway, unless it uses and gets permission for root access.
Basically, forkbombs are possible, but not by email or text with stock or nonmalacious programs.
Task Management
If the script gained root access, it'd be just the same as on a Linux machine. But I believe the DalvikVM simply kills any apps/processes it needs to in order to keep the system running smoothly (in theory).
well it works...
https://github.com/nicandris/com.example.forkbomb

Linux guy buys first android device

Hi folks,
I'm relatively new to XDA and similarly new to smartphones. My old dumbphone broke down and finally got an android device, samsung galaxy note, I really liked the huge screen.
I've been using linux for 2 decades now and chose an android device because everyone was telling me how it is linux-based which sounded like a good selling point. I'm quite pleased actually but have a few questions all of them related to my expectations that the OS will be linux-like:
1. I've been reading about rooting the phone and the like, but nobody explained the basics: why is it a special procedure to root the phone, why isn't it simply multi-user like any desktop linux? You could log in like a normal user or like root and that would be it. I guess there are serious reasons for the current design but it certainly doesn't seem natural at all.
2. In linux I can always figure out what the UI does in terms of the command line, so for instance if I use something on the UI (click an icon or bring up a menu) I can almost always do the same from the command line. This way I really know what's going on and if needed I can customize things. Case in point: right now I have to tap the phone a couple of times until I get to the broadband data transfer ON/OFF switch. It would be really neat to have an icon on the home screen that would do this. But I can't figure out what "command" needs to get executed to bring up the data transfer ON/OFF switch, so I really don't know how to create such an icon. This is just an example, I could come up with others easily, stuff I'd like to do, but can't figure out what happens under the hood. And it seems people create all sorts of simple trivial apps for these kinds of simple trivial tasks, when it should be possible to hack something up really fast. Any pointers on how to see what a UI interaction does and how to replicate it in a slightly different context? For example the broadband data transfer ON/OFF switch on the home screen?
3. I'm missing bash and top, ping, kill, cat, ls, etc, etc, Is there such a thing? (I already found connectbot but it would be nice to have scp and ssh inside a shell).
4. On my linux notebook I have a bunch of ad servers in /etc/hosts redirected somewhere else so they don't consume my bandwidth and don't clutter the webpage I'm trying to read. Can I have something similar on the phone? Is there something like an editor? I normally use vi, would be great to have that on the phone.
5. What controls the startup applications on boot? There are a bunch of stuff I bet I don't need but can't tell the phone to not start them. I guess I need to "root" the phone for this, but see question 1 Something related, I heard it's not possible to delete the factory installed bloatware without "rooting" the phone, is that true?
I guess that's it if anyone would make me feel as at home on the android phone as I feel at home on a linux desktop/notebook/etc I would be really grateful!
Cheers,
Daniel
1) Because the phone manufacturers lock Avg. Joe out of the system files to keep them from doing potential harm to the software. It saves your carrier millions per year in technical support costs.
2) Hold your finger down on an open section of the homescreen to open up a menu that will allow you to create shortcuts to important commands. You may also wish to install a custom Launcher that has more customizable features compared to whatever stock Launcher your carrier put on it.
Addendum: Root your phone, then install "Terminal Emulator" from the Play Store. Type in "su" and you'll then have superuser access to your phone's command line. From that point, it's pretty much exactly what you'd expect from Linux.
3) See Addendum to 2.
4) You could do it yourself, or let others do it for you. Root your phone, then install "AdFree" from the Play Store. Set up AdFree to automatically update and you're good to go.
5) 2 ways to get rid of bloatware, either root and use the Terminal to delete it yourself, or root and install a custom ROM that already has it removed. I highly, highly suggest rooting and switching to Cyanogenmod 9 as soon as possible. Go to your phone's specific forum on this site for instructions for practically everything you could ever want to do with your phone.
Note to 5: Your carrier sticks its bloatware into your system files, instead of in your user accessible app data. To change system files in any way, you'll need root access to your phone.
Here's a link to the development section for the Galaxy Note, please read all the rules and very thoroughly read all instructions before actually doing anything to change your device in any way:
http://forum.xda-developers.com/forumdisplay.php?f=1349
sreza said:
1) Because the phone manufacturers lock Avg. Joe out of the system files to keep them from doing potential harm to the software. It saves your carrier millions per year in technical support costs.
Click to expand...
Click to collapse
I see, makes some sense for them, but I'm wondering if Microsoft can afford to have an Administrator account exist on Windows, why can't android be shipped that way (rhetorical question).
Addendum: Root your phone, then install "Terminal Emulator" from the Play Store. Type in "su" and you'll then have superuser access to your phone's command line. From that point, it's pretty much exactly what you'd expect from Linux.
Click to expand...
Click to collapse
Looks like this is what I have to do
I highly, highly suggest rooting and switching to Cyanogenmod 9 as soon as possible.
Click to expand...
Click to collapse
On the cyanogenmod website I don't see samsung galaxy note listed as a supported device.
http://forum.xda-developers.com/forumdisplay.php?f=1349
Click to expand...
Click to collapse
Thanks, this is very helpful.
Another n00b question: how the hell does one quit the default browser? It looks like there is no way to close the last remaining window.
fetchinson said:
I see, makes some sense for them, but I'm wondering if Microsoft can afford to have an Administrator account exist on Windows, why can't android be shipped that way (rhetorical question)
On the cyanogenmod website I don't see samsung galaxy note listed as a supported device.
Another n00b question: how the hell does one quit the default browser? It looks like there is no way to close the last remaining window.
Click to expand...
Click to collapse
Because Windows can't afford to alienate power users by locking down their system. If they did, they'd be Apple. Also, remember that it's not Google that's locking you out of root, it's the phone manufacturer/carrier; which aren't exactly known for being bastions of ethics...
Windows is actually starting to lock you out of functions with Windows 8, the ARM version of Win8 can't sideload applications.
Cyanogenmod might not be officially supported for the Note, but there's probably a few devs on the Note's forum that are unofficially making a port. Try this ROM:
http://forum.xda-developers.com/showthread.php?t=1552554
There is a way to close the final window if you go into the browser menu and close it, but it's really not necessary. Android will auto-close old background tasks if you start to run low on memory. You may also want to look into downloading a different browser from the Play Store. I've never bothered, but I've heard good words about Opera Mobile. Dolphin HD is absurdly popular, but at it's heart it's basically the stock browser reskined, which offends my sensibilities, lol.
Also, if you're on ATT, you may want to check out these instructions on how to get unlimited data on smartphones for $15 per month:
http://forum.xda-developers.com/showthread.php?t=1446373
Thanks for all the useful info!
While looking further around on the phone I stumbled upon another thing which would be quite trivial on ordinary linux: how do I see the creation/acces/modification times for any file? I've installed Terminal Emulator from github, "ls" works, but not "ls -al".
Also, how do I check if there is any network access at all or if an application tries to access the network or not? On linux I would run the program though strace and that would show me all system calls so I would see what the application is up to. For instance the S Note application (it's a samsung note taking application for the Note) takes a long time when I save a note, which makes me think maybe it wants to sync the file to a samsung cloud service or something like that. How do I check what takes so long for this app, in particular if it wants to access the network or just plain slow?
fetchinson said:
Thanks for all the useful info!
While looking further around on the phone I stumbled upon another thing which would be quite trivial on ordinary linux: how do I see the creation/acces/modification times for any file? I've installed Terminal Emulator from github, "ls" works, but not "ls -al".
Click to expand...
Click to collapse
With the terminal, I'm not sure, but you could download one of many file managers from the Play Store and view the files' properties through that.
Edit: I have Terminal Emulator from the Play Store, and "ls -al" works fine for me (see screenshot). I'm also using Bash for my shell, so that could be it. Also, see about Busybox below.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Also, how do I check if there is any network access at all or if an application tries to access the network or not? On linux I would run the program though strace and that would show me all system calls so I would see what the application is up to. For instance the S Note application (it's a samsung note taking application for the Note) takes a long time when I save a note, which makes me think maybe it wants to sync the file to a samsung cloud service or something like that. How do I check what takes so long for this app, in particular if it wants to access the network or just plain slow?
Click to expand...
Click to collapse
You can probably find an app in the Play Store with that functionality. Wireshark is in there, so I'm sure something like strace has been done.
Also, look into installing Busybox from the Play Store. It provides a lot of the normal Linux terminal commands you might be missing.
EndlessDissent said:
Edit: I have Terminal Emulator from the Play Store, and "ls -al" works fine for me (see screenshot). I'm also using Bash for my shell, so that could be it.
Click to expand...
Click to collapse
Sweet! So how did you get Bash? Is it something working together with Terminal Emulator or a separate application (whatever the appropriate android lingo is )? If I search the play store for "bash" I don't really get anything resembling a shell, but probably I'm just overlooking something obvious. Installing this would be a great start.
EndlessDissent said:
Also, look into installing Busybox from the Play Store. It provides a lot of the normal Linux terminal commands you might be missing.
Click to expand...
Click to collapse
Thanks, this looks great too!
Going the Other way
Hi
Android and it UI's is not like any X11 based desktop, but buying an android devices is what got me into using linux as my main desktop and I tend to think as them as one and them same at a command line level at least.
If you comfortable with building from source you can cross compile any tools you are missing.
They numerous time saving widgets and the like on google play. i.e wifi toggling which sit right on your main screen.
You'll find that most utilities and useful stuff has been ported to android.
If you want to use vim I would download "terminal ide" which is an IDE which runs on android, if your familiar with java you can create application directly on the devices
it also contains bash, busybox and more.
Busybox is a multicall binary. Androids native one is called toolbox and can be found in /system/bin. If you want to port your favourite bash scripts over then there's script managers which will run scripts at startup etc.
Obviously with these optimized binary all the help and in the case of android toolbox, any command not need by the system is general left out. It's not meant for as a general purpose shell.
Trivia: splitting up you parameters when using toolbox can sometime help e.g "ls -l -a" works where as "ls -al" didn't
You can remount the root and /system as read writable, a man of twenty years linux doesn't need the dangers of that explaining.
There's a plethora of Root tools for removing system packages and general tweaking, google play is you friend in this case.
If the android UI really does not live up to your expectations than you always install Ubuntu.
When you rooted your device and unlocked you bootloader and basically voided any manufacturers warrenty (not something I care about, but I t seems important to some people ) that came with the device you just got a computer with a different cpu architecture, so the opportunities are limitless with what you can do with it
Have Fun!
T

[Q] Improving Android with Package Manager & more.

Hey!
I own a Samsung S3 i9300 for about an year and used it with the vendors operating system. As i have some spare time at the moment, i want to invest some of it in improving my phone.
In the last three days i tried "slimbean" (www.slimroms.net/‎) and CyanogenMod (http://www.cyanogenmod.org/).
I have gained some experience with GNU/Linux especially Arch (i really appreciate the philosophy of Arch) and Openwrt over the years, but Android is mostly unknown to me.
With this in mind, i do not feel very comfortable on my phone, as it (from my point of view) tries to hide whats going on. What i saw so far (stock, slimbean & cm) they show me shiny GUI's but i have no way to understand whats really going on.
For instance configuration: Until now, i only saw graphical frontends for configuring my phone. Is there something like a /config dir (as in openwrt) where i get an overview?
Second example: Until now, i have not seen an easy to understand command line tool for package managing.
What i want:
Find people who miss similar stuff on their phones as i do. May you have already made some discoveries/have recommendations for me and i for myself can post my "discoveries".
The first steps:
1) to have no propietary stuff on my phone
2) one can use a phone without a google-account
3) to have a serious package manager (as on a desktop linux system), which i can use on a console (pacman, opkg).
4) having an home dir where all the personal data is saved in the same place
My ideal:
-A secure operating system for a phone
-An easy-to-understand user management
-to have a versatile package manager and repository
-rolling release
What i did so far:
3) As an alternative to the google play store i found Fdroid (https://f-droid.org/). Fdroid comes my ideal closer, but i still have no way to use it with command line and some important tools command line tools are missing. Next, came to BotBrew (botbrew.com/) but atm it doesnt work on my device...
And i seriously need sshfs on my phone. Is there a package manager which is able to compile packages?
For the rolling release thing i found on xda-developers two related, but unanswered posts:
http://forum.xda-developers.com/showthread.php?t=1807061
http://forum.xda-developers.com/showthread.php?t=2281413

App for automated processes? (Navigate through other apps, fill in text fields, ...)

Hi Guys,
I'm currently looking for a possibly very special app and can't find anything but the usual suspects like Tasker that don't seem to meet my requirements.
I'm looking for an automation app that allows me to navigate in apps, fill in text fields, if possible, transfer predefined data into the text fields for each run and wait for text to be entered at certain points.
For a better explanation:
I would like to test 2 apps and their behavior. Reset smartphones should be used for this. The automation app should run through the following steps:
- Step 1: The app creates an account with Gmail. As soon as the SMS code has been requested, the app should interrupt so that I can enter the SMS code. After confirmation, the app should continue to go through its routine.
- Step 2: Another app is to be opened that has a longer waiting time before it starts. Then text fields should again be filled in with predefined data.
- Step 3: Finally, the app should go to the settings and delete the G-Mail account.
I don't care how the whole thing is realized. Either macro recording again or using symbols as with Tasker. The main thing is that it works properly. I am not familiar with such an app. Just such simple apps as Tasker that work with if and while and are not sufficient for my purposes.
Otherwise, I had the idea to use Python to implement my dream routine. A few days ago I discovered a Python SDK for Android. If I understand correctly, the SDK is based on Python 3. I just can't estimate how well the programming is going or whether scripts can be executed 1: 1 as on the PC. What do you all mean? Do you know of an app that meets my expectations or should I deal directly with the Python method?
Nobody has an idea? Or is my text not understandable?
I know you said no "Tasker" like apps, but this app called Automate can definitely achieve what you outlined without any other apps (or with them). You only need android 7 or above and These function blocks:
The app uses a flowchart logical system (essentially the basis of all programming languages) and can even execute shell scripts with/without root privileges. You can also install Termux (a terminal emulator) and use the command:
Code:
pkg install python
To install python3.7, from there the world is in your hands, provided you have sufficient java/kotlin knowledge and an understanding for android processes.
Also please tick the check mark next to my answer if I solved your question, so that others can find the solution.
Thank you Slim K. Automate looks good at the first look. I'll give that app a chance and otherwise test thy python way with termux.
If there are other ways to solve the problem, let me know.

Categories

Resources