[Q][HTC INCREDIBLE] Install_Zip script - Android Software Development

I was wondering what script to use to install a zip from an app. Currently I use Install_Zip.sh and call
Code:
out.writeBytes("echo install_zip SDCARD:" +clickedFile.toString() +" > /cache/recovery/extendedcommand\n");
out.writeBytes("reboot recovery\n"); // testing
out.flush();
but I just get "E:Command install_zip requires exactly one argument"?
Is there something wrong with what im calling or does this script not work for the HTC Droid Incredible?
ATTACHED IS THE SCRIPT:

Related

[APP] tiny Windows APK installer, ADB req - ready to associate with APK files

I whipped this up because I wanted to associate a program with APK files so that I could
Have a friendly Android guy on my apk files
be able to double click the apk files and have them installed
be able to associate the program with that file type in FireFox so it will install them
install multiple APK files at the same time
It's made with AutoIT and assumes that you have the SDK installed under C:\android-sdk-windows\ if that's not the case you can edit the script. I have the /K argument enabled which will leave the command line open, you can change that to /c and it will close it.
Code:
$quot = Chr(34)
Dim $list = ""
For $i = 1 to $CmdLine[0]
RunWait(@ComSpec & " /k " & "C:\android-sdk-windows\tools\adb.exe install " & $quot & $CmdLine[$i]& $quot)
Next
oh Wow. Great idea. I think some more instruction is in order tho.... how to make work
I've updated this to support the new keys in android 4.2.2 and have the adb server bundled into the autoit file. it's all included in the ZIP archive.
Code:
#Region
#AutoIt3Wrapper_Icon=Google-Android.ico
#EndRegion
$quot = Chr(34)
FileInstall("adb.exe", @TempDir & "\adb.exe", 1)
FileInstall("AdbWinApi.dll", @TempDir & "\AdbWinApi.dll", 1)
FileInstall("AdbWinUsbApi.dll", @TempDir & "\AdbWinUsbApi.dll", 1)
Dim $list = ""
For $i = 1 To $cmdline[0]
RunWait(@ComSpec & " /k " & @TempDir & "\adb.exe install -r " & $quot & $cmdline[$i] & $quot)
Next
FileDelete(@TempDir & "\adb.exe")
FileDelete(@TempDir & "\AdbWinApi.dll")
FileDelete(@TempDir & "\AdbWinUsbApi.dll")
how to make it work: you can use my pre-compiled exe or compile your own. Then you either double click a .apk and select the exe as the program to open them or drag a apk onto the exe. It will launch a command line window and run the install. If it works it will tell you. If it doesn't, it will tell you why.
Nice script bro! work like a charm

[Application] gstreamer for Eclair, Froyo and Gingerbread

