[MOD] HULU Flash Hack - Flashex 2.05(5/2/12) Auto Hex-edit libflashplayer.so - Acer Iconia Tab A100

FLASHEX 2.05 (unified release 4)(Release Date: 5/2/2012)
Description
Flashex is designed to allow people using an Android device to watch hulu and some other restricted sites with Adobe Flash Player and a properly configured web browser as if it was a Windows PC. Dolphin HD Stock Browser(choose "request desktop site" in menu each time) is a good choice but any browser that allows you to act as Desktop via settings should work.
Note: Dolphin HD has some issues with full screen video at the moment so I have switched over to useing the stock browser and selecting "request desktop site" from the upper right-hand menu for now this works and has good full screen performance on FlexReaper and Stock ICS 4.0.3.
How it works
The script will look for libflashplayer.so then attempt to create a copy, edit the copy, and copy the edited version back. It stores the edited copy, and writes it over the default file each time it's run. It will check the version of the current libflashplayer.so file each time before it copies the edited version over. If libflashplayer.so's version has been upgraded or downgraded it will make a new copy, edit, write it back and store the new one to use each time. I suggest using Script Manager to run the script at boot once you run it the first time manually to make the first edited copy.
What's New in Version 2.05?
-Added a few more checks for libflashplayer.so to help improve troubleshooting and configuring on different ROMs and to eliminate the possibility of a hang if libflashplayer.so is not readable.
(Still waiting on feed back and/or -x mode debug output reports. feel free post them or better yet PM them to me)
What's New in Version 2.04?
-Added support for Custom BusyBox from CynogenMod (BusyBox 1.19.4-cm9) when testing the Busybox version
What's New in Version 2.03?
-Added checks to verify Busybox location, permisssions, and version to verify compatability and inform the user if they need to update/reinstall busybox or make a configuration change.
-Various minor refinements.
-Can now safely be test run on ANY device since it will verify the location of all required elements prior to performing any task.
NOTE: This doesnt mean it will enable hulu on an old 500mhz 2.2 device, just that it should be safe to use to modify Adobe Flash on any device capable of properly running it.(If your Adobe Flash is installed in a diffrent location you will need to configure the script to point it's install directory, or put a copy of your libflashplayer.so file into the Flashex2 directory and name it AND_libflashplayer.so and copy the resulting WIN_libflashplayer.so back by hand if you prefer.)
What was new in Version 2.02?
-Fixed various typoes in output messages
-Added a fix for people having issues with strings, grep etc returning as not found when /system/xbin is either not in the users default $PATH or is too low in the list to get used.
What was new in Version 2.01?
-Many minor bug fixes
-Scripts have been unified into a single script.
-Made some changes to how version checking is done
-Script is safer, more reliable, and easier to use over all.(at least IMO hehe)
-Automatic re-edit of edited source file, when either an upgrade or downgrade is detected. This allows the script to be run at boot via Script Manager, or other while still leaving, Adobe Flash to auto update.
-Script is now a single executable file that will both hex edit Adobe Flash(each update), and copy the edited file over to /data when needed.
-Improved version detection
-Improved output messages
Some notes on running during bootup
Once you have decompressed the Flashex2 folder and flashex.sh script to /mnt/sdcard/Flashex2 you will be able to run it automatically at boot via Script Manager if you wish. I currently have been using it this way. I have tested it performing the hexedit during a boot up. It works fine.
Known Limitation
Note: This only applies to auto-running the script via Script Manager, Cron, what ever It takes about 2 minutes with a Tegra 2 to complete the hexedit of the file.
Because of this when booting after an update to libflashplayer.so it will be editing the file for a min or two after your home screen shows. You will want to wait 3 min or so to be safe before you try to use Adobe Flash. This will ONLY happen when the version changes. Since Adobe Flash isn't changed that often it's not a big deal.
The rest of the time, it will be the same version so it will just take a few seconds to copy the file over. This allows you to just watch when you like even right after a system boot.
Install Instructions
Quick Directions:
Download file, unzip/extract the Flashex2 folder and it's contents, copy it to the sdcard to end up with /mnt/sdcard/Flashex2/flashex.sh. Run flashex.sh as root. Set web browser to Desktop. Enjoy watching hulu.
Full Directions:
When using Flashex205.zip via a File Manager like Astro for example.
1) Either download Flashex204b.zip directly to your tablet, or copy it to a micro SD card via PC.(note: you could unzip the contents in Windows if you prefer)
2) Save, Copy or Move Flashex205.zip to /mnt/sdcard/ It has a folder inside already of the correct name.
3) Open Flashex205.zip, then copy/paste the whole folder to /mnt/sdcard/
Note: After you do this you should have a folder named Flashex2 on your internal sdcard example: /mnt/sdcard/Flashex2
4) Inside the Flashex2 folder from the zipfile is flashex.sh
5) run flashex.sh either via terminal emulator or with an app like Script Manager.
The script "can" be run without root, BUT it will only make the hexedited file. It MUST be run as root if you also want the script to install the edited file so you can watch hulu. You can also copy the file by hand.
When using flashex205.tar.gz via a terminal emulator do the following.
1) Either download the file directly to your tablet, or copy it to a micro SD card.
2) Copy or Move the file to /mnt/sdcard/
example(copy): cp /mnt/external_sd/flashex205.tar.gz /mnt/sdcard/
example(move): mv /mnt/external_sd/flashex205.tar.gz /mnt/sdcard/
3) unzip and untar the Flashex folder and flashex.sh script from flashex205.tar.gz
gzip -d /mnt/sdcard/flashex205.tar.gz
tar -xvf /mnt/sdcard/flashex205.tar
Note: If you get an error saying not found. Your trying to install it in a diffrent location then it's currently configured you can probably figure out how to make it work easy enough. Just remember to set the path to the script inside the script it's self so it knows where make/read the edited file.
4) Now change working directories and run the script.
cd /mnt/sdcard/Flashex2
5) Run the script(su is optional, but running as root it wont copy the edited file over)
su
sh flashex.sh
Note: I suggest using sh before the script name though it's not nessesary if the path to sh at the top of the script matches yours.
Confirmed Compatable Device List(Make sure you are rooted if you want to use the script to install the modified file)
Acer Iconia A100, A200, A500 HC or ICS, FlexReaper ------ Use Latest Version
Samsung Galaxy S 4G rooted modified Gingerbread 2.3 --- Use Latest Version
Samsung Galaxy Nexus LTE ----------------------------------- Use Latest Version
Asus Eepad Transformer Prime ------------------------------- Use Version 2.2 or Latest Version
Motorola Droid Razr ------------------------------------------- Use Latest Version
HTC EVO 3D --------------------------------------------------- Use Latest Version
HTC EVO 4G running mikg v11 ------------------------------- Use Latest Version
Note: Any Device that is compatable with Adobe Flash and capable of playing hulu videos(500 Mhz or better ARM7 CPU 256 MB ram, Android 2.2 or better) that has been rooted and has busybox installed should be compatable
If you are attempting to use a Busybox older then v1.18.1 You will have to change a value at the top of the script before attempting to run it since I'm not sure how old of versions are 100% compatible.
===============================================
ATTN: SUPPORT, QUESTIONS, COMMENTS
If you need help getting it to work for your device and cant post in this section you can follow this
->SUPPORT LINK HERE
You can PM me or you can also try me on Twitter
Legal Info
Flashex205.sh was made by NoSudo for personal use
anyone may use it or change it but I retain creative
licence for my work. You should only take credit for your
changes.
I take no reponsablility for anyone elses actions. If you break
something or violate any rules it's on you.
If you wish to try and make money on it or use it for any comercial
venture I expect to be contacted and informed so I may negociate
an acceptable for profit licence with compensation.
This software is FREE and yours to enjoy, give away, edit, use for Non-Profit purposes ONLY.
A NOTE ON VERSIONS!
I recommend the use of the latest version Flashex204.sh. If you have old versions installed. MAKE SURE YOU RUN THE RIGHT ONE. It's up you to reconfigure Script Manager etc. so don't forget or it will keep running the old one.
ALSO Please remember to hit that Thanks button if you find my script useful.

I have been doing a little version testing.
I can confirm that flashex v2.01 does edit other versions so far I have tested it with. I just tested with 11.1.115.7 and it works fine via xxd. Im going to test on Android with Busybox's hexdump next.
I can also confirm that it works on 11.1.111.8 since my tablet just auto-updated. I simply ran the script and updated my hexed version from 11.1.111.7 to 11.1.111.8 as designed.

Just tried the new version and still a no go. See the pic for the full error.
Ran with terminal emulator, gscript, and root explorer. Same error for all.
And you have the .so file from the old version thread.
.so path: /data/data/com.adobe.flashplayer/lib/libflashplayer.so
ICS Leak .012.
busybox 1.19.3

Joecascio2000 said:
Just tried the new version and still a no go. See the pic for the full error.
Ran with terminal emulator, gscript, and root explorer. Same error for all.
And you have the .so file from the old version thread.
.so path: /data/data/com.adobe.flashplayer/lib/libflashplayer.so
ICS Leak .012.
busybox 1.19.3
Click to expand...
Click to collapse
Weard here is the output I got running a test edit. I used the same 2.01 script just modified so it doesn't write to my adobe flash. Kind of sandbox I guess. As you can see it reads and edits it fine. I'll look some more.
Command: '/mnt/sdcard/FLASHEX2_vtest/flashex_vtest.sh'
-------------
Out: $ exec sh '/mnt/sdcard/FLASHEX2_vtest/flashex_vtest.sh'
=================================================
Source Files Doesn't Exist
Destination File: /mnt/sdcard/FLASHEX2_vtest/DST/libflashplayer.so
Destination Ver: Adobe Flash says AND(Androiud) v1111157
Detected READ access for /mnt/sdcard/FLASHEX2_vtest/DST/libflashplayer.so
Created /mnt/sdcard/FLASHEX2_vtest/cache Sucessfully... Checking...
/mnt/sdcard/FLASHEX2_vtest/DST/libflashplayer.so preparing to copy and edit file........
Copy: /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_PREMOD looks good =================================================
Preparing to create a hexdump.........
Dont panic...This could take over a minute on a Tegra 2..
Its Converting an 8MB or so Binary on a little tablet...Just wait its fine Created a hexdump of /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_PREMOD
=================================================
Preparing to edit /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_HEXDUMP..
This might take a minute too.... /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_HEXDUMP has been edited... =================================================
Converting /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_EDITED to binary...
Binary File: /mnt/sdcard/FLASHEX2_vtest/WIN_libflashplayer.so created...
Checking Binary file /mnt/sdcard/FLASHEX2_vtest/WIN_libflashplayer.so... =================================================
HEXEDIT SUCCESSFUL File: /mnt/sdcard/FLASHEX2_vtest/WIN_libflashplayer.so now reads as Version: WIN 11,1,115,7
Sent from my A100 using XDA

I'm at a bit of a loss as to why it's not working for you Joecascio2000. I'm still looking into it.
I can confirm if I copy your libflashplayer.so v 11.1.115.7 to my device and run the script on it. I AM able to edit the file and get a good binary at the end. I was able to run it via Terminal IDE, Terminal Emulator, and Script Manager.
Going by the error your getting I would say the issue could be related to Busybox. I know you say you have 1.19.3(same as mine)
what happens if you try this from a Terminal
strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so | grep "AND 1[0-2],[0-9]*"
You should get back a list of strings out of the binary, and one of them should say something like "AND 11,1,115,7"
If that doesnt return the correct line, what does this return
strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so | grep "AND 1"
This should return "AND 11,1,115,7" if it doesn't then I would take a closer look at your strings, and grep binaries which would indicate a possible issue with your copy of Busybox or maybe your $PATH as it could effect what version gets used when running a shell command.
I still feel very confused by it working on my device and not on yours with the same file. However I also feel confident that since it works on my A100 we can get it working on yours too without much hassle. We just need to figure out what the deal is.

NoSudo said:
Sent from my A100 using XDA
Click to expand...
Click to collapse
Yeah so weird. I just tried it again after uninstalling flash and re-installing it. Same error. Maybe I'm executing it wrong. This is what I put:
su
sh /mnt/sdcard/Flashex2/flashex201.sh
It does seem to work, just give me an error with the .so file.
EDIT: and both string lines return "no such file or director". I just copy and pasted them in, maybe I did something wrong?...maybe its busybox...?

I just copy and pasted them in, maybe I did something wrong?
Click to expand...
Click to collapse
copy and past of the strings command above should work yes. You can even just run the following
strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so
If that give you bad command or something then you have an issue with either Busybox or your $PATH
$PATH is a special variable that unix/linux/android uses to store the locations of programs like grep, strings, etc. It specifies various directories commands are stored in. If the directory strings is stored in IS NOT in your path the script will not be able to access the command, so I can't say at this point which issue it in fact is, but I'm 99% sure it's one of those two things at this point.
That error is kinda old and can be erroneous. I'll look at that area a little closer later and see.
If you rerun the script after a successful edit it will tell you if it was successful BTW. If /data/data/com.adobe.flashplayer/lib/libflashplayer.so is already edited and is the same version as the WIN_libflashplayer.so Source file it will just print out a message that displays the actual version string from inside both files. The output will look somthing like this
Source File: /2.01FLASHEX_Dev/Lib_Version_Testing/WIN_libflashplayer.so
Source Ver: Adobe Flash says WIN(Windows) v1111157
Destination File: /2.01FLASHEX_Dev/Lib_Version_Testing/DST/libflashplayer.so
Destination Ver: Adobe Flash says WIN(Windows) v1111157
=================================================
It looks like you dont need make any further changes at this time.
Make sure you have set your browser to Desktop in settings(try Dolphin HD)
a

Joecascio2000 said:
Yeah so weird. I just tried it again after uninstalling flash and re-installing it. Same error. Maybe I'm executing it wrong. This is what I put:
su
sh /mnt/sdcard/Flashex2/flashex201.sh
It does seem to work, just give me an error with the .so file.
EDIT: and both string lines return "no such file or director". I just copy and pasted them in, maybe I did something wrong?...maybe its busybox...?
Click to expand...
Click to collapse
It could be. If you don't have a "strings" command the script wont work for you in it's current state. I made extensive use of strings to read info out of the binary files for version checking and to confirm the edit.
The error you got is something you could get from no strings command. It could also just be that the location "strings" is installed if it IS NOT in your $PATH for your ENV this would be a simple fix, in fact I'm tempted to add a PATH="" export PATH line back into the script just in case of stuff like this. I had removed it thinking it overkill.
Two diffrent folks seem to have a Busybox installer available via play.google.com. I use the one from J Rummy because it's only 1.99 for the Pro version instead of 4.99 and so far it has all the features I want and even has 1.19.4 available currently. It sounds like you may just need to figure out the location of the strings command and make sure that directory is exported as part of your $PATH. Let me know if would like assistance figuring this out.

NoSudo said:
It could be. If you don't have a "strings" command the script wont work for you in it's current state. I made extensive use of strings to read info out of the binary files for version checking and to confirm the edit.
The error you got is something you could get from no strings command. It could also just be that the location "strings" is installed if it IS NOT in your $PATH for your ENV this would be a simple fix, in fact I'm tempted to add a PATH="" export PATH line back into the script just in case of stuff like this. I had removed it thinking it overkill.
Two diffrent folks seem to have a Busybox installer available via play.google.com. I use the one from J Rummy because it's only 1.99 for the Pro version instead of 4.99 and so far it has all the features I want and even has 1.19.4 available currently. It sounds like you may just need to figure out the location of the strings command and make sure that directory is exported as part of your $PATH. Let me know if would like assistance figuring this out.
Click to expand...
Click to collapse
When I open terminal emulator the first line reads:
[email protected]:/ $ export PATH=/data/local/bin: $PATH
Also, I can't update busybox because for my current root method 1.19.3 is required.

Joecascio2000 said:
When I open terminal emulator the first line reads:
[email protected]:/ $ export PATH=/data/local/bin: $PATH
Also, I can't update busybox because for my current root method 1.19.3 is required.
Click to expand...
Click to collapse
You don't need a newer version of Busybox I'm running the same version.
it's your $PATH I will post an updated version that includes an Export PATH line to resolve after I eat some dinner.
for now you can copy/paste this into a terminal before running the script. Im guessing if you run that, then the script it will work
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/system/sbin:/system/xbin:/system/bin:/data/local/bin:/vendor/bin; export PATH

