Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,733,661 Members 44,029 Now Online
XDA Developers Android and Mobile Development Forum

[FIX] Bulletproof Background Apps!

Tip us?
 
JPo_23
Old
#111  
Member
Thanks Meter 2
Posts: 48
Join Date: Dec 2005
Hi,

I want to do something a bit different from what has been discussed in most of this thread. I would like to prevent my satnav (Sygic) from being auto-killed. Currently I find that every time I minimize it for a few seconds it has to be fully re-initialized.

Obviously I do not want it running from boot, so I just need it bulletrproofed when I want to use it.

I've tried starting sygic and then switching to script manager, and running the following script:

PPID=$(pidof com.sygic.aura)
echo "-17" > /proc/$PPID/oom_adj

but I always get this output:

exec sh '/mnt/sdcard/sygic.sh'
# exec sh '/mnt/sdcard/sygic.sh'
/oom_adj: directory nonexistenteate /proc/18527

Is this because the app has already been killed?

Any ideas on how to get round this problem would be much appreciated.

Is there a way of running a script that will launch the app and bulletproof it straight away?

Or is there a better way of going about keeping this app alive?
 
zeppelinrox
Old
#112  
zeppelinrox's Avatar
Senior Member - OP
Thanks Meter 21059
Posts: 9,312
Join Date: Dec 2010
Location: IN THE FREAKIN' OP

 
DONATE TO ME
Quote:
Originally Posted by Moon Shadow - NM View Post
[EDIT]
I have figured out how to use cron to run jobs. If you are interested, I'll have a write up in a couple of days in the DX2 section.

Thanks!