Here it is the gstreamer for your rooted android phones. I have made two flashable zip files:
gstreamer-0.10_gingerbread.signed.zip for android 2.3 (gingerbread)
gstreamer-0.10_24-11-10.signed.zip for android 2.1 and 2.2 (eclair, froyo)
I strongly suggest you take a backup of system partition before you flash as it contains third party shared objects like glib and oil.
For your convenience I have included a init script at /etc/init.d/99rtpstream which will launch either "/system/sd/rtpstream.sh" (eclair and froyo) or "/sd-ext/rtpstream.sh" (gingerbread) if they exists at boot time.
Gstreamer is a very flexible multimedia frameworks and it supports windows, OpenBSD and Linux. More information can be found in http://gstreamer.freedesktop.org.
This build is targeted at audio processing as I could not get the videooutput (surfaceflingersink) working. Patches are welcome please see the bottom of the post for sources.
Turns your mobile into wifi speakers
At home I have a htpc which plays videos on the TV. However occasionally I would like to use my android mobile as wifi speakers with a pair of headphones so I will not disturb others. This setup also give me the freedom to roam around the whole house whilst listening to favorite music/radio or just anything being played on the htpc. I found it rather convenient to listening to online radios.
Step 1 On your android mobile
Login to your mobile either via adb or ssh and run the following commands in sequence:
Code:
export GST_PLUGIN_PATH=/system/plugins
export GST_REGISTRY_UPDATE=1
export GST_REGISTRY=/system/sd/gst-reg.bin
AUDIO_CAPS="application/x-rtp, media=(string)audio, clock-rate=(int)90000, encoding-name=(string)MPA, channels=(int)2,rate=(int)44100, payload=(int)96, endianness=(int)1234"
gst-launch-0.10 udpsrc buffer-size=4096 port=6500 ! $AUDIO_CAPS ! rtpmpadepay ! mad ! audioconvert ! audioflingersink sync=false latency-time=100 blocksize=16384
Replace "/system/sd/" by the correct place where your sd card is being mounted, for aoss build this is likely to be "/sd-ext/".
Step 2 On your pc
Here are instructions for windows and linux only, for other platforms please refer for online help to setup correct source and parameters.
{windows}
Install gstreamer 0.10.7 from http://code.google.com/p/ossbuild/downloads/detail?name=GStreamer-WinBuilds-GPL-x86-Beta03-0.10.7.msi
and run the following command from the console
Code:
cd "C:\Program Files (x86)\OSSBuild\GStreamer\v0.10.7\bin
gst-launch.exe directsoundsrc blocksize=4096 ! audioconvert ! lamemp3enc target=1 cbr=true bitrate=128 ! rtpmpapay ! udpsink port=6500 host=ANDROID_PHONE_IP
Replace ANDROID_PHONE_IP by the ip address of your android mobile
{Linux}
Code:
gst-launch-0.10 pulsesrc device=output.monitor ! "audio/x-raw-int,channels=2,rate=44100" ! audioconvert ! lamemp3enc target=1 cbr=true bitrate=128 ! rtpmpapay ! udpsink port=6500 host=ANDROID_PHONE_IP
Replace "ANDROID_PHONE_IP" by the ip address of your android mobile and replace "output.monitor" by the name of your default pulseaudio output monitor device.
Automate the process
If you are happy with the whole thing, I would suggest put the script from Step 1 into /etc/init.d/ so it will start automatically at boot time. However you will not be able to start/stop gstreamer easily without touching the adb or ssh console. I ended up adding a loop to check a particular file on sdcard with the following script (save it to /etc/init.d/ as 99rtpstream.sh and make it executable)
Code:
#!/system/bin/sh
export GST_PLUGIN_PATH=/system/plugins
export GST_REGISTRY_UPDATE=1
export GST_REGISTRY=/system/sd/gst-reg.bin
AUDIO_CAPS="application/x-rtp, media=(string)audio, clock-rate=(int)90000, encoding-name=(string)MPA, channels=(int)2,rate=(int)44100, payload=(int)96, endianness=(int)1234"
killall gst-launch-0.10 > /dev/null 2>&1
while [ "$test" = "" ]; do
if [ -f /system/sd/rtpstream.nostart ]; then
sleep 5
else
gst-launch-0.10 udpsrc buffer-size=4096 port=6500 ! $AUDIO_CAPS ! rtpmpadepay ! mad ! audioconvert ! audioflingersink sync=false latency-time=100 blocksize=16384
sleep 5
fi
done
Replace "/system/sd/" by the correct place where your sd card is being mounted, for aoss build this is likely to be "/sd-ext/".
Basically it will not start gstreamer if there is a file called rtpstream.nostart on sd card.
I have also created 2 scripts on sdcard that can be used with gscript lite so I can start/stop gstreamer from gscript without touching adb or console.
start script (save it to sdcard as rtpstream-start.sh and make it executable)
Code:
#!/system/bin/sh
rm /system/sd/rtpstream.nostart
Replace "/system/sd/" by the correct place where your sd card is being mounted, for aoss build this is likely to be "/sd-ext/".
stop script (save it to sdcard as rtpstream-stop.sh and make it executable)
Code:
#!/system/bin/sh
busybox ps | grep gst-launch | grep -v grep | awk '{print $1}' | xargs kill
touch /system/sd/rtpstream.nostart
Replace "/system/sd/" by the correct place where your sd card is being mounted, for aoss build this is likely to be "/sd-ext/".
In gscript you can create 2 scripts with root permission and one to use the start script and the other to use stop script.
Other considerations
Streaming realtime udp over wifi when screen is switched off proved to be problematic (voice chopping) under android as most of the factory wifi driver is too aggressive on power saving. The solution is to change the default power saving mode to something like PM_FAST for some broadcom chips. This will involve recompiling the kernel. If you are using wildfire/buzz you can try my customised kernel from here http://forum.xda-developers.com/showthread.php?t=967746.
Sources
Most of the gestreamer sources including dependency libs come from http://github.com/prajnashi/ and it was ported for andriod 1.5 and as such the gstreamer android plugin is not working at all and I had to resort to this http://github.com/jahrome/. Unfortunately I could not get the video sink (surfaceflingersink) working, patches are welcome.