Darn...still isn't working. Lol my tab hates me. See the pic I think its a little different.
here's a link the one below is a little low res: http://i.imgur.com/uP9ZR.png

Joecascio2000 said:
Darn...still isn't working. Lol my tab hates me. See the pic I think its a little different.
here's a link the one below is a little low res: http://i.imgur.com/uP9ZR.png
Click to expand...
Click to collapse
It looks like you might still be missing the strings command. Because it doesnt look like anything is getting passed to grep. It looks like strings didnt run, so grep tried to look for the search expression as a file name.
what do you get if you type
ls -la /system/xbin/strings
or even just
ls -la /system/xbin
I show a symbolic link for /system/xbin/strings that points to Busybox. If it's in another location with your version of Busybox you just need to make sure the strings command is located in the path you use.
If you dont have a strings command at all for some reason since you have the same version of Busybox 1.19.3 you should be able to just make a Symbolic Link in /system/xbin(or what ever space you are configured to use) called strings that points to busybox. All those buxybox commands are symlinks to the same binary file in reality.

NoSudo said:
It looks like you might still be missing the strings command. Because it doesnt look like anything is getting passed to grep. It looks like strings didnt run, so grep tried to look for the search expression as a file name.
what do you get if you type
ls -la /system/xbin/strings
or even just
ls -la /system/xbin
I show a symbolic link for /system/xbin/strings that points to Busybox. If it's in another location with your version of Busybox you just need to make sure the strings command is located in the path you use.
If you dont have a strings command at all for some reason since you have the same version of Busybox 1.19.3 you should be able to just make a Symbolic Link in /system/xbin(or what ever space you are configured to use) called strings that points to busybox. All those buxybox commands are symlinks to the same binary file in reality.
Click to expand...
Click to collapse
Both commands showed: not found, however, I looked in /system/xbin/ and busybox and strings are in that folder. Also, right under strings is ( -> busybox )

Joecascio2000 said:
Both commands showed: not found, however, I looked in /system/xbin/ and busybox and strings are in that folder. Also, right under strings is ( -> busybox )
Click to expand...
Click to collapse
Yep the
strings --> busybox
is the way strings and the other Busybox commands look the
"--> Busybox" is to show what it links to, but the name is still strings. It's sorta like a shortcut in windows in a way.
Anyway that means you should be able to use strings try copy/paste this before you run the script in the same terminal.
PATH=$PATH:/system/xbin; export PATH
that take what ever you currently have for a $PATH and add /system/xbin to it
you can view your $PATH by typing
echo $PATH
Either way if your Busybox is properly installed into /system/xbin this should return a few lines out the binary. Just to confirm it's a working command on your system.
/system/xbin/strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so | grep "AND"
I will come up with an up date to check for the location of Busybox and use hard paths for the commands, later in the week. That should avoid this issue coming up in the future.

First off thank you for helping with my pain-in-the-you-know-what tablet.
But sadly still a no go. I did get some more info though: http://i.imgur.com/oVxBz.png
It showed AND 11,1,115,7.
I think it's either the way I'm putting in the commands or the way my tab is rooted.

Joecascio2000 said:
First off thank you for helping with my pain-in-the-you-know-what tablet.
But sadly still a no go. I did get some more info though: http://i.imgur.com/oVxBz.png
It showed AND 11,1,115,7.
I think it's either the way I'm putting in the commands or the way my tab is rooted.
Click to expand...
Click to collapse
First off, Your very welcome. I actually enjoy this kinda stuff as long as I have time.
Next, Since it DID respond with AND 11,1,115,7 I am sure you CAN use the script, once updated. I will be working on an update this weekend. I may have a revised version made today, if I get an extra hour to dedicate to make the changes.
The issue seems to be, for what ever reason your device is having an issue with /system/xbin not being in your PATH or PATH and ENV not working as it should, BUT since /system/xbin/busybox and the symlink /system/xbin/strings both work when you type the full path, it's not a big deal.
I'm also going to try to write in a feature to test the location and version of Busybox and make sure it lists "strings" as a defined function, so the script can identify and resolve the issue when possible.

Updated Version should resolve any issues with the script not being able to use strings, grep etc on some systems.
Also check here for information on configuring Terminal Emulator to work correctly with Busybox. This I belive would get the old script working for those that had issues also for what it's worth.

NoSudo said:
Updated Version should resolve any issues with the script not being able to use strings, grep etc on some systems.
Also check here for information on configuring Terminal Emulator to work correctly with Busybox. This I belive would get the old script working for those that had issues also for what it's worth.
Click to expand...
Click to collapse
This is with the new version 2.02 and after configuring Terminal Emulator:
http://i.imgur.com/Rb458.png