Ciao!
[/EDIT]
That's cool.
I did find a way to have bulletproof apps script run from init.d automatically and have it NOT interfere with the boot process (sleep command just delays everything on some devices so that's useless) AND have it running in a loop once android loads in which it sleeps for 60 seconds and re-bulletproofs the hitlist.
I'm not sure which method has less overhead.
cron or sleep

However I think sleep is sufficient for this purpose because it runs at intervals.
If I needed it to be run at certain times or on certain days, cron is the way to go for sure.

Quote:
Originally Posted by JPo_23 View Post
Hi,

I want to do something a bit different from what has been discussed in most of this thread. I would like to prevent my satnav (Sygic) from being auto-killed. Currently I find that every time I minimize it for a few seconds it has to be fully re-initialized.

Obviously I do not want it running from boot, so I just need it bulletrproofed when I want to use it.

I've tried starting sygic and then switching to script manager, and running the following script:

PPID=$(pidof com.sygic.aura)
echo "-17" > /proc/$PPID/oom_adj

but I always get this output:

exec sh '/mnt/sdcard/sygic.sh'
# exec sh '/mnt/sdcard/sygic.sh'
/oom_adj: directory nonexistenteate /proc/18527

Is this because the app has already been killed?

Any ideas on how to get round this problem would be much appreciated.

Is there a way of running a script that will launch the app and bulletproof it straight away?

Or is there a better way of going about keeping this app alive?
Yeah I thought about having a way to run an app and bulletproof it right away.
I even had a name ready - Lock 'n Load... LOL
BUT with the method I found to launch an app from a script, the am start command, it is just too difficult to do because there is no universal command to launch any app.
However, you can add the am start to run sygic in your own script.
Here is an example of the am start to run battery history:
am start -n com.android.settings/.battery_history.BatteryHistory

However, if you just install V6 supercharger and enable the bulletproof apps and add sygic to the hitlist, it will automatically get bulletproofed after running it since the script runs at 60 second intervals.

The script will also apply the renice command
 
JPo_23
Old
#113  
Member
Thanks Meter 2
Posts: 48
Join Date: Dec 2005
Quote:
However, if you just install V6 supercharger and enable the bulletproof apps and add sygic to the hitlist, it will automatically get bulletproofed after running it since the script runs at 60 second intervals.

The script will also apply the renice command
Thanks. I had no idea that the script ran every 60 seconds, so that seems like a good approach, except that I can't add the program.

I run the supercharger script, select option 17, and it will only allow me to add running processes. I've tried switching straight from Sygic to the script, but it's always been killed before I get an opportunity to bulletproof it.

Is there some other way to add it? Do I need to manually edit something?
 
zeppelinrox
Old
#114  
zeppelinrox's Avatar
Senior Member - OP
Thanks Meter 21059
Posts: 9,312
Join Date: Dec 2010
Location: IN THE FREAKIN' OP

 
DONATE TO ME
Yeah bulletproof something so the Bulletproof Apps Hitlist file gets created (the script tells you where the file is) and just add sygic to the list
It doesn't even have to be the full process name since I used the pgrep command instead of pidof

You can also edit bulletproof app fine tuner so you can tweak app priorities up or down
 
drunkboi
Old
#115  
drunkboi's Avatar
Senior Member
Thanks Meter 76
Posts: 267
Join Date: Apr 2008
Location: Houston
I'm using gscript. Do I just need to do the setup once or how do I use properly? Thanks!
T-Mobile Note 3 (N900T)

Rom: Hyperdrive KK RLS2
Kernel: leanKernel v2.4

 
neverlost7
Old
(Last edited by neverlost7; 5th March 2012 at 06:35 PM.)
#116  
Junior Member
Thanks Meter 2
Posts: 20
Join Date: Nov 2011
I'm using the Supercharger script (the newest version) with a stock rom, and it has been loading at startup quite nicely. Today, I tried to bulletproof some apps and made the 97Bulletproof script run at the startup as well, but now the Supercharger script says that the 99Supercharger script wasn't run at startup, so the minfrees were not in effect. So can't I run two scripts at startup?

And another question: how to bulletproof the messaging app? I mean what is the name of the service I should bulletproof?
 
zeppelinrox
Old
#117  
zeppelinrox's Avatar
Senior Member - OP
Thanks Meter 21059
Posts: 9,312
Join Date: Dec 2010
Location: IN THE FREAKIN' OP

 
DONATE TO ME
Yeah script manager can load both on startup
sms app.. it depends on which app your using for sms
 
neverlost7
Old
#118  
Junior Member
Thanks Meter 2
Posts: 20
Join Date: Nov 2011
I'm using the stock sms app. What is the process I should bulletproof, then? And do you have any idea as to why ScriptManager won't run the 99 script if I configure it to run the 97 script on boot as well?
 
kizsleg
Old
#119  
kizsleg's Avatar
Senior Member
Thanks Meter 90
Posts: 358
Join Date: Nov 2011
Quote:
Originally Posted by neverlost7 View Post
I'm using the stock sms app. What is the process I should bulletproof, then? And do you have any idea as to why ScriptManager won't run the 99 script if I configure it to run the 97 script on boot as well?
Does a script that reloads every minute cost much power?
 
Jarmezrocks
Old
#120  
Jarmezrocks's Avatar
Senior Member
Thanks Meter 418
Posts: 910
Join Date: Mar 2011
Location: Gold Coast

 
DONATE TO ME
Quote:
Originally Posted by JPo_23 View Post
Thanks. I had no idea that the script ran every 60 seconds, so that seems like a good approach, except that I can't add the program.

I run the supercharger script, select option 17, and it will only allow me to add running processes. I've tried switching straight from Sygic to the script, but it's always been killed before I get an opportunity to bulletproof it.

Is there some other way to add it? Do I need to manually edit something?
Hey I know this is probably just a bizare thing and I am possibly totally stupid for thinking it, but app icons in the launcher are just like desktop shortcuts right? Could you not elect for an "installation protocol" for an elected group of apps that when installed that the shortcut is not linked direct to the app, but it is linked to a script. i.e. when you click the shortcut it executes the script and within that script it bullet proofs and then launches the app.

Like Links2SD allows a full take over of the installation proceedure when installing apps if you want it to. Say you boot your phone and for what ever reason disable the script to launch Links2SD (in init.d) then the app icons remain on the desktop/launcher, however when you click them it says "App not installed"....but I know for certain that the app IS installed. Essentially it is in a partition that is not mounted and visible.

I'll shut up now I have no idea what I am going on about nm I'm just rambling **** again

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes