How to auto-execute our own script? - Galaxy Ace S5830 General

Ok, so I have been using linux since long and I managed to write many scripts for my personal management, using crontabs for auto-execute etc. I also played with rc.local in linux. Fortunately It was all easy to find the relevant info whenever I want. But not with Android. I have been searching but no exact solution so far.
I want to know how to auto-execute script on start up? I have put script in /system/etc/init.d changed its permission to 755. Made chown to root, but Fail.
Also tried to use "Script Manager" but that force closes everytime. I switched to Cm7.2 Sedan yesterday and same case with this ROM too. (So I don't think Its a ROM related). This the same ROM Turbo-boost or other scripts works fine.. What is it that I'm missing here?

Afaik userinit script at /data/local/userinit.d

Rushyang said:
What is it that I'm missing here?
Click to expand...
Click to collapse
Since you're saying that other scripts get properly executed, than it must be your custom script itself, which poses some problems here? Btw, nobody is right in your head or is a visionary and able to give you some help, if you don't give some bits of code to tell, what might be basically wrong with it. ...
Just jump over to slaid's scripting threads. There are some hints and tips how to log and debug initd scripts. Or you can just strip from g_BonE's script the debugging code and apply it to your own script.
Happy scripting! ...
[xXx]
---------- Post added at 08:21 PM ---------- Previous post was at 08:15 PM ----------
As a matter of fact, iandol was so kind enough and did already strip the necessary code for you. ...
[xXx]

Related

[TOOL] Clean Tool for Mac OSX

All credits go to Scrosler, Nils, MrSmith, and everyone else. I took the Linux version of this tool and modified it to work on Mac OSX. The Linux version did not work for me, so I decided to fix up a Mac version and upload. It also has a special WiFi Tether install script I whipped up.
INSTALL THE MAC OSX ANDROID SDK BEFORE USING THIS!
Here are some links to get you started with the SDK.
http://developer.android.com/sdk/index.html
http://www.talkandroid.com/guides/de.../#.TuaS3lxjgSM
So now that you have the SDK installed...
1) Unzip Cleantool_Mac.zip
2) Open a command window, change directory into your Cleantool_Mac directory
3) Run ./cleantool.sh
Have fun
Cool! Good Job!
What exactly does this remove?
McFroger3 said:
What exactly does this remove?
Click to expand...
Click to collapse
Well, you can Temp Root, and then you are given the option to remove some bloat, all bloat, or VZW bloat, and you can also desense
dmeadows013 said:
http://www.talkandroid.com/guides/de.../#.TuaS3lxjgSM
Click to expand...
Click to collapse
Just to let you know this link redirects to
http://www.talkandroid.com/73163-dead-on-arrival-makes-its-way-to-the-android-market/#.TuaS3lxjgSM
McFroger3 said:
Just to let you know this link redirects to
http://www.talkandroid.com/73163-dead-on-arrival-makes-its-way-to-the-android-market/#.TuaS3lxjgSM
Click to expand...
Click to collapse
The link you quoted and in the OP goes to guides as I would assume were intended. Don't know how/why you would get to somewhere completely different.
MrSmith317 said:
The link you quoted and in the OP goes to guides as I would assume were intended. Don't know how/why you would get to somewhere completely different.
Click to expand...
Click to collapse
Worked fine for me too!
cant seem to get the command screen to accept my commands. Pretty much a nube when it comes to command screens and code, but if anyone could help lead me in the right direction, i'd appreciate it. I already have sdk installed and the cleantool zip unzipped. Just not sure where to go from here, as everything i've tried on the command screen has come back permission denied, or no such directory. Thanks in advance...
In terminal I get to a Password prompt?
Edit: Nevermind, just hit Enter. Doh!
---------- Post added at 03:04 PM ---------- Previous post was at 02:55 PM ----------
Do you have it for permanent root?
---------- Post added at 03:14 PM ---------- Previous post was at 03:04 PM ----------
How do we get permanent root on a mac?
Sorry, I just saw I somehow wrote that on my post above.
---------- Post added at 03:22 PM ---------- Previous post was at 03:14 PM ----------
jdaniels31 said:
cant seem to get the command screen to accept my commands. Pretty much a nube when it comes to command screens and code, but if anyone could help lead me in the right direction, i'd appreciate it. I already have sdk installed and the cleantool zip unzipped. Just not sure where to go from here, as everything i've tried on the command screen has come back permission denied, or no such directory. Thanks in advance...
Click to expand...
Click to collapse
1. In the Terminal app ( /Applications/Utilities )
type: cd (path to Cleantool_Mac folder - Easiest way to do this is to open a Finder window next to the Terminal window, navigate to the Clean folder in the Finder window and then drag the folder into the Terminal window. Make sure it has a space between the cd and the path.)
Example: cd /Users/username/Desktop/Clean_Mac
Hit Return or Enter
2. At the next prompt: Type: ./cleantool.sh
3. Select the Temp Root option then let it do it's thang and then select the Exit option.
Hope that helps.

