Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,807,597 Members 51,250 Now Online
XDA Developers Android and Mobile Development Forum

[TOOL][BOOT SCRIPTS] bse

Tip us?
 
r3pwn
Old
#1  
r3pwn's Avatar
Recognized Contributor - OP
Thanks Meter 1,098
Posts: 987
Join Date: Jul 2012
Default [TOOL][BOOT SCRIPTS] bse

Hello, all!

I have recently built a tool that allows users to more efficiently create and run scripts on boot.
These can be python scripts if you have python installed to your system (No, SL4A won't work. At least, not without some work). Usually though, they are bash or sh scripts.
They can be used to do various things, such as fix permissions every reboot, or things such as record a log of the time of every time you boot up your device, or other cool things.

I am currently looking into getting python packed into a flashable zip (lots of more fun with python scripts like showing a toast notification on boot).

To use bse's scripts executing feature, you must place the script you wish to execute under /system/etc/startup. You don't need to worry about chmodding it, there is an init script that does that already. For reference purposes, I recommend you read the contents of that init script (it's in /system/etc/startup).

To clarify, anyone who wants to build an automated installer for this, distribute some scripts, or distribute any modification to be, you have my full permission as long as you provide a link to this thread.

DOWNLOAD
https://docs.google.com/file/d/0Byul...p=docslist_api

INSTALLATION
- Just flash the zip file in the recovery of your choice


If you have any questions, feel free to ask. I'm sorry, this was written when I was tired (Not the program, the post)

Sent from my Nexus 7 using Tapatalk

Need help?
Hit me up on Twitter or Google+ or, you know, just send me a PM.

My Reddit:
r3pwn-dev

Like what I do?
Feel free to donate to my PayPal
The Following 10 Users Say Thank You to r3pwn For This Useful Post: [ Click to Expand ]
 
r3pwn
Old
(Last edited by r3pwn; 24th March 2014 at 01:30 AM.)
#2  
r3pwn's Avatar
Recognized Contributor - OP
Thanks Meter 1,098
Posts: 987
Join Date: Jul 2012
FAQ:
What does "bse" stand for?
If you were to run bse alone, you would see that it stands for "Boot Script Executer".

Is BSE open-sourced?
Almost. I lost the source code and I'm in the process of re-creating it from scratch.

Where is the open source repo?
It's at https://github.com/boot-script-executer. PM me with your Github email if you wish to contribute to BSE development or submit your bse scripts. (please tell me which one)


Sent from my Nexus 7 using Tapatalk

Need help?
Hit me up on Twitter or Google+ or, you know, just send me a PM.

My Reddit:
r3pwn-dev

Like what I do?
Feel free to donate to my PayPal
The Following 4 Users Say Thank You to r3pwn For This Useful Post: [ Click to Expand ]
 
Mohhamad Rehan
Old
#3  
Guest
Thanks Meter 241
Posts: 0
Join Date: Jan 1970
Can we have a github source of all the scripts so we can execute in the Roms and execute it in the android source
 
cybojenix
Old
(Last edited by cybojenix; 23rd March 2014 at 03:52 PM.)
#4  
cybojenix's Avatar
Recognized Developer
Thanks Meter 1,558
Posts: 825
Join Date: Apr 2012

 
DONATE TO ME
nice idea

how about adding in a log wrapper to forward all output to the logcat

note: this is untested, but it should work
Code:
function logger() {
    # args:
      # $1 = message - the message you want to show
      # $2 = priority - optional, defaults to i. the priority you want to give the log message
    export LOG="/system/bin/log"
    tag="BSE_LOGGER"
    message=${1}
    priority="i"
    if [[ $2 ]]
    then
        options="vdiwe"
        if test "${options#*$2}" == "$options"
        then
            $LOG -p "e" -t "$tag" "invalid priority level: $2"
        else
            priority=$2
        fi
    fi
    $LOG -p "$priority" -t "$tag" "$message"
}
examples:
Code:
logger "this is a random message"
# I/BSE_LOGGER(15836): this is a random message
logger "another random message" d
# D/BSE_LOGGER(17393): another random message
logger "this message should give an error" t
# E/BSE_LOGGER(17395): invalid priority level: t 
# I/BSE_LOGGER(17396): this message should give an error
Quote:
<cybojenix> Every single language makes sense. They're logical
<cybojenix> Then there's just Perl.
<helicopter88> perl just looks like an esotheric language
<cybojenix> Perl is what came out from those monkeys trying to recreate Shakespeare
<helicopter88> cybojenix, this is the wise sentence of the month

like my work? buy me a present
 

Proud member of TeamHackLG


contact me here
My Builds
P350 kernels: 2.6.35 | 3.0.x
Github
devices: p350 | e610 | Nexus 7 | tegra note 7

 
Maribou
Old
#5  
Maribou's Avatar
Senior Member
Thanks Meter 606
Posts: 534
Join Date: Nov 2012
Location: Oklahoma City
This is freaking awesome r3. Good job bro.
*Starts slow clapping. Waiting for other people to join in.* ☺

Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
Code:
Parable 1,595,277,641
Like the instar, tunneling to the surface\n
We must shed our own circumferences;\n
Find the divinity within and emerge.
 
Ricky Divjakovski
Old
#6  
Ricky Divjakovski's Avatar
Recognized Contributor
Thanks Meter 5,281
Posts: 3,592
Join Date: Feb 2013
Location: Sydney

 
DONATE TO ME
Quote:
Originally Posted by cybojenix View Post
 
nice idea

how about adding in a log wrapper to forward all output to the logcat

note: this is untested, but it should work
Code:
function logger() {
    # args:
      # $1 = message - the message you want to show
      # $2 = priority - optional, defaults to i. the priority you want to give the log message
    export LOG="/system/bin/log"
    tag="BSE_LOGGER"
    message=${1}
    priority="i"
    if [[ $2 ]]
    then
        options="vdiwe"
        if test "${options#*$2}" == "$options"
        then
            $LOG -p "e" -t "$tag" "invalid priority level: $2"
        else
            priority=$2
        fi
    fi
    $LOG -p "$priority" -t "$tag" "$message"
}
i like the thought of this!
Like my blog on facebook, add me to your circles, follow me on twitter or donate to me with paypal
The Following User Says Thank You to Ricky Divjakovski For This Useful Post: [ Click to Expand ]
 
eushaun99
Old
#8  
eushaun99's Avatar
Senior Member
Thanks Meter 885
Posts: 1,791
Join Date: Feb 2013
Location: Subang Jaya
Sorry if this sounds like a stupid question, but what's the difference between using init.d and your tool or even using script manager to run scripts at boot?

Sent from my GT-P7500 using Tapatalk
 
r3pwn
Old
#9  
r3pwn's Avatar
Recognized Contributor - OP
Thanks Meter 1,098
Posts: 987
Join Date: Jul 2012
Hehe. Funny story about this. All of its source code (There wasn't too much... Don't worry) was on my trusty (not really) old Kindle Fire HD, which I managed to brick. I will have to re-write the source (Again, I didn't really lose that much) and I'll make everything open-sourced (see 2nd post if you want to help contribute).



Quote:
Originally Posted by cybojenix View Post
nice idea ...
Thanks... I will try to see if I can implement that. If I have no sucess, you could try for yourself once I get everything re-written.

Need help?
Hit me up on Twitter or Google+ or, you know, just send me a PM.

My Reddit:
r3pwn-dev

Like what I do?
Feel free to donate to my PayPal
 
Ricky Divjakovski
Old
#10  
Ricky Divjakovski's Avatar
Recognized Contributor
Thanks Meter 5,281
Posts: 3,592
Join Date: Feb 2013
Location: Sydney

 
DONATE TO ME
Quote:
Originally Posted by eushaun99 View Post
Sorry if this sounds like a stupid question, but what's the difference between using init.d and your tool or even using script manager to run scripts at boot?

Sent from my GT-P7500 using Tapatalk
init.d triggered through the rom not the kernel, and it supports python scripts aswell
Like my blog on facebook, add me to your circles, follow me on twitter or donate to me with paypal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Android App Review: Control Your Phone with Quick Control Panel – XDA Developer TV

Your Android smart device has many features that you … more

Play Music on Android Wear with Stellio Music Player

Android Wear smartwatchesare growing inpopularity every day. Some devices have already … more

Schedule is up for xda:devcon ’14

With xda:devcon ’14 just around the corner, and the venue close to selling out, there is a lot … more

aLogcat Returns Thanks to XDA Love

The developers of Android, that is Google, gave users several great debugging tools that can be used in … more