OpenOffice on Webtop

I've done the webtop2sd, webtopfix, and installed xfce4 via synaptic. Today I tried to install openoffice from synaptic (along with it's recommended dependencies and extras). I got the following error, which now happens on every package install:
Code:
Setting up openoffice.org-emailmerge (1:3.0.1-9ubuntu3.3) ...
Adding extension /usr/lib/openoffice/basis3.0/program/mailmerge.py...BusyBox v1.10.2 (2010-10-25 17:12:51 PDT) multi-call binary
Usage: mktemp [-dt] [-p DIR] TEMPLATE
Create a temporary file with its name based on TEMPLATE.
TEMPLATE is any name with six 'Xs' (i.e., /tmp/temp.XXXXXX).
Options:
-d Make a directory instead of a file
-t Generate a path rooted in temporary directory
-p DIR Use DIR as a temporary directory (implies -t)
For -t or -p, directory is chosen as follows:
$TMPDIR if set, else -p DIR, else /tmp
dpkg: error processing openoffice.org-emailmerge (--configure):
subprocess post-installation script returned error exit status 1
Setting up openoffice.org-writer2latex (0.5-8ubuntu1) ...
Adding extension /usr/lib/openoffice/share/extension/install/writer2latex.uno.pkg...BusyBox v1.10.2 (2010-10-25 17:12:51 PDT) multi-call binary
Usage: mktemp [-dt] [-p DIR] TEMPLATE
Create a temporary file with its name based on TEMPLATE.
TEMPLATE is any name with six 'Xs' (i.e., /tmp/temp.XXXXXX).
Options:
-d Make a directory instead of a file
-t Generate a path rooted in temporary directory
-p DIR Use DIR as a temporary directory (implies -t)
For -t or -p, directory is chosen as follows:
$TMPDIR if set, else -p DIR, else /tmp
dpkg: error processing openoffice.org-writer2latex (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of openoffice.org:
openoffice.org depends on openoffice.org-writer2latex; however:
Package openoffice.org-writer2latex is not configured yet.
dpkg: error processing openoffice.org (--configure):
dependency problems - leaving unconfigured
Setting up gawk (1:3.1.6.dfsg-0ubuntu1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
I don't know if I really need these packages, and even though I'm an old-timer with Ubuntu (been running since before Jaunty), I'm not as comfortable with dinking around with dpkg and would rather dpkg stop trying to install these every time. Any help would be appreciated.
its a known issuse i dont think it does work n xfce4 i rries it too and it didnr work eather the other type of cusrom webtop it might woek the debian one
i did get gimp to work well
chuck norris aint got **** on this atrix!
That's strange... I have the same setup (Webtop2SD, XFCE4, OpenOffice, and many others) and all is good and dandy...
By webtopfix you mean to fix dependencies?
How big is your EXT partition you installed the Webtop copy through Webtop2SD app?
I created a 4 GB EXT partition to avoid running out of space. I'm not saying that the error you are seeing is because you are running out of space, but could that be the reason?
Also, are you using the latest Busybox release?
Cheers!
Rayan
I created a 4GB partition. Openoffice seems to be working, I've run a few of the apps. I think these are addins that are failing, and it seems to be a busybox issue at that (or perhaps the deb but I doubt it)... And right now I don't know the busybox release.
I also did the chromium install after that and no issue.
I read somewhere that emailmerge doesn't work with webtop, and that's why it keeps doing that. You'll have to remove it somehow... I'm not smart enough to tell you how though.
Kinda doubt this will work:
sudo apt-get purge openoffice.org-emailmerge
Edit: I read your full log. Run webtopscripts again.
Ok, I'll run it again, but I hope this isn't normal to have to run it multiple times after installing things.
Edit: Wow! Either it missed a lot the first time I ran this script, something undid its changes, or it's just reinstalling packages for fun (actually, the first part of the script had a whole bunch of "already installed" messages, so it probably isn't just re-installing).
I've had to run it three or four times as other packages force upgrades. Fixes most issues. Had some packed named ed that can't install or uninstall, removed it by editing its file in /var... something.
Trolling from my ATRIX 4G's XDA premium app, still on the gold medal winner of worst customer satisfaction for the second year in a row! Congrats!
If you can see an app or component inside Sytaptic Manager, you can remove it the same way you installed it. Just select the option to uninstall.
Cheers!
Rayan
On my last rom (Alien v4, Faux 0.22 1.2GHz Kernel, webtop2sd, Webtop v2.3.4, webtopscripts v1.4) I was able to download and install OpenOffice without an issue; but everytime I launched it the webtop-panel would crash. OpenOffice appeared to work fine though. I'll probably install it again here shortly on this FruitCake 2.3.6 setup, installing xfce4 at the moment.
I think the tzdata issue was biting me. I went in and made the recommended change and it finished installing.
viroid said:
On my last rom (Alien v4, Faux 0.22 1.2GHz Kernel, webtop2sd, Webtop v2.3.4, webtopscripts v1.4) I was able to download and install OpenOffice without an issue; but everytime I launched it the webtop-panel would crash. OpenOffice appeared to work fine though. I'll probably install it again here shortly on this FruitCake 2.3.6 setup, installing xfce4 at the moment.
Click to expand...
Click to collapse
It crashes it in debian chroot, but in a normal environment it worked for me.
Trolling from my ATRIX 4G's XDA premium app, still on the gold medal winner of worst customer satisfaction for the second year in a row! Congrats!

[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/0ByulRvn_lJmbbnRfMG82Mm9Pb3c/edit?usp=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
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
Can we have a github source of all the scripts so we can execute in the Roms and execute it in the android source
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
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
cybojenix said:
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"
}
Click to expand...
Click to collapse
i like the thought of this!
this is realy cool,great idea and work,thanx man.
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
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).
cybojenix said:
nice idea ...
Click to expand...
Click to collapse
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.
eushaun99 said:
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
Click to expand...
Click to collapse
init.d triggered through the rom not the kernel, and it supports python scripts aswell
ricky310711 said:
init.d triggered through the rom not the kernel, and it supports python scripts aswell
Click to expand...
Click to collapse
Hi
I didn't understand this answer...
This solution also relies on init.d. Apart from python interpreting, what's the thing that makes it more robust aganist init.d scripts?
If a Rom (it's kernel) does not or only via 3rd part apps supports init.d, there could be problems the same.
Publiuss said:
Hi
I didn't understand this answer...
This solution also relies on init.d. Apart from python interpreting, what's the thing that makes it more robust aganist init.d scripts?
If a Rom (it's kernel) does not or only via 3rd part apps supports init.d, there could be problems the same.
Click to expand...
Click to collapse
what do you mean?
this doesnt rely on init.d, it is init.d.
this makes your device run init.d scripts WITHOUT the need to modify the kernel unlike some previous methods... but the scripts are called from /system/etc/startup/
the python script support is a featured currently in progress(from what i read)
ricky310711 said:
what do you mean?
this doesnt rely on init.d, it is init.d.
this makes your device run init.d scripts WITHOUT the need to modify the kernel unlike some previous methods... but the scripts are called from /system/etc/startup/
the python script support is a featured currently in progress(from what i read)
Click to expand...
Click to collapse
It does rely on init.d to call the "bse" binary, but I'm looking for an alternative method.
Sent from my Nexus 7 using Tapatalk
ricky310711 said:
what do you mean?
this doesnt rely on init.d, it is init.d.
this makes your device run init.d scripts WITHOUT the need to modify the kernel unlike some previous methods... but the scripts are called from /system/etc/startup/
the python script support is a featured currently in progress(from what i read)
Click to expand...
Click to collapse
Mhhh...
I'm not so expert, but I saw some metods using /etc/install_recovery.sh to call (another script that calls) run-parts to execute all /etc/init.d scripts, don't know if it's a way to make init.d work despite kernel not supporting it...
This one uses init.d itself to call bse executable so... well if init.d is no way supported it won't work?
Publiuss said:
Mhhh...
I'm not so expert, but I saw some metods using /etc/install_recovery.sh to call (another script that calls) run-parts to execute all /etc/init.d scripts, don't know if it's a way to make init.d work despite kernel not supporting it...
This one uses init.d itself to call bse executable so... well if init.d is no way supported it won't work?
Click to expand...
Click to collapse
justarchi has an init.d method where he calls the scripts from debuggerd!
The link is broken ... can upload? please!
Can anyone give me the download link of this tool

What is ".LSBackgroundService"

Hi,
I use Watchdog which alerts me when processes use a lot of resources. Recently, a process ".LSBackgroundService" has been popping up soon after a reboot. I've searched high and low but can't find anyone mentioning that process anywhere. I looked for apps on my phone that have something like LS in the titles but found nothing.
Killing the process doesn't help; it just restarts itself. Also, I have a rooted SM-N900V (Verizon Note 3) running Kit Kat 4.4.2.
Does anyone know what this process might be or how I can narrow down the culprit app?
Thanks!
feretio said:
Hi,
I use Watchdog which alerts me when processes use a lot of resources. Recently, a process ".LSBackgroundService" has been popping up soon after a reboot. I've searched high and low but can't find anyone mentioning that process anywhere. I looked for apps on my phone that have something like LS in the titles but found nothing.
Killing the process doesn't help; it just restarts itself. Also, I have a rooted SM-N900V (Verizon Note 3) running Kit Kat 4.4.2.
Does anyone know what this process might be or how I can narrow down the culprit app?
Thanks!
Click to expand...
Click to collapse
Apps and the system itself generally have pieces of that run checking for events to happen. Each program can name those services anything they want. For example, an email program can check to see if there's new mail every so often even if the mail app is not in the foreground. Most, if not all services do not have a user interface, thus you can't interact with it.
There's an app on Play called Disable Service that can show you which app has what background services.
You could use something like that to check to see which app spawned the .LSBackgroundService
Sent from my SM-N900V using Tapatalk
at the end of the day, all those apps/services are just processes.
More importantly, every package (or groups of .apks which declare the same "sharedUserId" and are signed by the same key) have a distinct user identity "silo". That's the basic Android security paradigm.
So why not just do a "ps" command, find the service process in that list, and then match the "u0_aNNN" identity of that service to it's package? **
Hint: look at the 2nd column of /data/system/packages.list ; it's the numeric value of the user ID (=uid)
So for instance, "u0_a80" (what you see in the ps output) == "10080" (2nd column of /data/system/packages.list).
Find the process -> find the symbolic userid -> 2nd column of /data/system/packages.list == package name.
From the package name, you get back to the APK name with:
Code:
pm list packages -f
It is helpful in all of the above to know what "grep" does.
In this strategy, one possibility is that the user name is "system" - in which case there are probably many many .APKs involved (in either /system/app or /system/priv-app) all which share a common "sharedUserId". But at least at that point you have eliminated all market apps.
There are some market apps that let you browse the manifests & look at service definitions of installed apps - market apps for sure ( but possibly not every one of the system pre-installed apps. )
If you are root however, you have access to every last .apk on the device. If you have the patience you can certainly:
- grab all of the apks and move them to a PC
Code:
adb shell
su
mkdir /sdcard/all-system-apks
cd /system
find app priv-app -name '*.apk' -print | while read fnam ; do cp $fnam /sdcard/all-system-apks/ ; done
exit
exit
adb pull /sdcard/all-system-apks/
- extract the (binary) AndroidManifest.xml file (using "unzip")
Code:
ls -1 *.apk | while read fnam ; do
unzip $fnam AndroidManifest.xml
bnam=`basename $fnam .apk`
mv AndroidManifest.xml AndroidManifest-${bnam}.xml
done
- convert the AndroidManifest files from binary format to plaintext:
Code:
ls -1 *.xml | while read fnam ; do
java -cp /home/user/AndroidXMLDecompress [URL="https://pastebin.com/raw/feuwAKCf"]AndroidXMLDecompress[/URL] $fnam | sed -e 's#>#>\n#g' > plaintext-$fnam
done
- if you know the service name you are after, then
Code:
find . -name 'plaintext-*xml' -exec grep -l $SERVICENAME {} \;
Now, who's afraid of the command line? ***
** if you can't resolve something to a single entity, you can still use process of elimination.
*** even if you are a Win-doze fanboi, you can still use cygwin for all of this.

Categories

Resources