[Q] supertux webtop and other games

Has anyone got any native linux games to run on webtop? Specifically supertux. I have managed to install it fine, however when I click on it, nothing happens.
sebbo90 said:
Has anyone got any native linux games to run on webtop? Specifically supertux. I have managed to install it fine, however when I click on it, nothing happens.
Click to expand...
Click to collapse
I've noticed that some stuff doesn't launch properly from shortcuts. Have you tried launching from a terminal prompt? There may be something crashy going on that gets hidden when launching from a menu/shortcut that you would be able to see in the terminal.
without sounding like an idiot how would you recommend doing it? I tried a method I found from google but to no avail
sebbo90 said:
without sounding like an idiot how would you recommend doing it? I tried a method I found from google but to no avail
Click to expand...
Click to collapse
I'll try to explain without sounding like an idiot.
Let me state my assumptions first: You've used webtop2sd and have a functional webtop with working lxterminal and synaptic.
1. Launch a terminal (using the launcher in the dock at the bottom or on the webtop-panel at the top). If you have a launcher somewhere else or are using XFCE or LXDE or something then you should probably know where your terminal launcher is.
2. type in "supertux" and see what happens. If you get a command not found error then it isn't in your PATH, you have to cd to usr/local/games and it's probably in there. Try running it from that directory.
I'm installing it right now to see what happens, I'll let you know what I find.
---------- Post added at 09:46 AM ---------- Previous post was at 09:30 AM ----------
Got it.
It gets installed to /usr/games, but that isn't in the default path so it doesn't get picked up wen you type "supertux" from a terminal. And that's why the .desktop file doesn't work, which is why the launcher doesn't work.
Easy solution: do this from a terminal:
Code:
./usr/games/supertux
The "right way" is to edit the path variable, I don't know where the best place to put this is, it's dependant on your setup, maybe in a .bashrc file:
Code:
export PATH=$PATH:/usr/games
See this: http://www.cyberciti.biz/faq/unix-linux-adding-path/
wow thankyou very much. That was very helpful Right found it and started it. Didnt realize it was called supertux2 which didnt help :facepalm:
Lol now it is throwing a glx error. I will have a look into this.

[Solved] CIFS loading fine but file transfer hangs & motorola photon reboot.