Joecascio2000 said:
This is with the new version 2.02 and after configuring Terminal Emulator:
http://i.imgur.com/Rb458.png
Click to expand...
Click to collapse
Man I am at a total loss as to what your system is doing. That just doesn't make any sense at all. Are you running the script or Copy/Pasting lines into Terminal? What Busybox are you running anyway, not the version where did you get it? It seems totally defective honestly.
The script should work fine for you at this point TBH. Heck it works for me on my Linux PC too when I change the paths, and swap out xxd for hexdump and change the pattern format.
At this point I can only conclude that either you have a bad version of Busybox or you are doing something wrong.
Here is an example of what I mean
BUSYBOXPATH="/system/xbin"
if [ -e "$BUSYBOXPATH/busybox" ]&&[ -e "$BUSYBOXPATH/grep" ]; then
echo "Found BusyBox in $BUSYBOXPATH"
BSYBX_VER=`$BUSYBOXPATH/busybox | $BUSYBOXPATH/grep "BusyBox v"`
echo "Version: $BSYBX_VER"
else
echo "Unable to confirm location of BusyBox, please configure the script"
exit 3
fi
This statement says if /system/xbin/busybox and /system/xbin/busybox exist to echo "Found" etc.
Your output has those lines, so those commands HAVE to exist in those locations or it would respond with
Unable to confirm location of BusyBox, please configure the script.
However the script is unable to read the Version line off busybox because busybox isnt spitting out anything or maybe it's been modified and no longder displays the correct response. Again even a Desktop PC with Linux on it get's this response from Busybox.
What happens when you just type
/system/xbin/busybox
Do you get anything?
You should get something like;
$ busybox
BusyBox v1.19.3 (2011-11-22 01:37:10 MST) multi-call binary
Copyright (C) 1998-2011 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Usage: busybox [function] [arguments]...
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!
Currently defined functions:
[, [[, addgroup, adduser, adjtimex, ar, arping, ash, awk,
basename, brctl, bunzip2, bzcat, bzip2, cal, cat, chgrp,
chmod, chown, chroot, chvt, clear, cmp, cp, cpio, crond,
crontab, cut, date, dc, dd, deallocvt, delgroup, deluser,
df, dirname, dmesg, dos2unix, dpkg, dpkg-deb, du, dumpkmap,
echo, ed, egrep, eject, env, expand, expr, false, fbset,
fdflush, fdisk, fgrep, find, fold, free, freeramdisk, fsck.minix,
ftpget, ftpput, getopt, getty, grep, gunzip, gzip, halt,
head, hexdump, hostid, hostname, httpd, hwclock, id, ifconfig,
ifdown, ifup, init, ip, ipcalc, kill, killall, klogd, last,
length, less, linuxrc, ln, loadfont, loadkmap, logger, login,
logname, logread, losetup, ls, lzmacat, makedevs, md5sum,
mdev, mesg, microcom, mkdir, mkfifo, mkfs.minix, mknod,
mkswap, mktemp, more, mount, mt, mv, nameif, nc, netstat,
nslookup, od, openvt, passwd, patch, pidof, ping, ping6,
pivot_root, poweroff, printf, ps, pwd, rdate, readlink,
realpath, reboot, renice, reset, rm, rmdir, route, rpm,
rpm2cpio, run-parts, sed, setkeycodes, sh, sha1sum, sleep,
sort, start-stop-daemon, static-sh, strings, stty, su, sulogin,
swapoff, swapon, sync, syslogd, tac, tail, tar, tee, telnet,
telnetd, test, tftp, time, top, touch, tr, traceroute, true,
tty, udhcpc, umount, uname, uncompress, unexpand, uniq,
unix2dos, unlzma, unzip, uptime, usleep, uudecode, uuencode,
vconfig, vi, vlock, watch, watchdog, wc, wget, which, who,
whoami, xargs, yes, zcat
Note: Busybox in Android will have a slightly diffrent list of functions but the version line etc is the same.

NoSudo said:
Man I am at a total loss as to what your system is doing. That just doesn't make any sense at all. Are you running the script or Copy/Pasting lines into Terminal? What Busybox are you running anyway, not the version where did you get it? It seems totally defective honestly.
The script should work fine for you at this point TBH. Heck it works for me on my Linux PC too when I change the paths, and swap out xxd for hexdump and change the pattern format.
At this point I can only conclude that either you have a bad version of Busybox or you are doing something wrong.
Click to expand...
Click to collapse
The command I'm using is
Su
Sh /mnt/sdcard/flashex2/flashex202.sh
I think it might be my version of busybox. I think its a modified version because rooting ICS on the a100 was a difficult process. It also says not to update busybox because root will be broken.
Sent from my A100 using XDA Premium HD app

Related

[HOWTO] Install Sugar Learning Platform on a low-cost tablet

Hi there,
so this is a guide how to install the Sugar Learning Platform ( http://www.sugarlabs.org/ ), which might be known from the OLPC project ( http://one.laptop.org/ ) on a low cost tablet using Android. In this example I used the Zync Z930 ( http://www.zync.in/index.php/our-products/tablet-phablets/zync-z930-detail ), but generally spoken it should be possible on every tablet / device running Android.
Software requirements
Complete Linux Installer ( https://play.google.com/store/apps/...linuxonandroid&feature=search_result&hl=en_GB )
android-vnc-viewer ( https://play.google.com/store/apps/details?id=android.androidVNC&feature=search_result&hl=en_GB )
Android Terminal Emulator ( https://play.google.com/store/apps/details?id=jackpal.androidterm&feature=search_result&hl=en_GB )
All the software above should be free of cost (at least at the time this is written). Technically we will have running a special Fedora-ARM-Image in a chroot environment on the top of Android. But you will need root rights for this, so be aware of warranty conditions and other things as it might harm your device and make it unusable.
To root your device, you must find a method that works for your device. Many devices can be rooted according to that method , for my device I used simply adb commands as described by arunal_123 in this thread: http://forum.xda-developers.com/showthread.php?t=2093663
I did not use the files he offered as I had my own, but I think this should not change a thing. However, be aware what rooting means and if you do not know it, DO NOT DO IT.
OK, so I expect you to have downloaded the 3 applications I suggested, now that we have a rooted device, let us start the real work!
First, download the Fedora-Image file from here As you can read, this is an ALPHA version, and in fact there are some bugs, however, it should work for us, so do not worry.
Now I expect that you have the image file at /user/home/fedora.img
First you might want to enlarge the image file to allow us to install all the applications we want. You can do that like this. I used method 1. If you face some trouble that the mount-point does not exist, feel free to create it by yourself manually like that as root on terminal (I expect you to run a GNU/Linux on your computer, if you do not have one, just load down an image of for example Ubuntu and put it on your USB drive ( http://www.ubuntu.com/download/help/try-ubuntu-before-you-install )):
mkdir /media/fedoranew
OK, now that you have enlarged your image file (maybe to 2GB), let´s proceed.
Open the terminal app and type su. Now there should be a # instead of a $. If this does not work, you have not successfully rooted your device, go back to step one, if you face trouble, make a specific thread for your device, but search on the forum before. Now you can already start up fedora using the following command:
Code:
sh /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /mnt/sdcard/fedora/fedora.img
(your image file would be on your sd-card in the folder fedora named fedora.img, on some devices the real extern sdcard might be available under ext_sd instead of sdcard).
Now some errors will popup, let us ignore them right now. So we are in fedora right now, but without graphical view. First, we can update all the stuff by using yum. Just type yum update (that might take some time, take a cup of coffee or realize that you should repaint your wall again)
Alright, so now let us install the programs we need, that is the tightvnc-server and the sugar-desktop, therefore type
Code:
yum install tightvnc-server
yum groupinstall sugar-desktop
yum install sugar-emulator
OK, now we must change the xstartup file of our vnc-server to use our own version. I actually prefer the nano-editor (you can install it with yum install nano, but vi is pre-installed, to use it, type: vi /home/fedora/.vnc/xstartup In the case it does not exist, just recreate the user fedora by deleting it by userdel fedora, also erase all files by rm -r /home/fedora and create it again by adduser fedora, just ignore any warnings. Now you should change the file like that:
Code:
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
dbus-launch --session sugar &
Right now if you would try to start it, you would find various errors in the logfile in /home/fedora/.vnc, that is due to some strange rights for some folders and some missing devices. So here is how to fix this issue:
Code:
chmod 666 /dev/null
chmod 777 /tmp
yum install MAKEDEV
cd /dev
MAKEDEV tty
MAKEDEV pts
So now you should have all devices and sufficient permissions, but you might not have a vnc-user-password for fedora, so change to the user and make a dummy start of the vnc-server
Code:
su - fedora
vncserver
...and choose your favorite password.
Alright, go back to root via exit and shut the hole thing down via exit again.
So start Fedora again by pressing the Vol-Up button and w on the terminal, press enter.
OK, now we should have a more or less graphical interface, so start android-vnc-viewer, use the following settings:
Code:
Port-Number: 5900
Username: fedora
Password: <your_choice>
24bit colours
And connect....
Now you should see some terminal, type
Code:
sugar-emulator
Wait a second and sugar should power up. Now you should be able to start activities and also install new ones.
Enjoy Sugar on your tablet and tell me about your experiences and problems.
I just wrote this hole post out of my memory, so probability is high I forgot something, just tell me about your issues and I will update the guide.
Happy hacking!
Sugar Learning Platform on Inexpensive Chinese Tablet
I was very happy to find a post on this topic. I have a couple of Yeahpad Pillbox7 inexpensive Chinese tablets, which I purchased specifically because they are the only thing I can afford and my 4 year old twin boy and girl need a real learning computer.
I believe this topic is of the highest importance as successful implementation means making the original goal of the $100 Sugar computer a reality to the individual user who doesn't necessarily need the specifications of the XO machine.
I have been as detailed as I can be - perhaps painfully so - because I don't know what I am missing that could make the difference in turning this from a lengthy set of failed directions and notes into a functional demonstration project that proves that it is possible to reach this goal, which has been more than a decade in the making, albeit by taking some shortcuts with the lofty hardware goals and in this case running in a virtual environment which hampers performance and functionality.
If you want to start reading where following your directions starts to go haywire then skip to the dotted line of astrixs "* * * * * * * * *" and the heading in capital letters that says, "YUM UPDATE, INSTALLING TIGHTVNC-SERVER, SUGAR-DESKTOP, & SUGAR EMULATOR - RESULTING UNFOUND FILE DEPENDENCIES NOT AT ANY MIRROR"
The specifications of the Yeahpad Pillbox7 are about identical to the machine you used.
SPECIFICATIONS ON THE YEAHPAD PILLBOX7
Android Ice Cream Sandwich
Allwinner A13 CPU and Mali-400 GPU - which is ARM Cortex-A8 architecture
512 Mb RAM
4 GB internal memory
7" capacitive touch screen
some kind of wifi - supposedly 802.11n
I have a 16GB miniSDHC card I am using with a microSD adapter
I have a USB hub and have connected a mouse and keyboard to make the work easier.
PREVIOUS EXPERIENCE RELEVANT TO THIS ENDEAVOUR
I have been using the Linux On Android / Complete Linux Installer app with Terminal Emulator app and Android VNC Viewer app all from the Play store.I have successfully chroot virtualized a very basic Debian with XFCE, and also Ubuntu 12 with LXDE with these tools.
I also have been spending some time on the Linux on Android IRC channel and have Zac the creator of the app on my FaceBook page. Zac has been helpful and is very curious as to how this project goes.
My device the Yeahpad Pillbox7 is pre-rooted and only requires a "su" at terminal to get the "#" prompt.
Despite any details that indicate otherwise, I am a complete Android noob and my experience in linux is just as a distro-hopping enthusiast with no professional experience and almost no understanding. Nonetheless I try to enjoy what I do with these consumer devices and my emphasis has always been on the lower end economically, saving old machines often when there is not any funds for a new one, and for about 5 years now also getting ahold of consumer devices from China at the lowest price that can be had new and trying to modify the stock "computer" into something useful. This is my third attempt to do so in that category.
This type of chroot linux virtualization has shown the most promise as of late in the absence of driver availabilty for installing linux natively on a category of device where the manufacturers, the components they use, and the architecture has been in constant flux - but at this point in the market they are all aiming for Android v4 and up with Play store access. Since these devices are small, they seem to lend themselves to the application of young children, and also since the largest percentage of very poor users without access are young children, the application of a learning environment that emphasizes classical computer literacy with such allegories as turtle graphics to teach programming at a young age is a worthwhile lofty goal for the community to apply to the flood of inexpensive tablet computers coming our way now.
ALPHA VS BETA VERSION OF FEDORA CORE IMAGE FOR LINUX ON ANDROID
Perhaps this is where I went wrong I am using the BETA version of the Linux on Android Fedora Core image. It wasn't available when you wrote this post. Perhaps I was mistaken in thinking that the BETA would be the better image to start with. I will go back and do it with the ALPHA version next, which is per your instructions, and I will post my results again. Anyhow I took the Fedora Core image for Linux on Android and I unzipped it using 7zip, I verified the md5sum using fileverifier++ and I put on the miniSDHC card under a folder called /fedora/ and the file I named fedora.img. So I put it at /fedora/fedora.img on the miniSDHC card.
CONFIGURING MY PC TO BE ABLE TO DO IMAGE PREPARATION
I downloaded a the alternate version of xubuntu 12.04.b for 64 bit. Did an md5sum check and burned it to a CD-ROM. Then after updating the VirtualBox install on the PC I have access to is an Acer Aspire 5733-6838 which runs Windows 7 Home Premium SP1 on an Intel Core i5 with 4GB of DDR3 RAM - I installed the Xubuntu as a Guest OS on VirtualBox successfully and applied all the latest updates. Then I also installed Guest Additions and made the Drag'n;Drop and Clipboard functions bi-directional because I like being able to copy and paste in and out of my host OS while I do my work. I was able to mount the 16GB miniSDHC card onto the Guest Xubuntu OS using the USB Devices options on the VirtualBox control bar.
I did all that (installing Xubuntu) because the Linux I've been virtualizing and enjoying lately, Mageia2, did not execute the "cp -r fedoraold/* fedoranew" command which I derived from the 'expand the image directions' you referenced without generating a plethora of "cp: cannot create symbolic link" errors!
EXPANDING THE FEDORA IMAGE TO 2GB
Having switched to Xubuntu 12.04b 64bit alternate - I was able to execute the directions derived from
the directions from the linuxonandroid resource you referenced (I am not allowed to post outside links because I am a new xda forum member)
and enlarge the fedora image file to 2GB. I used these commands from terminal:
dd if=/dev/zero of=fedoranew.img bs=1M count=0 seek=2048
mke2fs -F fedoranew.img
so then I created two folders on the miniSDHC card at /fedora/ one called "fedoraold" and one called "fedorabang"
and then mounted the folders from the terminal using these commands
sudo mount -o loop fedora.img fedoraold
sudo mount -o loop fedoranew.img fedorabang
then I did the copy to the larger 2GB image file using this command from the terminal:
sudo cp -r fedoraold/* fedorabang
and finally I unmounted the folders using these terminal commands
sudo umount fedoraold
sudo umount fedorabang[/B]
I then shut down xubuntu and used the remove usb device icon from the Windows 7 taskbar to get a safe to remove the SDCard message.
I removed the miniSDHC card from the microSD adapter and inserted it into the Yeahpad Pillbox7 while powered off.
TRYING TO MODIFY THE FEDORA IMAGE ON THE TABLET TO RUN SUGAR LEARNING PLATFORM USING LINUX ON ANDROID AND ANDROID VNC VIEWER
I already have Linux on Android / Terminal Emulator / and Android VNC Viewer Apps installed on the Android Tablet.
Using File Manager I see that the newly made image is at: mnt/extsd/fedora/fedoranew.img
So after confirming that the bootscript.sh file is where it is supposed to be I use this command from the terminal to launch Linux on Android with the 2GB FedoraCore image
sh /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /mnt/extsd/fedroa/fedoranew.img
I take the advice to ignore the errors, I've seen them before on LinuxOnAndroid during successful launches of other images.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
YUM UPDATE, INSTALLING TIGHTVNC-SERVER, SUGAR-DESKTOP, & SUGAR EMULATOR - RESULTING UNFOUND FILE DEPENDENCIES NOT AT ANY MIRROR
So I continue by trying to get all the current updates for fedora using the terminal command:
yum update
At the Transaction summary - I also respond with: "y" and [ENTER].
This is where I ran into my first set of snags - summarizing the errors Yum couldn't find these files:
bind-license-9.9.2-5.P1.fc17.noarch.rpm
dosfstools-3.0.14-1.fc17.armv5tel.rpm
selinux-policy-3.10.0-167.fc17.noarch.rpm
bind-libs-9.9.2-5.P1.fc17.armv5tel.rpm
dnsmasq-2.65-4.fc17.armv5tel.rpm
coreutils-8.15-9.fc17.armv5tel.rpm
libsss_sudo-1.8.6-1.fc17.armv5tel.rpm
iproute-3.3.0-5.fc17.armv5tel.rpm
bind-utils-9.9.2-5.P1.fc17.arm5tel.rpm
bash-4.2.39-2.fc17.arm5tel.rpm
bind-libs-lite-9.9.2-5.P1.fc17.armv5tel.rpm
selinux-policy-targeted-3.10.0-167.fc17.noarch.rpm
at any of these mirror sites:
apparently I can't post these here because I am a new xda forum member
I tried "yum update" more than once and ran into the identical set up errors, so I continued on hoping that substitute files were found, or that none of those files were essential.
So I conintued to try and install the programs your post says that I need, starting with tightvnc-server, so I use the terminal command:
yum install tightvnc-server
At the Transaction summary - I also respond with: "y" and [ENTER].
This is a summary of the files that Yum couldn't find from the errors:
perl-PathTools-3.33-221.fc17.armv5tel.rpm
perl-Pod-simple-3.16-221.fc17.noarch.rpm
perl-macros-5.14.3-221.fc17.armv5tel.rpm
perl-libs-5.14.3-221.fc17.armv5tel.rpm
perl-Pod-Escapes-1.04-221.fc17.noarch.rpm
perl-Module-Pluggable-3.90-221.fc17.noarch.rpm
perl-5.14.3-221.fc17.armv5tel.rpm
gnutls-2.12.20-4.fc17.armv5tel.rpm
I believe that Yum had tried all the mirror sites listed earlier.
As before, I have nothing else to go on, so I hope that either substitute files were found, or that none of those files were essential.
So I continue to try and install the progams your post says that I need, the next one being the sugar-desktop, so I use the terminal command:
yum groupinstall sugar-desktop
At the Transaction summary - I also respond with: "y" and [ENTER].
This is a summary of the files that Yum couldn't find from the errors:
libarchive-3.0.4-2.fc17.armv5tel.rpm
libproxy-0.4.10-1.fc17.armv5tel.rpm
gnutls-2.12.20-4.fc17.armv5tel.rpm (see above - already not found before)
I believe that Yum had tried all the mirror sites listed earlier.
As before, I have nothing else to go on, so I hope that either substitute files were found, or that none of those files were essential.
So I continue to try and install the programs your post says that I need, the next one being the sugar-emulator, so I use the terminal command:
yum install sugar-emulator
At the Transaction summary - I also respond with: "y" and [ENTER].
This is a summary of the files that Yum couldn't find from the errors:
libproxy-0.4.10-1.fc17.armv5tel.rpm (see above - already not found before)
gnutls-2.12.20-4.fc17.armv5tel.rpm (see above - already not found before)
I believe that Yum had tried all the mirror sites listed earlier.
As before, I have nothing else to go on, so I hope that either substitute files were found, or that none of those files were essential.
All in all from I read that there were 22 .rpm files missing that were not found at any of the relevant mirrors between the general yum update (12 missing files) and dependencies from tightvnc-server, sugar-desktop, and sugar-emulator (10 more missing files)
CUSTOMIZING THE XSTARTUP FILE AT /home/fedora/.vnc/xstartup FOR OUR PURPOSES
So I continud on with the instruction in your post, next on the agenda is an xstartup file for vnc-server.
You describe it as changing the xstartup file - I could used the "ls -a" command on the directory /home/fedora/ and could not find a directory called .vnc and could not find an existing file at /home/fedora/.vnc/xstartup
I too don't seem to have the talent for the vi editor so I take your suggestion and install nano using this terminal command:
yum install nano
At the Transaction summary - I also respond with: "y" and [ENTER].
There were some other files starting with "." that I found in the /home/fedora/ directory - I looked at them with the text editor and I didn't see any information that I could figure was specific to this use instance - but I am no expert. So I did the following strictly on your instructions advice.
It said if I could not find the xstartup file in existance to do the following from the terminal command line, ignoring any warnings.
userdel fedora
rm -r /home/fedora
adduser fedora
I tried the least destructive choices it gave me upon the "rm -r /home/fedora command" but it did not result in a .vnc directory or xtartup file that I could detect when completing the instructions to the "adduser fedora" command - so I repeated the commands but answered the resulting question with removal of even the /home/fedora directory. nonetheless all of that failed in creating a .vnc directory that I could detect (using the 'ls -a' command) or of an xstartup file.
So I went ahead and ad libbed the following from the terminal because otherwise anything I were to write in nano for /home/fedora/.vnc/xstartup would not save for lack of a directory for it to go in.
mkdir /home/fedora/.vnc
For some reason even after I execute the make directory command, "ls -a" from the /home/fedora/ directory still doesn't show it, but I can cd into, /home/fedora/.vnc/
From there I simply followed the directions and from the terminal:
nano /home/fedora/.vnc/xstartup
And from there entered the script given and saved it with ctrl-o and/or ctrl-x nano commands:
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
dbus-launch --session sugar &
ADDITIONAL PERMISSIONS AND MISSING DEVICES
So refering to your instructions once again: it says that I need to execute the following to give certain rights and take care of missing devices. So from the terminal:
chmod 666 /dev/null
chmod 777 /tmp
yum install MAKEDEV
At the Transaction summary - I also respond with: "y" and [ENTER].
Terminal responds "Complete!"
cd /dev
MAKEDEV tty
Then I enter according to your instructions
MAKEDEV pts
And the terminal responds:
don't know how to make device "pts"
So I do some research into the "Makedev" command - I can't post this url here because I am a new xda forum member.
Granted the page I find is not from the same flavor of linux but I don't see a "pts" option and it seems perhaps this is a typo.
So I need to guess what you were trying to accomplish. I decide on the following terminal command:
MAKEDEV pty
And at least there are no errors - but was it what you intended - I have no clue? also was there any reason for the Makedev command to be capitalized either when asking yum to install it or in its usage. Again I am a noob so I have no clue.
VNC-USER-PASSWORD AND DUMMY START OF VNC-SERVER AND OTHER FINISHING TOUCHES (unresolved)
From the terminal the next command in your directions gives no problems:
su - fedora
The result is the changed the prompt from [[email protected] dev]# to [[email protected] ~]$
but the next command:
vncserver
is unrecognized or any variants I try "vnc-server" "tightvnc-server" and I look for anything promising in the /bin/ and /sbin/ directories but fail to find anything.
So the part about 'choosing my favorite password' which I know I will need to use the Android VNC Viewer app to see the graphical install of the sugar learning platform, is sadly not a reality. This is confusing to me as I know the command must be available somehow as everytime one tries to launch the Linux On Android app it is a question on the user dialog, something like "start the vnc-server (y/n)" or some words along those lines, so I know there is a command to do this available.
So to shut everything down requires from the terminal:
exit
and then also again from the terminal:
exit
I am equally perplexed by the whole set of directions instructing to press "Vol-Up" button and w on the terminal.
I try it. and the Vol-Up button does register some symbol in the terminal, and I follow it with the letter "w" on the terminal and enter.
and also I try to do the two actions in conjunction, but nothing I do with those directions seems to restart Fedora that I can tell.
Can you explain that part of the directions in more detail?
I try various combinations of things I know to try but I Android VNC Viewer is failing to connect even if there is something to connect with for lack of a password
that I have not been able to set or already know. Also even after getting Linux on Android to launch the fedoranew.img that has been modified it the terminal is not
responsive on the command line to:
sugar-emulator (does nothing)
AN INVITATION TO ALL THOSE WHO KNOW BETTER AS TO WHAT I CAN OR SHOULD TRY TO DO TO MAKE THE SUGAR LEARNING PLATFORM WORK WITH LINUX ON ANDROID AND ANDROID VNC VIEWER.
I have not been able to enjoy Sugar on the Yeahpad Pillbox7 tablet,
and I am taking you up on your offer to tell you about my experiences and problems.
I know you said you wrote the post out of memory but if you could do it again taking notes while you do it so that others can try to get the same result, please comment on what you think I am doing right or wrong, or if you can remember more that might be helpful - then the world will owe you a debt as there in is in my humble opinion many many people who don't even know that they need this information yet.
OK, so what I think is that this image is somehow messed up as these unresolved dependencies indicate - in my opinion - some mis-configured setup.
Maybe the fastest solution might be to try the alpha-Image I used - if you still face trouble, please feel free to describe it as precisely and well as you did this time.
Good luck
I am about to repeat the process with the ALPHA image but..
I am about to repeat the process with the ALPHA image. But...it would help if you made comment on more than the dependency problems...
These three areas in your instructions and my comments are areas I am particularly curious about and think your input would be valuable in.
1)
For instance it would be helpful to know about what you think about what you think about my comments with the strange behavior around the /home/fedora/.vnc/xstartup file and the del and add of the fedora user.
Wouldn't it be better just to add the .vnc folder and xtartup file and doesn't the lack of a .vnc folder at all seem to indicate a step that wasn't documented?
2)
Please examine what I wrote about the MAKEDEV command. Was I correct about the typo?
3)
Please enlighten me further about your instructions regarding "Vol-up" and "w" - I can't find any information anywhere that gives me a clue about what you were trying to do there. I wasn't able to reproduce the result you got - maybe if I understood more I will be able to replicate what you were trying to do there and or find another way to do it.
Thanks so much in advance... I appreciate your interest in this topic!
For instance it would be helpful to know about what you think about what you think about my comments with the strange behavior around the /home/fedora/.vnc/xstartup file and the del and add of the fedora user.
Wouldn't it be better just to add the .vnc folder and xtartup file and doesn't the lack of a .vnc folder at all seem to indicate a step that wasn't documented?
Click to expand...
Click to collapse
As I understood you, yum install tightvnc-server fails due to unresolved dependencies. Therefore, no such folder will be created as the program is not installed. That is also why you will not get such a folder after recreating the user.
Please examine what I wrote about the MAKEDEV command. Was I correct about the typo?
Click to expand...
Click to collapse
It might be the case that it was in fact pty, not pts, I am not sure about that anymore. You can check for the success by changing into the /dev directory ( cd /dev ) and then list all entries of pty ( ls pty* ) to see whether the device was created successfully.
Please enlighten me further about your instructions regarding "Vol-up" and "w" - I can't find any information anywhere that gives me a clue about what you were trying to do there. I wasn't able to reproduce the result you got - maybe if I understood more I will be able to replicate what you were trying to do there and or find another way to do it.
Click to expand...
Click to collapse
This is only for convenience so that you do not have to write the hole command again. So when you are in the terminal emulator, by default, you should be able to go up in your bash history by pressing "Vol-up" and "w", similar to the "arrow-up" on your PC.
I hope I could help you, good luck.
Thank you.
Thank you, those are some very useful replies!
I will be sure to post the results of my next binge of effort on this project.

SOLVED! Python on the command line (scripts on post #17)

Hello everyone,
If your just reading this, skip to page 2 to save me some embarassment... Been a learning curve.
Go here .... http://forum.xda-developers.com/showpost.php?p=47607547&postcount=17
First post here and well I hope it's in the right place. I am definitely a novice programmer, am a little comfortable writing small python scripts which leads to this...
I got my phone rooted, I have sl4a ( It Nice! I like it. You like dogs?), and I just got my CM 10 source on Ubuntu 10 like Google recommends. I got adb working and Terminal IDE so I originally wanted to get python to be able to be called by the bash shell it provides ( I think its bash). I sorta got it working for a single session but what a drag, and I would get an error along the lines that the title suggests, so I,m not happy about that.
I also managed to get a copy of python from com.googlecode.pythonforandroid into /system/bin/ and now when I type "python" into an ADB shell I get the python interpreter!!! Whoo hooo, but I still got that same error. A "import sys", "import ephem", and maybe a few more workes but still something is wrong it said something thiss stuff here..
"""[email protected]:/data/data # python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Python 2.6.2 (r262:71600, Mar 20 2011, 16:54:21)
[GCC 4.4.3] on linux-armv7l
Type "help", "copyright", "credits" or "license" for more information.
>>>
"""
update/bump
Ok so looking at the error message again it seems that it wants two prefixes for the $PYTHONHOME variable, I assume two paths and the secon one is to the executable that I put in /system/bin/ which is already in my path hence why python is callable. I had also fumbled around haphazardly with my $PATH vriables the other day and may have added the path to some of the libs python was asking for such as libpython2.6.so, I think I added the directory that lib is found in to my path (its found in "/data/data/com.googlecode.pythonforandroid/files/python/lib/" I think, need to double check that one), so thats what ive done that made this 'click' so to speak into popping out the python interpretor.
Also I found this file...MSM8960_lpm.rc but I forgot from where it came. It looks as if it contains some global variables that get set during boot, am I right?
This is the top part of it...
"""
on early-init
start ueventd
on init
sysclktz 0
loglevel 3
# setup the global environment
export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
export LD_LIBRARY_PATH /vendor/lib:/system/lib
export ANDROID_BOOTLOGO 1
export ANDROID_ROOT /system
export ANDROID_ASSETS /system/app
export ANDROID_DATA /data
export EXTERNAL_STORAGE /mnt/sdcard
export EXTERNAL_STORAGE2 /mnt/sdcard/external_sd
export USBHOST_STORAGE /mnt/sdcard/usbStorage
export ASEC_MOUNTPOINT /mnt/asec
export LOOP_MOUNTPOINT /mnt/obb
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
"""
So I am thinking that if I set the paths to my Python exec and libs here, as well as Paths for Lua, Perl, JRuby, Python 2.7, Etc, etc then I would have an assortment of scripting languages to launch into ffrom ADB, am I right? This would help me and others write scripts for ADB in many languages to do repetitive grunt work from scripts.
Any advice would be great as it works but its like python is injured, "import os" didnt work ;( but "import sys" did
It would also be nice if these same vriables could be set for Terminal Emulator, Terminal IDE, and the like, I know SSH is in the works with T. IDE and that one has telnet though I havent figured that out yet.
What should I do? This seems like an OS related issue but if the interpreter is there and compiled for arm and the libs aswell why would this not work?
python -v output
this is the "python -v" output to show what's happening, maybe it'll help....
"""
[email protected]:/ # python -v
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
'import site' failed; traceback:
ImportError: No module named site
Python 2.6.2 (r262:71600, Mar 20 2011, 16:54:21)
[GCC 4.4.3] on linux-armv7l
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import os
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named os
>>>
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] zipimport
# cleanup[1] signal
# cleanup[1] exceptions
# cleanup[1] _warnings
# cleanup sys
# cleanup __builtin__
# cleanup ints: 3 unfreed ints
# cleanup floats
[email protected]:/ #
"""
That snippet you posted is from the init.rc inside the boot.img...so yes, it has all sorts of initialization code
CNexus said:
That snippet you posted is from the init.rc inside the boot.img...so yes, it has all sorts of initialization code
Click to expand...
Click to collapse
Ok, so I'll so some reading on setting $PYTHONHOME variable and others, I need to learn how that all works anyways. Most if not all of what I find documents how to set the variables for Windows, Mac, or Linux and not for Android. I will do my best to use that knowledge to fit this situation. I also need to dive around the file system a bit more and find all those libs and try to get the paths set for those to work with ADB and not just SL4A.
If I can do that maybe some more Linux programs/commands can be moved into Android's system, I know alot of the GUI apps for Linux have dependencies for python and gtk and qt, those modules might be portable to Android if they haven't already done so. Not to mention the other interpreters like Perl. To be perfectly honest what I want to do is port over Kali's toolset (at least the cmd line tools) over to android to they can be run from a terminal emulator or adb its self. Thats what I want to do with it, then wrap it all up into a ROM and build it. I know they have already compiled most of Kali's and BackTrack's programs on ARM so I was thinking of pulling those apps from there after an upgrade and then moving them into Androids system e.g /system/bin : /system/lib : /etc/* and so on, if the file systems are too different I suppose I can add directories and make a PATH for them or add them to $PATH once I learn how all that works.
Any good documentation on related issued anyone might be able to link to would be great, I'll be droppin by every so often while I'm grinding through google, thanks in advance for any help and thank you for your time, a bit of a read I suppose.
Environment variables like that would need to be set inside the boot.img, so if you want to unpack it and see exactly how things are defined and what other files are there (good exercise all around IMO), grab my tools from over here and unpack it for yourself and take a look:
cool tools
CNexus said:
Environment variables like that would need to be set inside the boot.img, so if you want to unpack it and see exactly how things are defined and what other files are there (good exercise all around IMO), grab my tools from over here and unpack it for yourself and take a look:
Click to expand...
Click to collapse
Well I downloaded twrp 2.3.1.0-d2spr and I used the split_boot tool in the package and got a little tree of files including the init.rc and the other msm one, they seem very similar if not identical (?), weird.
I just have a quick question, do I need to repack all this at a certain size? In other words, if I make any changes in the ramdisk image will it refuse to boot? I browsed over some sites and read somewhere that if I changed the kernal image it would fail a hash check and that the type of hashing ( I use bubble bags, but that's for another forum). How much attention do I need to pay to the size of these files I may alter before I repack and flash to the device?
Edge-Case said:
Well I downloaded twrp 2.3.1.0-d2spr and I used the split_boot tool in the package and got a little tree of files including the init.rc and the other msm one, they seem very similar if not identical (?), weird.
I just have a quick question, do I need to repack all this at a certain size? In other words, if I make any changes in the ramdisk image will it refuse to boot? I browsed over some sites and read somewhere that if I changed the kernal image it would fail a hash check and that the type of hashing ( I use bubble bags, but that's for another forum). How much attention do I need to pay to the size of these files I may alter before I repack and flash to the device?
Click to expand...
Click to collapse
Yes, actually. You need to repack at certain offsets/addresses or the device will be unable to read it properly
Run the boot_info script on your .img file and it will give you everything you need to know to repack the boot.img correctly
First you gotta repack the ramdisk (repack_ramdisk [optional out file])
Then after you do that, you can use the mkbootimg binary along with the info from my boot_info script to make a new boot.img with the right offsets
I've done a ton of boot.img splitting, so here's what it should look like (I forget the cmdline parameter)
Code:
mkbootimg --kernel KERNEL --ramdisk RAMDISK --base 0x80200000 --oversize 2048 --cmdline 'android.I.don't.remember.this.one' --ramdiskaddr 0x81500000 -o new_boot.img
Sent from my S3 on Sense 5 (you jelly?)
CNexus said:
Yes, actually. You need to repack at certain offsets/addresses or the device will be unable to read it properly
Run the boot_info script on your .img file and it will give you everything you need to know to repack the boot.img correctly
First you gotta repack the ramdisk (repack_ramdisk [optional out file])
Then after you do that, you can use the mkbootimg binary along with the info from my boot_info script to make a new boot.img with the right offsets
I've done a ton of boot.img splitting, so here's what it should look like (I forget the cmdline parameter)
Code:
mkbootimg --kernel KERNEL --ramdisk RAMDISK --base 0x80200000 --oversize 2048 --cmdline 'android.I.don't.remember.this.one' --ramdiskaddr 0x81500000 -o new_boot.img
Sent from my S3 on Sense 5 (you jelly?)
Click to expand...
Click to collapse
Thanks,
I actually just got the CWM ROM manager, I updated my CWM and am backing up my rom now, its pretty much stock lacking updates cuz of root I think, I eventually wanna get over to CM or some other rom but CM seems to be supported pretty well.
1) So the backup just finished a second ago, can I pull a boot image out of that? :EDIT: Check. I saw it in the recovered folder.
2) I'll use the boot info on that img when I get it.
3) I guess this is all for testing the variables and getting interpreters to run from adb and T.E. after that I need to install CM 10 to get some blobs, thats all thats hanging me up from modifying the source to build my own version, this is great exercise as it will need to be done when building this "Cyano-Kali" or whatever, I was also thinking "Kali0id" as in Kalioid and Kali zero i.d.
ok well I did some messing around and I got this lill chroot setup working from adb which is kool, I just took a no gui kali.img and a script I found to chroot into it ( Maybe Google "Weaponizing Android"), it needs a lil investigating though I get a couple errors, it looks like it was modified from a chroot into ubuntu (arm).
I put the script into /system/xbin/ and then made it executable (that seems to be the only place I could chmod), I looked at the sript at it points to a coded directory for the kali.img which is something like "/storage/sdcard0/kali/kail.img". This puts the script in a location that is already in the environ variable and you can call it from any cwd by typing "kali".
Note: Interesting tip (may be trivial to the pros), typing "bash" gives me a colorful interface and the bash interpreter, this is good for a first command when entering the terminal or adb because then you can modify the bash rc file found in "/system/etc/bash/" (I think, I'll double check later.*FIXED*).
So, I think I might be able to mod those variables there to include PYTHONPATH, PYTHONHOME, etc...
Then when I launch bash i should be able to launch python and whatever else. (*Check*, it works but you must first "bash" and then "python" to allow the bashrc file to get ran and add PYTHONHOME and PYTHONPATH to the enviroment)
I think the first shell that you get put into is shell and not bash but maybe I'm wrong.
*side note, If you want to su into bash its best ime to do that first, then bash, otherwise when you su while in bash you loose the color, idk why.
heres my results so far...
Code:
[email protected]:~$ adb devices
List of devices attached
xxxxxxxxxx device
[email protected]:~$ adb shell
[email protected]:/ $ su
[email protected]:/ # bash
void endpwent()(3) is not implemented on Android
localhost / # kali
ioctl LOOP_SET_FD failed: Device or resource busy
mount: Device or resource busy
net.ipv4.ip_forward = 1
[[email protected] ~$ cd .. && ls
bin dev home lost+found mnt proc run selinux sys usr
boot etc lib media opt root sbin srv tmp var
[[email protected] /$ which macchanger
/usr/bin/macchanger
[[email protected] /$ which ophcrack
/usr/bin/ophcrack
[[email protected] /$ which reaver
/usr/bin/reaver
[[email protected] /$ which aircrack-ng
/usr/bin/aircrack-ng
[[email protected] /$ python --version
Python 2.7.3
[[email protected] /$ perl --version
This is perl 5, version 14, subversion 2 (v5.14.2) built for arm-linux-gnueabi-thread-multi-64int
(with 80 registered patches, see perl -V for more detail)
Copyright 1987-2011, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
[[email protected] /$ bash --version
GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabi)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[[email protected] /$ python
Python 2.7.3 (default, Jan 2 2013, 22:35:13)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import sys
>>>
[[email protected] /$ exit
Shutting down Kali ARM
failed: Device or resource busy
losetup: /dev/block/loop255: Device or resource busy
localhost / # exit
1|[email protected]:/ # ^D
1|[email protected]:/ $ ^D
[email protected]:~$
Does anybody know how to mount an external sdcard from the command line on the Debian version of Linux on Android?
Is that even possible, like driver wise and what not?
Nice!
To mount it, first you would need it's device name or UUID..
Sent from my S3 on Sense 5 (you jelly?)
Success!
Alright! I got Python working from the terminal emulator!
I ended up copying the files that got installed by the original installer into my system/ lib, xbin, and, bin directories I just kinda put stuff here or there and then I just got one error about platform independent libraries instead of both dependent and independent. I'm alil add about things sometimes. Then about ten minutes ago while chilling on the patio the syntax for the PythonHome and path variables became clear to me. So i changed it to export and wrapped the paths in quotes and figured out the prefix : exec_prefex thing.
Now python works!!!!!!! ill run it on adb tomorrow and show the results as well as exactly how to get it working after i figure out exactly what i did right. It was probably the last thing.
Edge-Case said:
Alright! I got Python working from the terminal emulator!
I ended up copying the files that got installed by the original installer into my system/ lib, xbin, and, bin directories I just kinda put stuff here or there and then I just got one error about platform independent libraries instead of both dependent and independent. I'm alil add about things sometimes. Then about ten minutes ago while chilling on the patio the syntax for the PythonHome and path variables became clear to me. So i changed it to export and wrapped the paths in quotes and figured out the prefix : exec_prefex thing.
Now python works!!!!!!! ill run it on adb tomorrow and show the results as well as exactly how to get it working after i figure out exactly what i did right. It was probably the last thing.
Click to expand...
Click to collapse
Nice
Sent from my S3 on Sense 5 (you jelly?)
Solution !
Ok I got everything cleaned up a bit, lets see whats going on here...
So hopefully bash is preinstalled for everyone, I just found it, the only changes I made in the past week are installing...
1) CyanogenMod, I believe you will need to already be rooted, have busybox, and a custom recovery to get this far. If you can get CyanogenMod working then you'll probably be able to replicate this, mayeb even with just root and busybox on a stock sprint rom, idk.
2) SL4A along with Python 2.6, Perl, and JRuby. (I hope normal ruby programs can be ran will JRuby, if not I'll either mod the programs or port ruby to android or look for another port.
3) Terminal IDE. This could have been a source of bash if it wasn't native to android or the Terminal Emulator/busybox.
Once you have The above, at least python 2.6 with SL4A, Terminal Emulator, Busybox, and root.
You can (the file system maybe different for different phones but since we are in a specific place of this forum I'll stick with what I found on my phone specifically)
Use a root browser and find a way to remount your file system to read/write or r/w or rw mode so you can write to /system directory. It is located in the / directory of the entire system, not just the sdcard0 partition.
You can open a terminal and type "set" to get a closer look at whats happening here on Android. We are mainly interested in the Environment Variables.
What I did was copy
"/storage/sdcard0/com.googlecode.pythonforandroid/extras/python" ----> "/system/etc/python" ##THIS IS A DIRECTORY
"/data/data/com.googlecode.pythonforandroid/files/python/lib/python2.6" ----> "/system/lib/python2.6" ##THIS IS A DIRECTORY
"/data/data/com.googlecode.pythonforandroid/files/python/bin/python" -> "/system/xbin/python ##THIS IS A FILE, IT IS AN EXECUTABLE!
"/"/data/data/com.googlecode.pythonforandroid/files/python/lib/" ----> "/system/lib/python2.6/" ##WE WANT ALL THE "*.so" FILES NEXT TO THE ORIGIONAL "*/PYTHON2.6/" DIR IN THE "DATA/DATA/" SIDE OF THE TREE TO BE COPIED TO THE SYSTEM SIDE AND INTO THE "/system/lib/python2.6/" DIR NEXT TO THE "/system/lib/python2.6/lib-dynload/" DIR
We want our "/system/lib/python2.6" directory to contain the following :
"/lib-dynload" is a dir; and all the .so files from earlier there are about 8 with a fresh install of python and no modules, some of you may already know how to incorporate modules from this point, but I still need to do some experimenting.
---------------------------------------------------------
OK
if you still following then your gonna wanna do the following
go to "/system/etc/bash" and open the bashrc file, we need to add PYTHONPATH and PYTHONHOME to it, this is how I set it up....
About half way down it will read
Code:
"""
# set some environment variables
HOME=/sdcard
TERM=linux (maybe change this to "Administrator" but that may break something)
"""
# Our additions follow:
export PYTHONHOME="/system/etc/python:/system/xbin/python"
export PYTHONPATH="/system/etc/python:/system/lib/python2.6/lib-dynload:/system/lib/python2.6"
Ok, now if you go to your teminal emulator or ADB shell you can type:
bash [press enter]
python [press enter]
and check out the results
or
su [enter]
bash [enter]
python [enter]
and see what happens
whats happening is that your PYTHONHOME and PYTHONPATH variables are being set when you enter bash, and since they are exported from the bashrc file they get carried over to any child activities that may spawn, such as "python". Correct me if I am wrong.
I may have forgot some little file I put somewere a few days ago or something so let me know if it doesn't work for you i'll do my best to help you get it working on your phone to,
other then finding a rc file for the shell that you start with when you launch the terminal or any other process maybe even, I may need to do what CNex suggested and complete the change in a boot.img to flash to my phone. that should result in the variables being passed to all activities.
Peace yo
Any questions I'll drop around if this dies of from here, well live and let die I suppose.
Just a screen shot
Just a screen shot.
I found the "mkshrc" file in "/system/etc" today so I added the PATHs to that file and now when teminal emulator starts it has access to python's libs. ("/system/etc/mkshrc" should be the location)
I've run into two problems, the first I can live with, the second is only more reason to port Kali's toolset into android.
1) I can't yet access the pydocs for interactive help, for example...
Code:
[email protected]:~$ adb shell
[email protected]:/ $ python
dlopen libpython2.6.so
Python 2.6.2 (r262:71600, Mar 20 2011, 16:54:21)
[GCC 4.4.3] on linux-armv7l
Type "help", "copyright", "credits" or "license" for more information.
>>> import android
>>> help (android)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/site.py", line 431, in __call__
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/pydoc.py", line 1720, in __call__
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/pydoc.py", line 1766, in help
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/pydoc.py", line 1508, in doc
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/pydoc.py", line 1314, in pager
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/pydoc.py", line 1338, in getpager
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/tempfile.py", line 286, in mkstemp
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/tempfile.py", line 254, in gettempdir
File "/home/manuel/AptanaStudio3Workspace/python-for-android/python-build/output/usr/lib/python2.6/tempfile.py", line 201, in _get_default_tempdir
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']
>>>
And
2) When I chroot into Kali.img the PYTHONPATH and PYTHONHOME variables get carried over and interfear with python within Kali. ????
Work around: is just modifing "bashrc" then when you want python or other inerpreters launch bash first and call kali from shell.
Solution: is porting Kali's Toolkit and more Linux programs and commands into Android. Then release as rom or give instructions on how to set up.
No Really, I think I got it figured out this time.
If your running python 2.6 via Py4a then youll use the first script to access python from the command line or over adb, you'll need su to but it in /system/bin or /system/xbin and to use this command to write to the system partition "mount -wo remount systemfs /system" when your done use "mount -ro remount systemfs /system" (with out the quotes of course).
Note: adbd can only be ran as root, so this method will only work as root. Also I had some trouble disconnecting from adb as "exit", it hung till I unplugged the phone from usb. But, still I got to run scripts python that utilize the androids api with-out having to directly open sl4a and then the python interpreter from there.
Note2: Maybe one who was slick enough could get the source for sl4a and pick out the server and facade code, then make a little dex to be ran from the command-line instead of starting the server via "am" and instead of using sockets, maybe ashmem to share the JSON results that get sent back to python.
This is the script for 2.6 :​
Code:
#!/system/bin/sh
am start -a com.googlecode.android_scripting.action.LAUNCH_SERVER \
-n com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher \
--ei com.googlecode.android_scripting.extra.USE_SERVICE_PORT 54326
export AP_PORT=54326
export AP_HOST=127.0.0.1
adbd &
export EXTERNAL_STORAGE=/mnt/sdcard/com.googlecode.pythonforandroid
export PY4A=/data/data/com.googlecode.pythonforandroid/files/python
export PY4A_EXTRAS=$EXTERNAL_STORAGE/extras
PYTHONPATH=$EXTERNAL_STORAGE/extras/python
PYTHONPATH=${PYTHONPATH}:$PY4A/lib/python2.6/lib-dynload
export PYTHONPATH
export TEMP=$EXTERNAL_STORAGE/extras/python/tmp
export HOME=/sdcard
export PYTHON_EGG_CACHE=$TEMP
export PYTHONHOME=$PY4A
export LD_LIBRARY_PATH=$PY4A/lib
$PYTHONHOME/bin/python "[email protected]"
This one is for 3.2 :​
Code:
#!/system/bin/sh
am start -a com.googlecode.android_scripting.action.LAUNCH_SERVER \
-n com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher \
--ei com.googlecode.android_scripting.extra.USE_SERVICE_PORT 54332
export AP_PORT=54332
export AP_HOST=127.0.0.1
adbd &
export EXTERNAL_STORAGE=/mnt/sdcard/com.googlecode.python3forandroid
export PY34A=/data/data/com.googlecode.python3forandroid/files/python3
export PY4A_EXTRAS=$EXTERNAL_STORAGE/extras
PYTHONPATH=$EXTERNAL_STORAGE/extras/python3
PYTHONPATH=${PYTHONPATH}:$PY34A/lib/python3.2/lib-dynload
export PYTHONPATH
export TEMP=$EXTERNAL_STORAGE/extras/python3/tmp
export HOME=/sdcard
export PYTHON_EGG_CACHE=$TEMP
export PYTHONHOME=$PY34A
export LD_LIBRARY_PATH=$PY34A/lib
$PYTHONHOME/bin/python3 "[email protected]"
Explanation:​-First, the server which handles calls to Android's APIs gets starts by it's activity with am and port is set.
-Second, AP_PORT and AP_HOST get exported so that android.py will have its parameters set to interact with the "facade"
-Third, adbd gets started in the background (I cant give a full explanation, but I found the RPC mechanism between the python interpreter and the sl4a server when android.py is imported and droid.* is attempted)
-Fourth, Python's environment variables get set, doing it this way helps to avoid copying the whole python installation to /system (as I did in the past ), just put one of these scripts in /system/bin or /system/xbin and name it "python" then chmod the script "chmod 755 python" you will be able to call the interpreter and put the shabang in your python scripts (ie "#!/system/bin/python").
-Fifth, launch the interpreter.
Here is a short session over adb:​
Code:
[email protected]:/ # python
dlopen libpython2.6.so
Python 2.6.2 (r262:71600, Mar 20 2011, 16:54:21)
[GCC 4.4.3] on linux-armv7l
Type "help", "copyright", "credits" or "license" for more information.
>>> import android
>>> droid = android.Android()
>>> droid.makeToast("Hello!")
Result(id=0, result=None, error=None)
>>> droid.getLastKnownLocation()
Result(id=1, result={u'passive': {u'bearing': 0, u'altitude': 0, u'time': 1384816643565L, u'longitude': -67.551754299999999,
u'provider': u'network', u'latitude': 96.0520909, u'speed': 0, u'accuracy': 3533}, u'network': {u'bearing': 0, u'altitude': 0, u'time':
1384816643565L, u'longitude': -67.551754299999999, u'provider': u'network', u'latitude': 96.0520909, u'speed': 0, u'accuracy':
3533}, u'gps': None}, error=None)
>>> exit()
And some credit to others:
http://code.google.com/p/python-for...sh?r=997929b1bbaa53cdf76acfff419ec13c13f869b7
http://stackoverflow.com/questions/10839879/python-sl4a-development
Those are links to where I got some info from to help put this together. The adbd thing was just trying "adb forward tcp:xxxx tcp:xxxx" but that didn't work, so I tried adbd forward tcp:xxxx tcp:xxxx and it looked like it hung there, so I ctl^ c and then just adbd and it hung there again, but when used the "&" to background it and then went to python to try android.py, it worked:good:
And for a lot of fun, go here:
http://code.google.com/p/android-scripting/wiki/ApiReference
-or here-
http://www.mithril.com.au/android/doc/index.html

[VOLVO SCT] Volvo Sensus Connected Touch (car - navi - audio)

Volvo Sensus Connected Touch (SCT) is a new car audio-navi system based on systems of Parrot. SCT has hardware and software from the Parrot, but is not exactly equal. In general it has some more restrictions build in by Volvo.
The system is based on the Parrot FC6100 (not the Parrot Asteroid Smart as was first believed). Looking at the Installation manual for Sensus Connected Touch (ACU) Accessory, Part Number: 31399165 the form factor is closest to the Parrot Asteroid Tablet (PAT). The only similarity that the SCT has with the PAS is Parrot's custom base of the Android 2.3 branch which is also shared by the PAT. So, if anything is more analogous to the Parrot Asteroid Tablet (PAT) than the Parrot Asteroid Smart. (thanks to Donaldta, see post) (Link to the Volvo V40 (MY14) SCT installation manual, also attached to this post as pdf)
This is how the hardware of the SCT looks if outside of the car (thanks to @AAT):
This thread is research and development on several topics and has already some nice answers:
The starting questions:
How to get ADB working y
How to install .apk files y
How to root y
WARNING!:
The below mentioned method is an experimental way of rooting. Rooting your SCT involves some android knowledge. Me, the developers and anyone in this topic are not responsible for typo's or any damage that may occur when you follow these instructions.
ROOTING means you have complete control over the android system. This also means you can do damage to it.
Security warning:
The SCT has ADB over WIFI enabled by default. Never ever connect your Volvo SCT to an unknown and/or untrusted network! Anyone connected to that same network can harm your Volvo SCT. The same applies for connecting unknown people to a known/trusted network of yours.
Security warning 2:
If your ROOTED your SCT, you are extra vulnerable to above. Anyone with ADB on the same network has complete control over your SCT!
WARNING!
Do NOT attempt to replace the SCT's BUSYBOX executable or the command symlinks to it. Another user in this forum just sent me a private message stating that they tried this on their SCT and can no longer mount USB drives or connect to ADB over WiFi. Apparently, they also do not have a File Explorer or a Terminal Emulator installed so it seems this is going to be nearly impossible to fix and will most likely be required to swap it at the dealer. See message from @donaldta : Message
The below answers are not yet completely reviewed and tested. The answers will be reviewed in the next days. In any case the instructions below are delivered "as is" and have no guaranty. If you follow the instructions below, you are responsible for your own actions. So, before you do so, understand, or at least try to, what you are doing. If you have questions or have recommendations, post them in the topic.
The answers and instructions below are constructed from the work of @gekkekoe123 and @donaldta and the trial and error experiments of the first users of the SCT (see first pages of the topic)
This means everone using these instructions must give BIG THANKS TO @gekkekoe123 and @donaldta
Instructions to root en install apps:
Note: Instructions are tested on specific versions of the Volvo SCT
It is possible that these instructions below are not (yet) working on other versions: Other continents, newer versions etc.
If you tested it on a different continent + version, let me know, so I can put it here.
Available versions:
EU
-1.47.88 - Tested
-1.47.96 - Tested
-1.49.34 Tested
One click script version 4 in attachments cmd-frama-menu-4.zip (4.62 MB)
One-click script with menu provided by @gekkekoe123 and @donaldta
Oneclick , latest version, script is discussed from here
It is rather simple as long as You have the SENSUS CONNECTED TOUCH and a PC (prefer a laptop) which You need to connect to the same network.
How to:
1. Preparing
*Download the: cmd-frama-menu-4.zip from the page 1, first post attachments. LINK: http://forum.xda-developers.com/attachment.php?attachmentid=2636951&d=1395149723
2. Follow the instructions
The instructions are rather simple.
-Connect your SCT to the same Wifi network as your PC. This wifi network can be your home network or your local hotspot from your phone.
-Unzip the (cmd-frama-menu-4.zip) and start menu.bat found in the folder "menu"
- After starting menu.bat on your pc it will ask:
Code:
Input {IP Address of Android Device} or USB:
Type in the IP address of the SCT, can be found when You go to the settings on SCT -> WIFI -> and click on the connected network (starts with 192.-).
After that the menu look list this: (Now just type in: 1 and wait a bit so it will say complete, then type in 2 and wait a bit until complete and so on, until step 6 when the SCT will restart itself)
Code:
1 - Copy Framaroot files and execute.
2 - Install remount.sh into /system/xbin and remount as writeable.
3 - Alter /system/build.prop to ro.parrot.install-all=true
4 - Install Google Framework & Android Market
5 - Install rewhitelist.sh/setpropex/patch init.parrot.capabilities.sh
6 - Reboot Android Device
7 - Install Android Packages from APKs folder.
8 - Android Debug Bridge Shell
9 - Save ADB Bugreport to Disk
R - Input connection information & retry ADB connect.
Q - Quit
Run steps 1 through 6 in order to root the SCT.
Step 7 is optional and will install all APKs you have placed inside the APKs folder in your unzipped menu.zip folder on your pc PC.
Step 8 is for manual commands or troubleshooting.
Step 9 is for troubleshooting.
Step R is only needed when the connection to the SCT seems lost.
3. You should have now a rooted SCT.
4. Installing applications
I noticed that lots of Apps from Google Play Store can not be downloaded directly to the SCT (because the SCT is not in the available list of the apps) so a easy way is to download the Applications as ".apk" files from the PC (You can find the desired app from: http://www.appsapk.com/ or http://www.androiddrawer.com/ for example).
Then copy-paste these .apk files(make sure they do not have any spaces in the filenames) to the folder "APKs" found in the downloaded unzipped folder "cmd-frama-menu-4". To install them, run the menu.bat again and once connected with the SCT again run the step 7 to install the applications You copied to the APK folder.
If you want to install apps using the Google Play Store that are larger than 7MB or so, you need to remap the cache directory to the SD card:
Code:
remount.sh cache-sd
Then after the app installation has finished, but before you start the app, remap the cache directory to the internal SCT memory:
Code:
remount.sh cache-og
5. Enable displaying applications while driving (disable safety feature)
1. Download Android Terminal Emulator from Google Play Store on Your rooted SCT.
2. Once installed, run Android Terminal Emulator under Applications
3. touch the screen - the keyboard pops up
4. Type in "su" press ENTER
5. It should ask wether You allow Superuser or not, choose the "Allow" option.
6. Type in "rewhitelist.sh" press ENTER
7. Type in "reboot" press ENTER
6. Enable Google Maps and Voice Search
First install google.maps.6.14.4.apk by the method explained above. Then copy libvoicesearch.so to /system/lib and install Voice_Search_2.1.4.apk. These files can be found in Voice_Search_2.1.4.zip.
Here is an example of how to do this with adb:
Code:
adb connect [ip of your SCT]
adb push google.maps.6.14.4.apk /mnt/sdcard
adb install /mnt/sdcard/google.maps.6.14.4.apk
adb push libvoicesearch.so /mnt/sdcard
adb shell su -c 'remount.sh system-rw'
adb shell su -c 'cp /mnt/sdcard/libvoicesearch.so /system/lib'
adb shell su -c 'chmod 644 /system/lib/libvoicesearch.so'
adb push Voice_Search_2.1.4.apk /mnt/sdcard
adb install /mnt/sdcard/Voice_Search_2.1.4.apk
Now #reboot# and Google Maps and Voice Search should be working.
Now You should be done. Happy downloading and drive safely.
Older instructions, just for reference here, do not follow anymore.
[*]One-click script with menu provided by @gekkekoe123 and @donaldta
This one-click script with menu options is here
[*]One click script for version 1.49.34: http://forum.xda-developers.com/showthread.php?p=50846498
gekkekoe123 said:
Actually it was fine (since we are in the root folder), but since I was too lazy, I used your file. I had to correct the "true" to 1.
I also changed the menu to do this. I removed the set prop option, it's not needed anymore. Setpropex should also work on older versions.
Btw, I did the upgrade manually using adb shell, and did not used the menu.bat.
So if anyone could test it or double check the menu.bat file, it should be fine. I translated the manual commands back into the menu.bat
My SCT is upgraded and I am able to install apks Let's find out if waze lost of data is fixed. Also adjusting screen dpi is still working. But we now have setpropex so we can override everything
When you finished step 5, you need to reboot in order to be able to install apks.
As allways: no guarantee and at your own risk when using the tools
Click to expand...
Click to collapse
Manual instructions and commands:
Detailed instructions how to get ADB working between your pc and SCT
Download the Android SDK, it contains the nescesary tools like ADB.exe and Monitor.bat (Download page Android SDK)
Install the android SDK
If you are using windows: set the installation path of your SDK\platform-tools\ in your windows environment variables. So, add c:\\SDK\Platform-tools\ to it. (More instructions on this point)
Now connect your SCT to a Wifi network and also connect your laptop/pc to the same wifi network. This network can be your home network, or for example the wifi network you create with your phone wifi-tether function.
Go into the SCT>Settings>Wifi and click on your connection details. Find out the IP adress of your SCT. (example, it would be something like 192.168.43.x if you are using wifi tether from your android phone. )
Now on your pc, open the command line (cmd). Easiest is to click with shift-button hold and with Right-Mouse-Button on the folder where the files reside you want to transfer to the SCT (see instructions further for rooting). After RMB click, choose option: open command line here.
Now type:
Code:
adb connect $IPADDRESS
Replace $IPADRESS with the IP from the previous step.
ADB is now connected and you are ready to type the instructions for rooting.
Code:
D:\sdk\platform-tools>adb connect 192.168.43.5
connected to 192.168.43.5:5555
Detailed instructions how to Root SCT
Download the cmd-frama-working.zip from the attachments
Attachment
Unzip it into a folder (example: d:\sct\ )
Open the commandline in this folder
Connect to adb (see instructions above)
Do the following commands (line by line):
Usage:
Code:
adb push libframalib.so /data/local/.
adb push sploit.jar /data/local/.
adb shell mkdir /data/local/tmp/dalvik-cache
adb shell ANDROID_DATA=/data/local/tmp LD_LIBRARY_PATH=/data/local dalvikvm -cp /data/local/sploit.jar com.alephzain.framaroot.FramaAdbActivity Gimli 0
[or]
adb shell ANDROID_DATA=/data/local/tmp LD_LIBRARY_PATH=/data/local dalvikvm -cp /data/local/sploit.jar com.alephzain.framaroot.FramaActivity Gimli 0
See post here and thank developer!
Now you are rooted:
Code:
cmd line frama root by Gekkekkoe
Credits to alephzain for Framalib
using Exploit: Gimli choice: 0
Executing Check
idx: 0 value: Gimli
idx: 1 value: Aragorn
Executing Check Completed
No such user 'root:root'
No such user 'root:root'
Result: 0
Test root by command:
Code:
adb shell
su
id
On the SCT you will get a screen of SuperSU, asking if shell may have root access privileges. Say yes.
exit the su and shell using
Code:
exit
exit
Reboot the SCT
If you are still within shell, just use
Code:
reboot
If you are on command line again, use
Code:
Adb Reboot
Detailed instructions how to get Google framework and Google Play (market) on the SCT
Download the files for framework and market
Framework
Market
Push them to your SCT
Code:
adb shell su root -c 'mount -o remount,rw ubi0:system /system'
adb push GoogleServicesFramework-2.2.1.apk /data/local/.
adb push Market-3.3.11.apk /data/local/.
adb shell
Now install them
Code:
cp /data/local/*.apk /system/app/.
chmod 644 /system/app/GoogleServicesFramework-2.2.1.apk
chmod 644 /system/app/Market-3.3.11.apk
reboot
After reboot, connect the SCT to internet
Open the google market on your SCT (in the applications drawer)
Log in with your google credentials
Accept terms and conditions
Be sure to stay connected to internet, google market will update itself after some minutes
Connect Adb and force SCT to reboot again.
Open Market/Play and Accept terms and conditions again! (now for the updated versions)
Wait for some time, it will again update itself again.
Open adb, force reboot again
Last time open Play (It should be named Play now, since it is updated, if it is not, wait longer and try previous steps again)
Go into My Apps, update SuperSu
After update, open SuperSu from your app drawer
It will ask to update SuperSu Binary, use Normal Method
Say thanks to Chainfire for the SuperSu
In settings, you can disable the popup that will ask if you want to run an App that is using root. Can be convenient, but also dangerous (apps can use root even without notifying you.)
Detailed instructions how to installation of other apps
We have to enable installing all apps on SCT. Warning, this means editing the build.prop, which is vital to the system. Typing errors can result in a system that will not boot correctly.
More methods apply here, use one which is convenient to you:
Fast method:
Code:
adb shell
mount -o remount,rw ubi0:system /system
sed -i 's/ro.parrot.install.allow-all=false/ro.parrot.install.allow-all=true/' /system/build.prop
Slow method, more control, moderate risk:
Code:
adb pull /system/build.prop
edit content and set to true. Content of the file should look like this
Code:
#TODO Set to false for prod #Package install limitations. Set to false to allow only the install of verified packages
ro.parrot.install.allow-all=true
replace build.prop with proper one.
Code:
adb shell su root -c 'mount -o remount,rw ubi0:system /system'
adb push build.prop /system/build.prop
If above does not work, use method like the google framework.
Third method: install ES file explorer, use the rooting functions of this app to edit build.prop
Instructions in this post and this post
Detailed instructions how to install APK files
Method 1: Use google play
Method 2: If not available on google play, use a Google Play APK downloader on your pc and install using the
Code:
ADB install
or using
ES Fileexplorer mentioned above
Detailed instructions how to make apps available during driving
All apps are behind a security wall of the SCT. When driving >5km/h, all apps not listed in the whitelist.xml will be disabled. To enable your installed apps you have to edit the whitelist.xml
Warning: it is a safety feature you are disabling now, it is your own responsability when using apps during driving
Slow method:
Get the whitelist.xml from your SCT
Code:
adb pull /system/etc/whitelist.xml
Find out which packages are installed and have to be listed there:
Code:
adb shell
pm list packages
Other method, look to the url of google play on your pc, see bold part: https://play.google.com/store/apps/details?id=com.estrongs.android.pop
List the packages by adding new lines with the package names
Edit the whitelist.xml using a smart text editor. Preferably use Notepad++
Copy the whitelist back to SCT
Code:
adb push whitelist.xml /data/local
adb shell
su
mount -o remount,rw ubi0:system /system
cp /data/local/whitelist.xml /system/etc
reboot
Scripted method:
Download script
Instructions in this post
FAQ
Audio is not working when using application X
This is a feature or limitation by design
- TomTom and other navigation apps will break Sound/Audio due to this feature.
If you have more, PM me or react in topic
TIPS
Use a USB keyboard in combination with ES file explorer or a Shell app to edit files on the system.
If you have more, PM me or react in topic
Informational links:
Information about SCT:
http://www.volvocars.com/intl/sales-services/sales/sensus-connected-touch/pages/default.aspx
Official FAQ of SCT:
http://www.volvocars.com/intl/top/support/pages/sensus-connected-touch-faq.aspx
Dutch experiences with SCT:
http://www.volvo-forum.nl/viewtopic.php?t=54935&postdays=0&postorder=asc&start=0
SCT update files:
http://www.parrot.com/nl/support/sensus-connected-touch
Current version: All regions - 1.49.34
How to unpack the update (.plf) files:
Download the plftool
Basically, download, unzip, and go into the command line, the binaries directory and use the command syntax, "plftool -i -o "
And please take the time to thank hoppy_barzed for hosting it for us and for loveshackdave for providing the tool to use it.
Linked topic of Parrot Asteroid Smart:
http://forum.xda-developers.com/showthread.php?t=2118432
Developments of other users (copied from PAS topic)
donaldta said:
Alright, I found an interesting startup script for the SCT. The path inside the archive is "FileSystem\system\etc\set_adb_usb.sh"
Code:
#!/system/bin/sh
#
# Author: Yann Sionneau <[email protected]>
#
# This script is called by a udev rule when a cable is plugged in USB0 port.
# This script sets adb.tcp.port to -1 meaning that ADB will then listen on USB
# instead of TCP/IP.
# Then this script will restart adbd service
export PATH=/system/bin:/system/xbin
if [ -f /tmp/cache/others/adb_usb ]
then
exit 0
fi
touch /tmp/cache/others/adb_usb
setprop
service.adb.tcp.port -1
stop adbd
start adbd
This leads me to believe the Android Debug Bridge (ADB) is running over TCP by default, sort of like on the original Google TV. So, you might be able to download the Android Developer Tools. Unzip it, and then at the command line use "platform-tools\adb connect <IP.address.of.SCT>" to connect to your SCT and install third party apps by either using "platform-tools\adb install <package_name>" or use the GUI, "\tools\monitor.bat" Either than or try and figure out which port on the SCT is USB 0 which turns into a ADB port when something is connected to it.
On a side note, I'm a little tired of having to respond to people about giving access to the SCT software when it is already available. The download is listed above, I fixed the link to make it even easier. All anyone needs to extract the files from the archive is the plftool that loveshackdave created and mentioned in this post.
loveshackdave said:
Okay, I've posted the binaries and source for my .NET plftool project here. I've handled the symlink sections by simply creating a file called [filename].simlink that contains the section data. The should be fine for rebuilding the plf file. I've still got to handle the file permissions byte and figure out what the 2 unknown uint's are in the file_action header. the permissions shouldn't be too much of an issue, I'm thinking of creating a filesystem meta-data file that will hold all this information for rebuilding, unless anyone has any better ideas.
Click to expand...
Click to collapse
Basically, download, unzip, and go into the command line, the binaries directory and use the command syntax, "plftool -i <input_file> -o <output_directory>"
And please take the time to thank hoppy_barzed for hosting it for us and for loveshackdave for providing the tool to use it.
Click to expand...
Click to collapse
johnnie_w said:
I succeeded in connecting to SCT over ADB. ADB is indeed enabled over TCP/IP by default. So I tried to install an apk:
Code:
C:\android\adt-bundle-windows-x86-20130911\sdk\platform-tools>adb install c:\android\apk\Framaroot-1.6.0.apk
285 KB/s (2124410 bytes in 7.265s)
pkg: /data/local/tmp/Framaroot-1.6.0.apk
Failure [INSTALL_FAILED_INVALID_APK]
Hmm, this didn't work. The logcat output:
Code:
D/AndroidRuntime( 2786): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 2786): CheckJNI is OFF
D/dalvikvm( 2786): creating instr width table
D/AndroidRuntime( 2786): Calling main entry com.android.commands.pm.Pm
D/dalvikvm( 2041): GC_EXPLICIT freed 10K, 50% free 2735K/5379K, external 2801K/3132K, paused 44ms
W/ActivityManager( 1366): No content provider found for:
W/ActivityManager( 1366): No content provider found for:
D/PackageParser( 1366): Scanning package: /data/app/vmdl-1074467422.tmp
W/PackageParser( 1366): Signatures files not found.
D/PackageManager( 1366): Scanning package com.alephzain.framaroot
W/PackageParser( 1366): Signatures files not found.
W/PackageManager( 1366): Package couldn't be installed in /data/app/com.alephzain.framaroot-1.apk
It looks like it's searching for a specific file. This is probably because installation from Unknown Sources is disabled, and I can't enable it in the sqlite database because it's not readable without root. Hmm, chicken and egg problem. Any help would be greatly appreciated!
Click to expand...
Click to collapse
donaldta said:
Okay, let's try installing something a little more legitimate than Framaroot first, since that absolutely needs the "unknown sources" to be enabled. We might have to learn how to crawl before we can run.
It seems like it is looking for the package's signature file. Try something like ESFileExplorer_120.apk or another Android Market app which should have the proper signatures inside of it. I tested it myself on the Asteroid Smart by uninstalling ES File Explorer, disabling "Unknown Sources", rebooting it, and then re-installing it via ADB.
Otherwise try other things such as "adb remount" which remounts the rootfs as writeable, "adb push <package_name.apk> /data/app" this attempts to copy the packing into the user's install directory, "adb push <package_name.apk> /data/system" this attempts to copy the package into the system. If you're used to linux command line then play around with "adb shell" to see what opportunities exists. Is this where you tried "sqlite3 /data/data/com.android.providers.settings/databases/settings.db"? If you can't do it directly, maybe copy settings.db to the sdcard and use sqlite3 to edit it then copy the modified version over? Unfortunately, I don't have a SCT so we'll need someone with one that can tinker with linux/android to help find a way.
Click to expand...
Click to collapse
Nice work
How to get ADB working?
ADB is enabled over TCP/IP by default. This means that you only need to get the IP address of the device, and you can connect to it using
Code:
adb connect $IPADDRESS
when connected to the same network. If you want to connect over USB, just plug in a USB cable in USB0 (I don'tknow yet which one this is), and ADB should switch to USB.
What can we do with ADB?
I only tried once, but I was able to get a shell. Busybox is installed, so all regular Linux commands are available. The /data directory is not accessible directly, we need root for that.
Can I just install Framaroot?
No, I wasn't able to install Framaroot directly. It complained about the signature, which is probably caused by the fact that installation from unknown sources is disabled.
So, what is the first step to be done?
I think the first step is to enable installation from unknown sources, and then install a filemanager or root the SCT. This can be done with something like:
Code:
adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db
sqlite3 settings.db "update secure set value=1 where name='install_non_market_apps';"
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
So let's try and fix this thing!
Thanks for the topic! Of course I'll be following closely!
santu001 said:
Thanks for the topic! Of course I'll be following closely!
Click to expand...
Click to collapse
Same here!
If I can be of any help (although I can't see how )
Since we can't change the setting non_market directly, android central developed a script to install without modify.
Maybe we can try this one?
http://forums.androidcentral.com/an...-central-sideload-wonder-machine-v-1-2-a.html
Only prerequisite is connection over ADB. No root required.
Hmm, looking into the sources it seems just a pair of batch files. I don't see magic inside it, other then a plain ADB install command.
johnnie_w said:
I think the first step is to enable installation from unknown sources, and then install a filemanager or root the SCT. This can be done with something like:
Code:
adb pull /data/data/com.android.providers.settings/databases/settings.db settings.db
sqlite3 settings.db "update secure set value=1 where name='install_non_market_apps';"
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
So let's try and fix this thing!
Click to expand...
Click to collapse
I think the first step is to test installing packages other than Framaroot, maybe something from the Google Play Store or Asteroid Market via ADB.
getiem said:
Since we can't change the setting non_market directly, android central developed a script to install without modify.
Maybe we can try this one?
http://forums.androidcentral.com/an...-central-sideload-wonder-machine-v-1-2-a.html
Only prerequisite is connection over ADB. No root required.
Hmm, looking into the sources it seems just a pair of batch files. I don't see magic inside it, other then a plain ADB install command.
Click to expand...
Click to collapse
I believe that is because ADB is considered a "trusted source", so you can install software through it. This is how AT&T users were able to install Android Packages a long time ago while the Market app wasn't available and the "allow unknown sources" option was removed from settings. The only caveat is that the packages needs to be signed.
donaldta said:
I think the first step is to test installing packages other than Framaroot, maybe something from the Google Play Store or Asteroid Market via ADB.
Click to expand...
Click to collapse
I agree on that. I have downloaded several APK's to my laptop and will test in a few hours. I'll let you know!
johnnie_w said:
I agree on that. I have downloaded several APK's to my laptop and will test in a few hours. I'll let you know!
Click to expand...
Click to collapse
Btw, I found this topic on Stack Overflow particularly interesting.
Android Known Sources
So I have looked through the Android Open Source Project (AOSP) Source code now to see how that Unknown Sources check is done. It is more complicated than known source = android play.
So first of all for background, that Unknown Sources check and message are generated by INSTALL_NON_MARKET_APP. This flag comes up in few places, but the main place is in PackageInstallerActivity. Infact, this is the only place in AOSP where it comes up and is used to some effective degree. Let's look at that here:
Code:
String callerPackage = getCallingPackage();
if (callerPackage != null && intent.getBooleanExtra(
Intent.EXTRA_NOT_UNKNOWN_SOURCE, false)) {
try {
mSourceInfo = mPm.getApplicationInfo(callerPackage, 0);
if (mSourceInfo != null) {
if ((mSourceInfo.flags&ApplicationInfo.FLAG_SYSTEM) != 0) {
// System apps don't need to be approved.
initiateInstall();
return;
}
}
} catch (NameNotFoundException e) {
}
}
if (!isInstallingUnknownAppsAllowed()) {
//ask user to enable setting first
showDialogInner(DLG_UNKNOWN_APPS);
return;
}
initiateInstall();
So PackageInstaller is a package included with AOSP that understands how to handle the ACTION_VIEW intent for APK files. PackageInstaller checks two things before it allows an app to be installed.
That the app is a system app. If an app is a system app, it doesn't care, it tells the package manager to install your app. This means that if Samsung puts their Samsung market store as a system app on Samsung devices, then it is automatically a trusted source. Infact, it will skip step 2 here.
If that system flag is not set. If that flag is not set, and thus you are not a system app, then therefore you are not a trusted source. That being said, System apps can also skip the package installer and just go straight to calling the hidden function installPackage which can be found in PackageManagerService. This seems to be what the GooglePlayStore does, as when I disable the installation capabilities on PackageInstallerActivity I can still install apks just fine.
So to sum up: Known sources are SYSTEM APPS not just applications downloaded from google play. Google play completely circumvents the INSTALL_NON_MARKET_APP flag because it does not use the PackageInstaller. If you create an app that is not a system app, your only method for installing APKs is to use the PackageInstaller. Since your app is not a system app it will check to see if unknown sources is disabled.
Click to expand...
Click to collapse
donaldta said:
Btw, I found this topic on Stack Overflow particularly interesting.
Click to expand...
Click to collapse
There is also a second system, app verification. Does that come into play here?
http://www.androidos.in/2013/07/google-brings-verify-apps-support-to-android-2-3-or-higher/
https://support.google.com/accounts/answer/2812853?hl=en
getiem said:
There is also a second system, app verification. Does that come into play here?
http://www.androidos.in/2013/07/google-brings-verify-apps-support-to-android-2-3-or-higher/
https://support.google.com/accounts/answer/2812853?hl=en
Click to expand...
Click to collapse
As far as I know that check made during sideloading apps for devices with Android 4.2 and above. Otherwise, it is only checked via Android Market/Google Play for Android 2.3 devices and above. Since none of the Parrot devices have the Google Market it is probably a moot point. I guess Parrot / Volvo could have back ported it into the SCT and Framaroot might be picked up as Malware. But, not every app would be flagged as malware.
---------- Post added at 09:18 AM ---------- Previous post was at 08:47 AM ----------
getiem said:
Volvo Sensus Connected Touch (SCT) is a new car audio-navi system based on the Parrot Asteroid Smart (PAS). SCT differs in hardware and software from the PAS. Software looks about 90% equal, with some more restrictions build in by Volvo
Click to expand...
Click to collapse
Btw, this is a bit misleading, According to the build.prop on the SCT...
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=V01.47.88_Volvo_EU
ro.build.display.id=V01.47.88_Volvo_EU
ro.build.version.incremental=
ro.build.version.sdk=10
ro.build.version.codename=REL
ro.build.version.release=2.3.7
ro.build.date=mercredi 28 août 2013, 19:05:30 (UTC+0200)
ro.build.date.utc=1377709530
ro.build.type=user
ro.build.user=Parrot
ro.build.host=FR-B-800-0057
ro.build.tags=release-keys
ro.product.model=ACU Volvo
ro.product.brand=AFM
ro.product.name=fc6100_volvo
ro.product.device=fc6100_volvo
ro.product.board=fc6100-android
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=Parrot
ro.product.locale.language=en
ro.product.locale.region=GB
ro.wifi.channels=
ro.board.platform=omap3
# ro.build.product is obsolete; use ro.product.device
ro.build.product=fc6100_volvo
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=fc6100_volvo-user 2.3.7 V01.47.88_Volvo_EU release-keys
ro.build.fingerprint=AFM/fc6100_volvo/fc6100_volvo:2.3.7/V01.47.88_Volvo_EU/:user/release-keys
# end build properties
# system.prop for FC6100 Volvo
# This overrides settings in the products/generic/system.prop file
#
Click to expand...
Click to collapse
The system is based on the Parrot FC6100 not the Parrot Asteroid Smart. And looking at the Installation manual for Sensus Connected Touch (ACU) Accessory, Part Number: 31399165 the form factor is closer to the Parrot Asteroid Tablet (PAT). The only similarity that the SCT has with the PAS is Parrot's custom base of the Android 2.3 branch which is also shared by the PAT. So, if anything is more analogous to the Parrot Asteroid Tablet (PAT) than the Parrot Asteroid Smart.
donaldta said:
As far as I know that check made during sideloading apps for devices with Android 4.2 and above. Otherwise, it is only checked via Android Market/Google Play for Android 2.3 devices and above. Since none of the Parrot devices have the Google Market it is probably a moot point. I guess Parrot / Volvo could have back ported it into the SCT and Framaroot might be picked up as Malware. But, not every app would be flagged as malware.
---------- Post added at 09:18 AM ---------- Previous post was at 08:47 AM ----------
Btw, this is a bit misleading, According to the build.prop on the SCT...
The system is based on the Parrot FC6100 not the Parrot Asteroid Smart. And looking at the Installation manual for Sensus Connected Touch (ACU) Accessory, Part Number: 31399165 the form factor is closer to the Parrot Asteroid Tablet (PAT). The only similarity that the SCT has with the PAS is Parrot's custom base of the Android 2.3 branch which is also shared by the PAT. So, if anything is more analogous to the Parrot Asteroid Tablet (PAT) than the Parrot Asteroid Smart.
Click to expand...
Click to collapse
Well...good info! Another part of the puzzle
THANK YOU
Thank you very much guys for this VERY IMPORTANT thread !!
I'll follow carefully cause the SCT is really unusable at this moment with no apps and a lot bugs.
THANK YOU
@getiem
Maybe updating your opening post with the updated information!
BTW... Great Topic!
We're getting somewhere...
So thanks to all who contribute.
Yesterday I tried to install several APK's, including ES File Explorer. Unfortunately the same error message:
Code:
C:\android\adt-bundle-windows-x86-20130911\sdk\platform-tools>adb install c:\and
roid\apk\ESFileExplorer_120.apk
466 KB/s (3949829 bytes in 8.273s)
pkg: /data/local/tmp/ESFileExplorer_120.apk
Failure [INSTALL_FAILED_INVALID_APK]
I haven't tried pulling or pushing anything yet, will do that tonight.
santu001 said:
@getiem
Maybe updating your opening post with the updated information!
Click to expand...
Click to collapse
Done.
ps, I will be updating regularly the OP, but interval will be weeks, not daily or hourly. Especially weekends, I will be offline.
ps 2. Yesterday i recieved my new car with SCT. I will test the whole car first before hacking into the SCT myself.
Great
Thanks for all the efforts here. I'll be following closely
Maybe the app should be on whitlelist.xml? Try to rename the app?
I was trying to install the SCT launcher to Tablet and the catlog system says: package has no signatures matching those in shared user android.uid.system
Any methods to come over this?
jaanusj said:
Maybe the app should be on whitlelist.xml? Try to rename the app?
Click to expand...
Click to collapse
The /etc/whitelist.xml file is a list of android packages which can be running regardless of the parking brake detection. Each permutation will use the following syntax, <package name="{android.package.name}"/>, where the {android.package.name} uses the full Java-language-style package name for the application. This is listed in the APK's AndroidManifest.xml file as the "manifest package=" definition and will become the filename for the app when installed in either the /system/app or /data/app directories.
Incidentally, the java style package name also how each app is identified through the Google Play store. For example, <package name="com.tomtom.uscanada"/> can be found on Google Play via https://play.google.com/store/apps/details?id=com.tomtom.uscanada
jaanusj said:
I was trying to install the SCT launcher to Tablet and the catlog system says: package has no signatures matching those in shared user android.uid.system
Any methods to come over this?
Click to expand...
Click to collapse
Apparently, there's a way to disable signature checking by decompiling, modifying, and recompiling /system/framework/service.jar. I've never done this, so I'm not exactly comfortable with it but there are plenty of threads on XDA in regards to the topic.
There is also the Lucky Patcher app that apparently can patch core.jar to disable signature verification. It has some other security defeating functions but again, I've never used it myself so you'll have to do your own research.
Btw, when a package is complaining about "shared user", this usually points to the /data/system/packages.xml where the sharedUserId for the respective package are stored. Ultimately, this allows packages with the same sharedUserId to communicate with one another since they will be running in the same virtual machine.
johnnie_w said:
Yesterday I tried to install several APK's, including ES File Explorer. Unfortunately the same error message:
Code:
C:\android\adt-bundle-windows-x86-20130911\sdk\platform-tools>adb install c:\and
roid\apk\ESFileExplorer_120.apk
466 KB/s (3949829 bytes in 8.273s)
pkg: /data/local/tmp/ESFileExplorer_120.apk
Failure [INSTALL_FAILED_INVALID_APK]
I haven't tried pulling or pushing anything yet, will do that tonight.
Click to expand...
Click to collapse
Well, that is disappointing. I take it that you're still getting the "Signatures files not found" syntax errors from "logcat -d' while this is occuring? I'm wondering if the problem is the reverse of what jaanusj is trying to accomplish by installing AcuHome.apk on his Parrot Asteroid Tablet. And by that signatures do exist in the packages but maybe they're not being recognized as valid because the ROM isn't aware of them.
A good test for this is to install a package from the Asteroid Market, download it using "adb pull", uninstall the app, then try a "adb install" or "adb push" to reinstall it.
I tried to pull and push an APK, no luck. Pulling worked but I couldn't push it back to /system/app. We need root rights for this apparently. Also for patching the jar file or using the Lucky Patcher we need root. I'm wondering what the device is looking for. We have to find that out, maybe we can modify APK's so it does accept them. Any other ideas?

[Q] debian kit fails

Did anyone successfully install debian kit on the galaxy note 10.1 (2014) ?
I tried,
sh /storage/emulated/0/debian-kit-1-6.shar
unpacks properly, but then nothing happens. A wizard is supposed to start.
I tried both 1-6.shar from Doviak, and 1-5.shar from sven-ola
I did the following. Start with unrooted device. Accept KK OTA upgrade. Now
I have SM-P600 with Android 4.4.2. Root with CF. This fails.
Flash openrecovery-twrp-2.6.3.3-lt03wifiue.img.tar with Odin. Then boot into TWRP and
install UPDATE-SuperSU-v1.94.zip. Now some apps ask for root access and it seems to be
granted; installed sdfix, and at least one app (aplinequest) that could not write after
the KK upgrade can now write to extsdcard.
Installed Debian Kit app. All green checks, except red Xs for "Kernel modules supported"
and "Valid 'su' command found". But I know su is working. (I think there was a red X by Debian
Kit already unpacked)
Transfer debian-kit-1-6.shar to device. I follow instructions, Install connectbot. Give 'su'.
Run sh /storage/emulated/0/debian-kit-1-6.shar
Get error messages (I didnt record them), such as md5sum not found, and
a couple of other binaries not found. I give echo $PATH and then look for these binaries
in my path. They are not there. So I install BusyBox Free. Run the shar file again. I
get a list of files extracted, but then nothing happens. Now I see that debian kit wants
to use its own busybox and I didnt need to install busybox, but debian kit did not work
in any case.
I try to run /data/local/deb/autorun with sh autorun. Exits with "Unsupported CPU or architecture"
Investigate and find shell var CPU is set correctly to "armel" on first past, but when the script
runs again with exec, CPU is ''. So I hardcode CPU=armel. Then I can get a little further.
And so on and so on, hardcoding CPU in all the scripts. Trying to get the scripts to see the
correct binaries, etc. Now I have a diskimage installed, can't go forward and can't uninstall.
If anyone can shed some light....
update
Deleted everything and started over. Using adb shell. I notice
that the installer says
Included busybox failed.
and tries to use system tar, sed, etc, which it cannot find.
However, If I put #!/system/bin/sh at the top of debian-kit-1-5.shar
And run ./debian-kit-1-5.shar rather than sh ./debian-kit-1-5.shar,
then the script runs for quite a while and extracts a lot of files.
It fails eventually with
ash: id: Permission denied
In fact, from the adb shell I get
126|[email protected]:/data/local # id
uid=0(root) gid=0(root) context=u:r:init:s0
[email protected]:/data/local # ./deb/armel/busybox ash -c "id"
ash: id: Permission denied
126|[email protected]:/data/local # ./deb/armel/busybox ash -c "/system/bin/id"
ash: /system/bin/id: Permission denied
More Update
It seems that in some cases the user 'shell' has permission to do something, but 'root' does not.
One thing stopping the debian kit install process is that root running a shell located under /data cannot run any executables via
passing a string on the command line. They can run commands interactively (maybe because the command
line uses exec ?). But the user 'shell' can run executables this way. E.g. I copied /system/bin/mksh to the /data partition.
[email protected]:/ $ su
[email protected]:/ # /data/local/bin/mksh -c "id"
/data/local/bin/mksh: id: Permission denied
1|[email protected]:/ # /system/bin/mksh -c "id"
uid=0(root) gid=0(root) context=u:r:init_shell:s0
[email protected]:/ # su shell
[email protected]:/ $ /data/local/bin/mksh -c "id"
uid=2000(shell) gid=2000(shell) context=u:r:init:s0
There are a few posts scattered around other forums mentioning the same problem when trying to
install debian kit, but no responses even recognized that there was a problem.
The solution was to install an selinux permissive kernel. Then installation
went normally.
I think I can help.
injola said:
Did anyone successfully install debian kit on the galaxy note 10.1 (2014) ?
I tried,
sh /storage/emulated/0/debian-kit-1-6.shar
unpacks properly, but then nothing happens. A wizard is supposed to start.
I tried both 1-6.shar from Doviak, and 1-5.shar from sven-ola
I did the following. Start with unrooted device. Accept KK OTA upgrade. Now
I have SM-P600 with Android 4.4.2. Root with CF. This fails.
Flash openrecovery-twrp-2.6.3.3-lt03wifiue.img.tar with Odin. Then boot into TWRP and
install UPDATE-SuperSU-v1.94.zip. Now some apps ask for root access and it seems to be
granted; installed sdfix, and at least one app (aplinequest) that could not write after
the KK upgrade can now write to extsdcard.
Installed Debian Kit app. All green checks, except red Xs for "Kernel modules supported"
and "Valid 'su' command found". But I know su is working. (I think there was a red X by Debian
Kit already unpacked)
Transfer debian-kit-1-6.shar to device. I follow instructions, Install connectbot. Give 'su'.
Run sh /storage/emulated/0/debian-kit-1-6.shar
Get error messages (I didnt record them), such as md5sum not found, and
a couple of other binaries not found. I give echo $PATH and then look for these binaries
in my path. They are not there. So I install BusyBox Free. Run the shar file again. I
get a list of files extracted, but then nothing happens. Now I see that debian kit wants
to use its own busybox and I didnt need to install busybox, but debian kit did not work
in any case.
I try to run /data/local/deb/autorun with sh autorun. Exits with "Unsupported CPU or architecture"
Investigate and find shell var CPU is set correctly to "armel" on first past, but when the script
runs again with exec, CPU is ''. So I hardcode CPU=armel. Then I can get a little further.
And so on and so on, hardcoding CPU in all the scripts. Trying to get the scripts to see the
correct binaries, etc. Now I have a diskimage installed, can't go forward and can't uninstall.
If anyone can shed some light....
Click to expand...
Click to collapse
I have the same tablet and I tried to answer you several times but when I give exact instructions they don't let my reply get to the thread for some reason. So I'll have to be less specific, sorry. Anyway. I rooted with an omnirom based setup. 412. Homemade. Once you get the debian-kit-1-6-testing.jpeg and you've unloaded it to you your root directory try:
#sh /data/local/deb/mk-debian -i
Follow the usage correctly and until your done testing leave:
-h
At the end of the script. But be sure to set it to armel and 2047 and wheezy and set the mirror to:
deb. .org/dists/wheezy/ main contrib non-free
Kali
catch all the protools and for the gpg licence use google search my username KeizerPaPa and I'll give you the gpg on my + account. Goodluck. ]
---------- Post added at 06:40 PM ---------- Previous post was at 06:28 PM ----------
KeizerPaPa said:
I have the same tablet and I tried to answer you several times but when I give exact instructions they don't let my reply get to the thread for some reason. So I'll have to be less specific, sorry. Anyway. I rooted with an omnirom based setup. 412. Homemade. Once you get the debian-kit-1-6-testing.jpeg and you've unloaded it to you your root directory try:
#sh /data/local/deb/mk-debian -i
Follow the usage correctly and until your done testing leave:
-h
At the end of the script. But be sure to set it to armel and 2047 and wheezy and set the mirror to:
deb http .org/dists/wheezy/ main contrib non-free
Kali
catch all the protools and for the gpg licence use google search my username KeizerPaPa and I'll give you the gpg on my + account. Goodluck. ]
Click to expand...
Click to collapse
Make sure you piece the above together correctly, they wouldnt let me type it all together. Thats deb http: //http
Then .kali then .org/dists....... have fun. If ya get stuck on the gpg search me and ask. KeizerPaPa
A reason why mine failed at first was because "Debian kit" is set to resolve ip addresses using "only" your Primary DNS Server (DNS 1). When I finally pinged my Primary DNS server, I found it was not functional. My Secondary DNS server (DNS 2) was functional (this also explains why my internet was slower than it should have been while browsing the internet)
I changed my Primary DNS server by
1) going into the WIFI settings
2) long-pressing on the WIFI I was connected to
3) choosing "Mofify..."
4) checking the "Show advanced..." option
5) changing from "DHCP" to "Static"
6) entering a functional DNS server (such as 8.8.4.4) for "DNS 1"
- Hyp

Download Acceleration

Is it possible to accelerate downloads on Android using multiple connections just like IDM does in pc
Sent from my Galaxy Nexus using Tapatalk
Wrong thread
Actually I am looking for some mod that will enable this
Sent from my Galaxy Nexus using Tapatalk
This should be in Q&A section. Anyway I think isn't possible to accelerate downloads. Maybe you can try this: https://play.google.com/store/apps/details?id=com.download.internet.download.manager.nivax
CoDe LaZaRuS said:
Is it possible to accelerate downloads on Android using multiple connections just like IDM does in pc
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
I haven't really seen any apps that do it. You can always try using the command line though. I've attached a common linux binary I compiled called "axel" which can be used to download a file using multiple connections, e.g., download with <n> max connections:
Code:
axel -n <n> <download_url>
Unfortunately I've had some trouble making the connections which has something to do with the /etc/resolv.conf. The binary is good, I just need to figure out how to fix this /etc/resolv.conf error. I get the same error using "aria", a similar but more advanced multi-connection downloader.
It might be worth checking out and seeing if you can solve the error, especially if you use your phone sometimes to download large 1gb size media.
edit: I went ahead and compiled aria2c. I've tested it downloading a few files and it works. There were still a few urls I tried that I had to use wget or curl with, but it's a good tool to use a first try.
Code:
aria2c -s <n> <url|uri|magnet|torrent|...>
Aria's a very powerful tool, so you can use it with a bunch of different download types.
7175 said:
I haven't really seen any apps that do it. You can always try using the command line though. I've attached a common linux binary I compiled called "axel" which can be used to download a file using multiple connections, e.g., download with <n> max connections:
Code:
axel -n <n> <download_url>
Unfortunately I've had some trouble making the connections which has something to do with the /etc/resolv.conf. The binary is good, I just need to figure out how to fix this /etc/resolv.conf error. I get the same error using "aria", a similar but more advanced multi-connection downloader.
It might be worth checking out and seeing if you can solve the error, especially if you use your phone sometimes to download large 1gb size media.
edit: I went ahead and compiled aria2c. I've tested it downloading a few files and it works. There were still a few urls I tried that I had to use wget or curl with, but it's a good tool to use a first try.
Code:
aria2c -s <n> <url|uri|magnet|torrent|...>
Aria's a very powerful tool, so you can use it with a bunch of different download types.
Click to expand...
Click to collapse
Seems exactly what i need but how do i use it
Sent from my Galaxy Nexus using Tapatalk
CoDe LaZaRuS said:
Seems exactly what i need but how do i use it
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
So yeah I'd definitely say just go with using aria instead axel. Axel has less options,abilities,functionality and I may have broken the binary when I stripped it(removed debugging symbols to make it smaller). Basically to install it, you want to download the aria2c.zip file. Then unzip it to /system/bin in Android Terminal Emulator with:
Code:
busybox mount -o rw,remount /system
busybox unzip /sdcard/Download/aria2c.zip -d /system/bin
busybox chmod 0555 /system/bin/aria2c
busybox mount -o ro,remount /system
You could also use your favorite root file manager. I find the terminal faster these days though.. Now that aria's installed you can download a file like http://download.zip(just an example url, pro'lly doesn't work) splitting the connection 5 ways for more speed with:
Code:
aria2c -s 5 -d /sdcard/Download http://download.zip
The "-d /sdcard/Download" part will place the downloaded file in /sdcard/Download where things usually download. When you execute aria2c, a nice little terminal text interface will display showing progress and download speed. It'll give an end average download speed too, so you can compare different settings.
**If you run into problems with https links, try changing 'em to http.
Honestly, I'm surprised no one has made an aria app or a download manager utilizing the aria2c binary. You could make some beaucoup bucks if you made an app that uses aria2c, especially with the torrent abilities. I've just started getting into app development so I'll keep this in mind. A download accelerator/manager would make an excellent first project. Anyway, hope that's a little more informative about using the aria2c binary in the terminal.
7175 said:
So yeah I'd definitely say just go with using aria instead axel. Axel has less options,abilities,functionality and I may have broken the binary when I stripped it(removed debugging symbols to make it smaller). Basically to install it, you want to download the aria2c.zip file. Then unzip it to /system/bin in Android Terminal Emulator with:
Code:
busybox mount -o rw,remount /system
busybox unzip /sdcard/Download/aria2c.zip -d /system/bin
busybox chmod 0555 /system/bin/aria2c
busybox mount -o ro,remount /system
You could also use your favorite root file manager. I find the terminal faster these days though.. Now that aria's installed you can download a file like http://download.zip(just an example url, pro'lly doesn't work) splitting the connection 5 ways for more speed with:
Code:
aria2c -s 5 -d /sdcard/Download http://download.zip
The "-d /sdcard/Download" part will place the downloaded file in /sdcard/Download where things usually download. When you execute aria2c, a nice little terminal text interface will display showing progress and download speed. It'll give an end average download speed too, so you can compare different settings.
**If you run into problems with https links, try changing 'em to http.
Honestly, I'm surprised no one has made an aria app or a download manager utilizing the aria2c binary. You could make some beaucoup bucks if you made an app that uses aria2c, especially with the torrent abilities. I've just started getting into app development so I'll keep this in mind. A download accelerator/manager would make an excellent first project. Anyway, hope that's a little more informative about using the aria2c binary in the terminal.
Click to expand...
Click to collapse
Thanx alot
I want to check out aria in a bit more detail so could you provide me with the link to the thread
Sent from my Galaxy Nexus using Tapatalk
7175 said:
So yeah I'd definitely say just go with using aria instead axel. Axel has less options,abilities,functionality and I may have broken the binary when I stripped it(removed debugging symbols to make it smaller). Basically to install it, you want to download the aria2c.zip file. Then unzip it to /system/bin in Android Terminal Emulator with:
Code:
busybox mount -o rw,remount /system
busybox unzip /sdcard/Download/aria2c.zip -d /system/bin
busybox chmod 0555 /system/bin/aria2c
busybox mount -o ro,remount /system
You could also use your favorite root file manager. I find the terminal faster these days though.. Now that aria's installed you can download a file like http://download.zip(just an example url, pro'lly doesn't work) splitting the connection 5 ways for more speed with:
Code:
aria2c -s 5 -d /sdcard/Download http://download.zip
The "-d /sdcard/Download" part will place the downloaded file in /sdcard/Download where things usually download. When you execute aria2c, a nice little terminal text interface will display showing progress and download speed. It'll give an end average download speed too, so you can compare different settings.
**If you run into problems with https links, try changing 'em to http.
Honestly, I'm surprised no one has made an aria app or a download manager utilizing the aria2c binary. You could make some beaucoup bucks if you made an app that uses aria2c, especially with the torrent abilities. I've just started getting into app development so I'll keep this in mind. A download accelerator/manager would make an excellent first project. Anyway, hope that's a little more informative about using the aria2c binary in the terminal.
Click to expand...
Click to collapse
It's not working for me. Terminal Emulator keeps saying it can't find file or directory aria2c ?
Sent from my sushi grade tuna
CoDe LaZaRuS said:
Thanx alot
I want to check out aria in a bit more detail so could you provide me with the link to the thread
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
Yeah, definitely. I checked out these links:
http://aria2.sourceforge.net/
http://wiki.drupalschool.net/index.php/Aria2_How_To
Tezlastorme said:
It's not working for me. Terminal Emulator keeps saying it can't find file or directory aria2c ?
Sent from my sushi grade tuna
Click to expand...
Click to collapse
Hmm, can you post what you from:
Code:
which aria2c
Code:
echo $PATH
Code:
find /system -name aria2c
7175 said:
Yeah, definitely. I checked out these links:
http://aria2.sourceforge.net/
http://wiki.drupalschool.net/index.php/Aria2_How_To
Hmm, can you post what you from:
Code:
which aria2c
Code:
echo $PATH
Code:
find /system -name aria2c
Click to expand...
Click to collapse
Sent from my sushi grade tuna
7175 said:
Yeah, definitely. I checked out these links:
http://aria2.sourceforge.net/
http://wiki.drupalschool.net/index.php/Aria2_How_To
Hmm, can you post what you from:
Code:
which aria2c
Code:
echo $PATH
Code:
find /system -name aria2c
Click to expand...
Click to collapse
Thanks I appreciate the help
Sent from my Galaxy Nexus using Tapatalk
Sure, no problem man.
Tezlastorme said:
Sent from my sushi grade tuna
Click to expand...
Click to collapse
Thanks. Everything looks good. Not sure why you're getting that error, could you post the exact command you used so I can try it?
7175 said:
Sure, no problem man.
Thanks. Everything looks good. Not sure why you're getting that error, could you post the exact command you used so I can try it?
Click to expand...
Click to collapse
Sent from my sushi grade tuna
Tezlastorme said:
Sent from my sushi grade tuna
Click to expand...
Click to collapse
Alright, I'm pretty sure I figured it out. It turns out the binary was compiled dynamically instead of statically, even though I specified static like 4 times when compiling and the -static flag was fed to gcc and g++. So it's looking for the linker upon execution, specifically /lib/ld-linux-armhf.so.3. I've gathered together the linker and any other libs it may look for and made a package of them. I'm gonna see if I can manipulate how the source is compiled some more and see if I can force out a purely static binary since configuring the libs is a huge hassle to run it. That's weird it's been working on my phone though.
EDIT: I eventually did get a static aria2c built, but it was calling some shared libraries on execution which breaks it. The axel I posted seems to work pretty well though with links. I'm not sure what the issue I had before was, something with /etc/resolv.conf or other, but it's been working for me now, using split connections and such.
Also the reason the dynamic aria2c was working on my phone was because I've modified my whole system to include various standard linux libraries and directories, ie. /usr, /bin, /lib, etc. I might eventually make an installer that includes the bare minimal linked libraries for dynamic aria2c once I get this python project I'm working on to where I want it.
EDIT2: Found a dynamically linked aria2 build for android. Check it out. Attached.
Also here's the readme file for Android aria2:
Code:
aria2 for Android devices
=========================
aria2 is a lightweight multi-protocol & multi-source download utility
operated in command-line. It supports HTTP/HTTPS, FTP, BitTorrent and
Metalink.
Install
-------
aria2 is not an ordinary Android Java application. It is a C++ native
application and operates in command-line. You don't have to 'root'
your device to use aria2. Because aria2 is a command-line program,
you need a terminal emulator. First install Android Terminal Emulator
from Android Market (or build it from source and install. See
https://github.com/jackpal/Android-Terminal-Emulator/).
1. Copy aria2c executable to ``/mnt/sdcard`` on your device.
2. Run Android Terminal Emulator.
3. ``mkdir /data/data/jackpal.androidterm/aria2``
4. ``cat /mnt/sdcard/aria2c > /data/data/jackpal.androidterm/aria2/aria2c``
5. ``chmod 744 /data/data/jackpal.androidterm/aria2/aria2c``
6. Add the following commands to the initial command of Android
Terminal Emulator::
export HOME=/data/data/jackpal.androidterm/aria2; cd $HOME
----------
See `the online manual
<http://aria2.sourceforge.net/manual/en/html/>`_.
Notes
-----
aria2c executable was generated using android-ndk-r10b.
The following libraries were statically linked.
* openssl 1.0.1i
* expat 2.1.0
* c-ares 1.10.0
Since Android does not have ``/etc/resolv.conf``, c-ares (asynchronous
DNS resolver) is disabled by default. But name resolution is sometimes
a little bit slow, so I recommend to enable c-ares. You can enable it
using ``--async-dns`` and specify DNS servers using
``--async-dns-server`` option, like this::
--async-dns --async-dns-server=`getprop net.dns1`,`getprop net.dns2`
Because it is tedious to type these long parameters every time you use
aria2c, the following wrapper shell script would be handy::
#!/system/bin/sh
/data/data/jackpal.androidterm/aria2c \
--async-dns \
--async-dns-server=`getprop net.dns1`,`getprop net.dns2` \
"[email protected]"
Please note that you need to add executable file mode bit to this
wrapper script too. (e.g., ``chmod 744 /PATH/TO/SCRIPT``)
Known Issues
------------
* Since Android does not have ``/dev/stdout``, ``-l-`` does not work.
* Android Terminal Emulator sometimes stops updating console. It looks
like aria2c hangs, but aria2c continues to run.
To use this binary with lollipop, replace /system/bin/linker with the no-pie version that zzpianoman cooked up: http://forum.xda-developers.com/showpost.php?p=57554982&postcount=321
7175 said:
Alright, I'm pretty sure I figured it out. It turns out the binary was compiled dynamically instead of statically, even though I specified static like 4 times when compiling and the -static flag was fed to gcc and g++. So it's looking for the linker upon execution, specifically /lib/ld-linux-armhf.so.3. I've gathered together the linker and any other libs it may look for and made a package of them. I'm gonna see if I can manipulate how the source is compiled some more and see if I can force out a purely static binary since configuring the libs is a huge hassle to run it. That's weird it's been working on my phone though.
EDIT: I eventually did get a static aria2c built, but it was calling some shared libraries on execution which breaks it. The axel I posted seems to work pretty well though with links. I'm not sure what the issue I had before was, something with /etc/resolv.conf or other, but it's been working for me now, using split connections and such.
Also the reason the dynamic aria2c was working on my phone was because I've modified my whole system to include various standard linux libraries and directories, ie. /usr, /bin, /lib, etc. I might eventually make an installer that includes the bare minimal linked libraries for dynamic aria2c once I get this python project I'm working on to where I want it.
EDIT2: Found a dynamically linked aria2 build for android. Check it out. Attached.
Click to expand...
Click to collapse
I had to add 'su' to the top of initial command, otherwise I got a permission denied error, but now it works fine, thanks
Well, I haven't tested the functionality, but it does run at least.
https://play.google.com/store/apps/details?id=it.opbyte.superdownload
I bought this app to support the dev. Hope the guy comes back... Anyway, it looked like the dev stopped like a year ago. The app I linked uses data/WiFi at the same time.. There are quite a bit if apps on play that use the whole multi threading deal. The one I found to be the best for ME(and I emphasize ME because, well, you know) was ADM. That was the best I found... plenty of configurable options and because some sites only pull from one place and don't work otherwise{while downloading}. BTW, I haven't been keeping up to date for a few months. .... PONYdroid(downloading app) is on my wish list as soon as I get the cash flow back. Hope this helps a bit. [emoji41][emoji41]

Categories

Resources