Hi, after several days seeking for cifs.ko/slow-work.ko finally i found the attached file the which loads fine and i can mount my network file share and explore it, but when i try copy or open video file the file load/transfer starts but after few seconds my photon reboot.
The rom is stock, kernel is 2.6.32.9 [[email protected] #2], rooted.
Is possible make some fix to those modules or at least know with log/debut what is failing?
thanks.
Edit: Go here for a working cifs.ko: http://forum.xda-developers.com/showthread.php?t=1895983
My best guess would be that you found a kernel module that "loads", but isn't compiled for your exact kernel. Once loaded it establishes the connection and you are able to browse files/folders. Once you start a transfer you utilize a different part of the module that doesn't jive 100%. That causes a memory leak/buffer overflow/kernel panic. Kernel panic = phone vomit -> phone warm reboot. Really need to have a module that was made for your specific kernel.
Could also be the app. Easiest way to tell if the app is the culprit is to mount the share manually in a terminal window. Then do a cp command from your mounted share to a local folder and see if it works that way.
Manually mounting a share in a terminal window will take a little *nix know-how, but shouldn't be that hard. I know how to do it, but I don't think I can teach you in a short timeframe if that makes sense.
---------- Post added at 01:34 AM ---------- Previous post was at 01:21 AM ----------
Did a 'strings' of the module and it looks like it is compiled for 2.6.32.9-00005-g2440aba *edit* that kernel is for the DX2. Looks close, but not for your exact kernel. Also the version of cifs.ko is 1.61 if that matters, compiled for arm7 platform.
I really don't think it will work right without compiling it against your current kernel source.
atroph said:
My best guess would be that you found a kernel module that "loads", but isn't compiled for your exact kernel. Once loaded it establishes the connection and you are able to browse files/folders. Once you start a transfer you utilize a different part of the module that doesn't jive 100%. That causes a memory leak/buffer overflow/kernel panic. Kernel panic = phone vomit -> phone warm reboot. Really need to have a module that was made for your specific kernel.
Could also be the app. Easiest way to tell if the app is the culprit is to mount the share manually in a terminal window. Then do a cp command from your mounted share to a local folder and see if it works that way.
Manually mounting a share in a terminal window will take a little *nix know-how, but shouldn't be that hard. I know how to do it, but I don't think I can teach you in a short timeframe if that makes sense.
---------- Post added at 01:34 AM ---------- Previous post was at 01:21 AM ----------
Did a 'strings' of the module and it looks like it is compiled for 2.6.32.9-00005-g2440aba *edit* that kernel is for the DX2. Looks close, but not for your exact kernel. Also the version of cifs.ko is 1.61 if that matters, compiled for arm7 platform.
I really don't think it will work right without compiling it against your current kernel source.
Click to expand...
Click to collapse
Is true... but i guess is not necessary test to mount something in command line because i tried two different apps and gave me same result.
If matters i check module with modprobe/hex editor and compare layout_info with any integrated module in my phone and it match.

[DEAD] Bash Shell Scripting

( Project repo has been deleted )
Have you seen Bash Guide for Beginners and Advanced Bash-Scripting Guide from tldp.org (google, I cannot post links yet)? I think they are excellent.
Cheers
Thanks mate for that !
How to get the tutorials:
Code:
git clone https://github.com/d0wngrade/d0.git
(This will download my entire 'd0' github repo, it's pretty empty right now.)
The tutorials are under the d0/Papers/xda_Bash/ directory.
Click to expand...
Click to collapse
Hi Where to type that code to download tutorials?
is it in android shell?
---------- Post added at 03:20 PM ---------- Previous post was at 03:15 PM ----------
SOLVED.
Just pasted it in internet browser
Should have just copy/pasted the tutorials on the thread. A little misleading if you ask me...
Hi, I wrote a simple .sh file to batch install apps from sdcard.
What I did was I copied the same terminal commands to a inst.sh file and tried to execute the script from shell
using following commands
SU
sh /sdcard/inst.sh
Following is the code of my .sh file
pm install "sdcard/apps/Google_Maps_6_14_4.apk"
pm install "sdcard/apps/Quick Boot.apk"
Then I get an error "Failure [INSTALL_FAILED_INVALID_URI]"
I can run the command pm install "sdcard/apps/Quick Boot.apk" in terminal individually in terminal.
rsd3k said:
Hi, I wrote a simple .sh file to batch install apps from sdcard.
What I did was I copied the same terminal commands to a inst.sh file and tried to execute the script from shell
using following commands
SU
sh /sdcard/inst.sh
Following is the code of my .sh file
pm install "sdcard/apps/Google_Maps_6_14_4.apk"
pm install "sdcard/apps/Quick Boot.apk"
Then I get an error "Failure [INSTALL_FAILED_INVALID_URI]"
I can run the command pm install "sdcard/apps/Quick Boot.apk" in terminal individually in terminal.
Click to expand...
Click to collapse
Wow, I hate to resurrect a year old thread but this literally my EXACT problem (and the first post I've seen referencing my specific circumstance). I too can use the pm install command just find from the terminal emulator, but the minute I try to execute it from a script, I get the infamous INVALID_URI failure. No one has any idea what this could be?
Hey, try putting a forward slash before "sdcard".
Sent from my XT1080 using XDA Free mobile app
d0wngrade said:
I haven't seen any tutorials covering bash in detail, so I'd like to post a project I'm working on to help people learn bash...
Tutorial One:
Covers basic math
Covers basic if..else..fi
Covers calling external scripts
How to get the tutorials:
Code:
git clone https://github.com/d0wngrade/d0.git
(This will download my entire 'd0' github repo, it's pretty empty right now.)
The tutorials are under the d0/Papers/xda_Bash/ directory.
More tutorials will be added when I get time to do them, I only intend to do this in my spare time. Thank you!
Click to expand...
Click to collapse
Thanks mate for that !
I was looking for a Tutorial specific to scripting on android but it looks like maybe this on is dead...
Correct me if im wrong..
nutpants said:
I was looking for a Tutorial specific to scripting on android but it looks like maybe this on is dead...
Correct me if im wrong..
Click to expand...
Click to collapse
Yes, this project is dead. I removed the GitHub repo too, so...
Anyways what did you meaning by "scripting on Android"?
Writing and running bash ( or other) script files on android devices.
Just trying to keep my Brain active with limited internet access.

[Project in Planning] "Recovery" for RemixOS and Android-x86

No worries, I am not asking if a recovery for RemixOS exists, because I know it doesn't, but i am thinking about creating some kind of recovery mode for Android-x86/ RemixOS myself. I have a rough Idea on how to achieve that, but as I am not a that experienced Developer (still learning on a lot of ends) and my free time is pretty rare, i made this thread to get some feedback, if I am maybe aiming for something way to big for myself or maybe if my Idea is totally stupid alltogether
So here is the rough outline on what I am planing for:
I would try to create a shell script or a GUI using Gambas (don't laugh too hard at me ), which extracts a zip and translates the edify script into common Linux commands and executes them. The first limitiation would be though, that stuff like Aroma won't be supported (at least not at the beginning).
This Script/Gui could be used in Any linux Environment, but I think using a lightweight Linux Distribution, like tinycore, which could be put on a seperate partition and started via Grub or be booted from a USB-Device should be the best option.
So i would appreciate your thoughts on it, and if anyone would like to help with advise or even joining in Development.. The better
http://forum.xda-developers.com/showthread.php?p=65807379
Great idea.
Don't give up, and please make it compatible with Phoenix OS as well...
---------- Post added at 12:50 AM ---------- Previous post was at 12:43 AM ----------
And how about a recovery in the style of Flashfire? (I mean an app running inside Android)
Well i thought of that too. But honestly, I don't really know how to program in Java. i can read the code, but writing some is far above my current abilities. I am okay with a bit of C, Shellscripting and Basic, so I decided for the last 2 because I think it will sufficient for what i am going to do and I can make the fastest progress with. I am Kinda favorizing the Shellscript right now, because that actually might work on Android in a Terminal as well
Failed Install Zip / Flash Zip In Recovery
Heyy guys. i have already try Philz touch recovery from Asus Zenfone 4 T00i and Extract that ramdisk then install to system. and now i just Type /sbin/recovery and press enter then i have entered recovery. and when i install zip. the message is failed to mount required partition. i have already modify recovery.fstab and the inside is /system in /dev/block/loop0 and /data in /dev/block/loop1.
Thats that bug i have when in recovery
Thanks before guys
Okay, i am sorry, i can't help with that, but it doesnt seem very convenient/flexible enough to be an actual help, because x86 devices just differ too much for example already in partition layout.

Categories

Resources