[script] Theme Loader - Theme installer for all devices - Droid 2 Themes and Apps

Use at your own risk! I am not responsible for any bricked devices. You have been warned.
I have only tested this on a droid 1 so if any brave soul uses it shoot me some feedback.
Theme Loader is a script that installs custom themes for any rooted device. I wrote it because I saw some terrible instructions on how to load themes for devices that didn't have a custom recovery yet. This script should work on any device and I hope it's useful for those who do not yet have a custom recovery or who just choose to use this.
Theme Loader Script:
----------------------
----------------------
(right click and save)
Install the script:
** note: must have busybox installed **
1. Download load_theme
2. Place load_theme on the root of your sdcard
3. Download a terminal emulator app from the market
4. Open terminal and type:
PHP:
su
** mount system read/write here (need command for specific device) **
cp -f /sdcard/load_theme /system/xbin
chmod 0755 /system/xbin/load_theme
Load a theme:
1. Place all the files you want to install in a directory called "new_theme"
** for a template of how it should look like download the zip below **
2. Place the directory new_theme on the root of your sdcard
3. In terminal or adb shell type:
PHP:
su
load_theme [options]
4. Watch as your new theme installs.
load_theme options:
PHP:
Usage: load_theme [-a|-b|-c|-f|-fs|-m|-l|-r|-z|-v|-h]
Options:
-a | --apps Installs themed apps
-b | --backup Backs up current system settings
-c | --complete Installs full theme
-f | --framework Installs framework
-fs | --fonts Installs fonts
-l | --logging Disable logging for this run
-m | --media Installs media files
-r | --restore Restores system backup
-z | --zipalign Zipaligns all apks
-v | --version Print version
-h | --help This help
Always specify options as separate words
e.g. -a -f instead of -af. Its required!
Examples:
This will install the full theme and turn off logging:
PHP:
su
load_theme -l -c
This will zipalign all your apps and backup your system:
PHP:
su
load_theme -z -b

Well, I followed the directions and had a successful backup. Worked perfectly. Excellent job!
Now I just need a theme. Has anyone seen any for the rooted droid 2?????
Droid 2
OS 2.2.20
Rooted following directions in XDA thread

rummy, is does this just copy a framework or copy all images from one into the other? (in other words, does this require a droid 2 specific theme?)

I got this when I tried to load a theme, the only file in the theme was /sdcard/new_theme/framework/framework-res.apk:
Code:
# load_theme -c
load_theme -c
Zipaligning all apks...
find: not found
No themed apps found. Skipping...
No custom fonts found. Skipping...
Media not found. Skipping...
wc: not found
find: not found
-gt: unexpected operatorNo framework found. Skipping...
------------------------------------
___
| |_ _ ._ _ _ | _ _. _| _ ._
| | |(/_| | |(/_ |_(_)(_|(_|(/_|
-JRummy16
------------------------------------
Changes were made to your system requiring a reboot.
Your device will reboot in 5 seconds...

KalenXI said:
I got this when I tried to load a theme, the only file in the theme was /sdcard/new_theme/framework/framework-res.apk:
Code:
# load_theme -c
load_theme -c
Zipaligning all apks...
find: not found
No themed apps found. Skipping...
No custom fonts found. Skipping...
Media not found. Skipping...
wc: not found
find: not found
-gt: unexpected operatorNo framework found. Skipping...
------------------------------------
___
| |_ _ ._ _ _ | _ _. _| _ ._
| | |(/_| | |(/_ |_(_)(_|(_|(/_|
-JRummy16
------------------------------------
Changes were made to your system requiring a reboot.
Your device will reboot in 5 seconds...
Click to expand...
Click to collapse
odd... Looks like you don't have busybox installed because those are all busybox commands that look to be missing. But.... I put a pre-req check in the script to check for busybox so that's weird. Do you have busybox installed?

JRummy, I am getting the same errors and as far as I know busy box is installed. (all the cp commands worked fine as did titanium backup
I was experimenting with bgill55's black ice. unzipped and put each of the components in the appropriate New_theme directory.
Thanks for your help.

marsha12151 said:
JRummy, I am getting the same errors and as far as I know busy box is installed. (all the cp commands worked fine as did titanium backup
I was experimenting with bgill55's black ice. unzipped and put each of the components in the appropriate New_theme directory.
Thanks for your help.
Click to expand...
Click to collapse
ok.. I know what's going on.. Since busybox isn't symlinked it won't work properly because I forget a couple variables in spots. I'll fix it and upload tomorrow.

Related

[Q] busybox and touch command

Who can help me with the syntax of the command touch?
Using the touch command as follows:
touch -d "01/01/2012 00:00:00" \ data \ data \ com.android.providers.telephony \ databases \ mmssms.db
the system outputs the following message:
unknow option - d etc ...
But Usage Command is:
touch [-c] [-d DATE] FILE [FILE]
BR
die-hard
Yeah, that's weird. It works as you typed it in a regular linux shell, but the busybox on my android gives me the same error. Might be a bug in busybox, or perhaps the date parser in the busybox version is less tolerant on the date format. It may be a config option as well. I know that date/time parsing is very "expensive" in libc and perhaps busybox just doesn't implement it by default.
10x bro,
I solved installing busybox 1.18.0 git
My busybox touch accepts dates in ISO format:
/ # touch -d '2011-1-1 23:1' x
/ # ls -l x
-rw-rw-rw- root shell 0 2011-01-02 00:01 x
Click to expand...
Click to collapse
Hi
I have CM 10.1 with busybox 1.20.2-jb installed. Touch binary doenst have -d option:
Code:
1|[email protected]:/sdcard $ touch --h
touch --h
touch: usage: touch [-alm] [-t time_t] <file>
-t option only accept date in unix timestamp format, but default format ( [[[[cc]yy]MM]dd]hhmm[.ss] ) needed for me.
Can anybody provide touch binary with -d option support or with -t option, that accept date in this format: [[[[cc]yy]MM]dd]hhmm[.ss]?
Second question:
Code:
[email protected]:/ $ awk 'BEGIN {print mktime("1970-01-01 00 00 00")}' <
-5454000
Why awk return -5454000 instead 0?
I tried update busybox to 1.21.0 version, it doesnt help.
memtew said:
Hi
I have CM 10.1 with busybox 1.20.2-jb installed. Touch binary doenst have -d option:
Code:
1|[email protected]:/sdcard $ touch --h
touch --h
touch: usage: touch [-alm] [-t time_t] <file>
-t option only accept date in unix timestamp format, but default format ( [[[[cc]yy]MM]dd]hhmm[.ss] ) needed for me.
Can anybody provide touch binary with -d option support or with -t option, that accept date in this format: [[[[cc]yy]MM]dd]hhmm[.ss]?
Second question:
Code:
[email protected]:/ $ awk 'BEGIN {print mktime("1970-01-01 00 00 00")}' <
-5454000
Why awk return -5454000 instead 0?
I tried update busybox to 1.21.0 version, it doesnt help.
Click to expand...
Click to collapse
Use the touch inside busybox, not the one that comes with the stock rom. Install Busybox from Stericson on your android device. It has also the -d option. You must run it as root, so check that you are superuser if using a script.
Code:
su
busybox touch -c -t YYYYMMDDHHMM[.ss] yourfile
hi,
i have the command working, but is it possible to keep the date and time of each file like "vid_yyyymmdd_hhmmss.mp4" to push it in the command for each file of the folder ?
Thanks.
nobody to help ???
diabolyk said:
hi,
i have the command working, but is it possible to keep the date and time of each file like "vid_yyyymmdd_hhmmss.mp4" to push it in the command for each file of the folder ?
Thanks.
Click to expand...
Click to collapse
You want to rename the files?
scandiun said:
You want to rename the files?
Click to expand...
Click to collapse
no, just change the time of creation of the file
diabolyk34 said:
no, just change the time of creation of the file
Click to expand...
Click to collapse
Don't understand exactly what you want to do.
scandiun said:
Don't understand exactly what you want to do.
Click to expand...
Click to collapse
I have found a command that working well but I should change the files one by one and I would like to find a command which is changing all videos files of a folder.
video name for example : vid_20170717_103251.mp4
need to extract date and time (in the name of the file) to put it in the command.
here the command which is working :
busybox touch -c -t 201707171032 *
and it changes all the files of the folder with the *...
I would like to extract the elements of the name from each file to give it its own date and time.
diabolyk34 said:
I have found a command that working well but I should change the files one by one and I would like to find a command which is changing all videos files of a folder.
video name for example : vid_20170717_103251.mp4
need to extract date and time (in the name of the file) to put it in the command.
here the command which is working :
busybox touch -c -t 201707171032 *
and it changes all the files of the folder with the *...
I would like to extract the elements of the name from each file to give it its own date and time.
Click to expand...
Click to collapse
Ok to do that you need a shell (bash) script. For example this code will get the date in the format you want, now you just need to read it from files and change the timestamp accordingly.
Code:
echo vid_20110717_103251.mp4 | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//'
Test it online here: http://www.learnshell.org/
scandiun said:
Ok to do that you need a shell (bash) script. For example this code will get the date in the format you want, now you just need to read it from files and change the timestamp accordingly.
Code:
echo vid_20110717_103251.mp4 | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//'
Test it online here: http://www.learnshell.org/
Click to expand...
Click to collapse
ok thanks for your help, your code is well working
Is it possible to keep all without the seconds (last 2 digits before .mp4) ?
And after that it should put the result in the command 'busybox touch -c -t result name_of_the_file'
and how to repeat that for each file named 'vid_xxxx' ?
thanks a lot
diabolyk34 said:
ok thanks for your help, your code is well working
Is it possible to keep all without the seconds (last 2 digits before .mp4) ?
And after that it should put the result in the command 'busybox touch -c -t result name_of_the_file'
and how to repeat that for each file named 'vid_xxxx' ?
thanks a lot
Click to expand...
Click to collapse
Go to the folder of the vids with "cd /sdcard/DCIM/Videos" or the appropriate and then execute this:
Code:
for i in * ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
Make sure that in that folder there are only files that have the same exact filename pattern.
scandiun said:
Go to the folder of the vids with "cd /sdcard/DCIM/Videos" or the appropriate and then execute this:
Code:
for i in * ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
Make sure that in that folder there are only files that have the same exact filename pattern.
Click to expand...
Click to collapse
in the folder there is img and videos but if i should put videos on a separate folder i can...
this code will do all i need ? (i think missing just "busybox" in the code)
extract the name of each file without seconds, put for each one the extraction in the command : busybox touch -c -t 201707181200 vid_20170718_120000.mp4 (for example of a file of today at 12 o'clock)
diabolyk34 said:
in the folder there is img and videos but if i should put videos on a separate folder i can...
this code will do all i need ? (i think missing just "busybox" in the code)
extract the name of each file without seconds, put for each one the extraction in the command : busybox touch -c -t 201707181200 vid_20170718_120000.mp4 (for example of a file of today at 12 o'clock)
Click to expand...
Click to collapse
This code will alter only files starting with vid:
Code:
for i in vid* ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
You can try with or without busybox first and see which one works for you.
scandiun said:
This code will alter only files starting with vid:
Code:
for i in vid* ; do touch -c -t "$(echo $i | sed 's/vid_*//' | sed 's;.mp4*;;' | sed 's/_//' | sed 's/..$//')" "$i" ; done
You can try with or without busybox first and see which one works for you.
Click to expand...
Click to collapse
thank you very much i will try this in an hour to send you the answer if it's working or not
are you a developper ? cause it seems very hard to know all that...
i have another question, is it possible to put 1 or 2 less than the hour because of GMT ?
201707172000 should be 201707171900...
the answer of the command (not working) is :
touch: invalid date 'VID20170717_2000'
repeat for all lines....
i think it keep too many characters.
characters keeped should be 201707172000 (without "VID" and without "_")
how to delete that from the echo ?

HD2 SD/MALDR System.ext2 Auto Builder V1.0

1. purpose just speeding up the system.ext2 file making.I'm lazy....
2. use it in Ubuntu O.S. with root account
3. decompress this auto builder and put it in folder /root or else place
4. put the CWM ROM's zip file in the folder "cwm_rom" and put the kernel modules *.ko files in the folder " kernel"
5.open terminal, cd the folder of this scripts, and execute it.
bash systemext2builder.sh then it will auto build the system.ext2 for SD ROM.
here is a demo how to use http://www.mediafire.com/?3lj5iuiv6ddcppi or http://dl.dbank.com/c0xn7ck608
Code:
#!/bin/bash
####################################################
# HD2 Android SD/MAGLDR ROM system.ext2 Auto builder.
# version 1.0
# By 3dak on 2011-04-29
##################################################
# to get current script's path
script_dir=`dirname $(readlink -f $0)`
extract_dir=$script_dir/extract
mount_dir=/mnt/system
#check the $mount_dir folder and ensure it is unmount and it's a fresh empty folder
if [ -d "$mount_dir" ] ; then
umount $mount_dir
rm -rf $mount_dir
mkdir $mount_dir
else
mkdir $mount_dir
fi
#to ensure there is no old extract folder or system.ext2
if [ -d "$extract_dir" ] ; then
rm -rf $extract_dir
fi
if [ -f $script_dir/system.ext2 ]; then
rm -f $script_dir/system.ext2
fi
#to get the main file name of the latest MIUI CWM ROM (*.zip) and decompress it!
# Please put the latest MIUI CWM ROM in the folder $script_dir/cwm_rom
build=`ls $script_dir/cwm_rom/*.zip | tail -1`
unzip $build -d $extract_dir/
#now change the cwm_rom kernel to SD version's kernel
#Please put all kernel modules *.ko files in the folder $script_dir/kernel
rm $extract_dir/system/lib/modules/*.ko
cp $script_dir/kernel/*.ko $extract_dir/system/lib/modules/
# Now create a fresh empty 250MB system.ext2 image file and format it.
dd if=/dev/zero of=$script_dir/system.ext2 bs=1048576 count=250
mke2fs -F $script_dir/system.ext2
#Now mount this fresh system.ext2
mount -o loop $script_dir/system.ext2 $mount_dir
#Now copy the CWM ROM's system folder to the $mount_dir (/mnt/system )
cp -ar $extract_dir/system/* $mount_dir/
############################################################
# Read CWM ROM's updater-script
# Createa Symlinks and set permissions of folders and files
#############################################################
updater_script=$extract_dir/META-INF/com/google/android/updater-script
# create symbolic links
SYMLINKS=`grep "symlink" $updater_script | cut -d'"' -f2`
for SYMLINK in $SYMLINKS; do
echo "Creating symolic links for $SYMLINK..."
if [ "$SYMLINK" = "busybox" -o "$SYMLINK" = "iwmulticall" ]; then
LINK_DIR='/system/xbin/'
elif [ "$SYMLINK" = "toolbox" ]; then
LINK_DIR='/system/bin/'
fi
MATCHES=`awk '/symlink\(\"'"$SYMLINK"'/,/\);/ {print}' $updater_script | \
sed "s/symlink(\"$SYMLINK\",//g" | \
sed 's/);//g' | \
sed 's/"//g' | \
sed 'N;s/\n//g' | \
sed 's/ //g' | \
sed 's/,/ /g' | \
sed "[email protected][email protected]@g"`
cd /mnt/$LINK_DIR
for LINK in $MATCHES; do
echo -n "Linking $SYMLINK to $LINK... "
ln -sf $SYMLINK $LINK && echo "done"
done
done
# set permissions
grep "set_perm_recursive" $updater_script | grep -v "tmp" | grep -v "recovery" | \
while read LINE; do
PERM=`echo $LINE | sed 's/set_perm_recursive(//g' | sed 's/);//g' | sed 's/"//g' | sed 's/ //g'`
USER=`echo $PERM | cut -d',' -f1`;
GROUP=`echo $PERM | cut -d',' -f2`;
DIR_PERM=`echo $PERM | cut -d',' -f3`;
FILE_PERM=`echo $PERM | cut -d',' -f4`;
TARGET=`echo $PERM | cut -d',' -f5`;
echo -n "Setting permissions for $TARGET... "
chown -R $USER:$GROUP /mnt$TARGET
chmod -R $DIR_PERM /mnt$TARGET
find /mnt$TARGET -type f -exec chmod $FILE_PERM {} \; && echo "done"
done
grep "set_perm" $updater_script | grep -v "recursive" | grep -v "tmp" | grep -v "recovery" | \
while read LINE; do
PERM=`echo $LINE | sed 's/set_perm(//g' | sed 's/);//g' | sed 's/"//g' | sed 's/ //g'`
USER=`echo $PERM | cut -d',' -f1`;
GROUP=`echo $PERM | cut -d',' -f2`;
FILE_PERM=`echo $PERM | cut -d',' -f3`;
TARGET=`echo $PERM | cut -d',' -f4`;
echo -n "Setting permissions for $TARGET... "
chown $USER:$GROUP /mnt$TARGET
chmod $FILE_PERM /mnt$TARGET && echo "done"
done
#now unmount system.ext2
umount $mount_dir
#cleanup
rm -rf $extract_dir
echo " All Done!"
# EOF by 3dak :) 2011-04-29
if you wanna a system.img file too for DAF ROM, add the follwoing line before this line #now unmount system.ext2
Code:
mkyaffs2image $mount_dir $script_dir/system.img
tools.zip is some tools for rom making. put them in the foloer
/usr/local/bin
Wonderful !
Would love to see such an application for Windows OS ....
that's very cool! now we can make new sd builds by ourselves
thanks 3dak!
3dak said:
1. purpose just speeding up the system.ext2 file making.I'm lazy....
Click to expand...
Click to collapse
Man this way you take away all the fun!!
Joking... I'm lazy, too!
great tool, work great to build miui 1.4.29
Thanks 3dak
It's so bad that I don't use Ubuntu OS!
I am looking for some tool like this for a long time but running in Windows OS!
kimquypticc said:
It's so bad that I don't use Ubuntu OS!
I am looking for some tool like this for a long time but running in Windows OS!
Click to expand...
Click to collapse
Use ubuntu.
Just make a live cd or live flash drive. It's worth it
Sent from my HD2 using XDA app
kimquypticc said:
It's so bad that I don't use Ubuntu OS!
I am looking for some tool like this for a long time but running in Windows OS!
Click to expand...
Click to collapse
Or use it in a VirtualBox.
It's rather easy
peter
this is just Awesome!
Awesome, I will test this soon!
Problem for build mimu 1.5.20
It's a good application.
I put the miui_HD2_1.5.20_3nhrpwvbo7_2.3.zip into the cwm_rom folder, and copy all *.ko files that extracted from the system.ext2's \lib\modules folder in the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518.7z into the kernel folder, then a system.ext2 file was built with no errors.
I replaced the origin system.ext2 from the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518 by this file, run it from my HD2 SD card, all was fine expect the GPRS. The origin system.ext2 hasn't this bug.
What's the different?
Ty 3dak for this. Are there no way to do this in Windows?
giveup said:
It's a good application.
I put the miui_HD2_1.5.20_3nhrpwvbo7_2.3.zip into the cwm_rom folder, and copy all *.ko files that extracted from the system.ext2's \lib\modules folder in the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518.7z into the kernel folder, then a system.ext2 file was built with no errors.
I replaced the origin system.ext2 from the miui_HD2_1.5.20_3dak_SD_2.3.4_ACA_r518 by this file, run it from my HD2 SD card, all was fine expect the GPRS. The origin system.ext2 hasn't this bug.
What's the different?
Click to expand...
Click to collapse
the different is my system.ext2 opened PPP mode while official MIUI ROM didn't.
giveup said:
It's a good application.
copy all *.ko files that extracted from the system.ext2's \lib\modules folder in the ?
Click to expand...
Click to collapse
in Ubuntu, how do you extract files from system.ext2?
Any comprehensive step by step?
ketzazu said:
in Ubuntu, how do you extract files from system.ext2?
Any comprehensive step by step?
Click to expand...
Click to collapse
Just mount it :
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
then go to /mnt/mysystemext2 folder to copy or modify
Sent from my HTC HD2 using xda premium
3dak said:
Just mount it :
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
then go to /mnt/mysystemext2 folder to copy or modify
Sent from my HTC HD2 using xda premium
Click to expand...
Click to collapse
Thanks! I'll try those commands instead.
3dak said:
Just mount it :
mkdir /mnt/mysystemext2
then go to /mnt/mysystemext2 folder to copy or modify
Sent from my HTC HD2 using xda premium
Click to expand...
Click to collapse
No matter what I do the system.ext2 is always missing in action, nowhere to be found even after I "sudo chmod 777" the folders. I always get the error "system.ext2: No such file or directory"
I have ubuntu installed in a different drive than windows 7
This is what I did: BTW, I always have to sudo since I don't login as root
I put this zipped NAND "Runnymede_0.82.401.1_v1.3_Tmous" to the folder as you instructed,
I extract all the ".ko" files from this ziped ROM and put them in the "kernel" folder as instructed.
I go to terminal and i sudo the bash command. It spits out the system.ext2 file with a lot of other files.
I copy the system.ext2 file to the Desktop.
then mkdir /mnt/mystemext2
then mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
I sudo chmod 777 the folders to be able access them. I even drag the system.ext2 from the Desktop to the /nmt and mnt/systemext2.
Still, all is empty.
What am i doing wrong?
When I try to copy directly system.ext2 to /mnt or /mnt/system.ext2 I get "not enough space error" but I don't see anything in the "lost+found" folder or anywhere else.
And also what program to use in Ubuntu to be able to open and see and edit the contents of system.ext2 in the folder?
PS. What are the instructions to use tools.zip for ROM making?
Thanks!
ketzazu said:
No matter what I do the system.ext2 is always missing in action, nowhere to be found even after I "sudo chmod 777" the folders. I always get the error "system.ext2: No such file or directory"
I have ubuntu installed in a different drive than windows 7
This is what I did: BTW, I always have to sudo since I don't login as root
I put this zipped NAND "Runnymede_0.82.401.1_v1.3_Tmous" to the folder as you instructed,
I extract all the ".ko" files from this ziped ROM and put them in the "kernel" folder as instructed.
I go to terminal and i sudo the bash command. It spits out the system.ext2 file with a lot of other files.
I copy the system.ext2 file to the Desktop.
then mkdir /mnt/mystemext2
then mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
I sudo chmod 777 the folders to be able access them. I even drag the system.ext2 from the Desktop to the /nmt and mnt/systemext2.
Still, all is empty.
What am i doing wrong?
When I try to copy directly system.ext2 to /mnt or /mnt/system.ext2 I get "not enough space error" but I don't see anything in the "lost+found" folder or anywhere else.
And also what program to use in Ubuntu to be able to open and see and edit the contents of system.ext2 in the folder?
PS. What are the instructions to use tools.zip for ROM making?
Thanks!
Click to expand...
Click to collapse
put system.ext2 in your home folder,
then open terminal,
cd ~ (this will goto your home folder)
ls (check if you can see system.ext2, if no, you put it at wrong place)
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
-----------------
or if you want to keep the created system.ext2 is mounted, just open the 3daksystemext2builder.sh,
#now unmount system.ext2
umount $mount_dir
change to
#now unmount system.ext2
#umount $mount_dir
this will keep the system.ext2 is at MOUNT status after the system.ext2 created. check folder /mnt/system and modify or copy
remember to umount it after you finish your work,
umount /mnt/system
3dak said:
put system.ext2 in your home folder,
then open terminal,
cd ~ (this will goto your home folder)
ls (check if you can see system.ext2, if no, you put it at wrong place)
mkdir /mnt/mysystemext2
mount -t ext2 -o loop system.ext2 /mnt/mysystemext2
-----------------
or if you want to keep the created system.ext2 is mounted, just open the 3daksystemext2builder.sh,
#now unmount system.ext2
umount $mount_dir
change to
#now unmount system.ext2
#umount $mount_dir
this will keep the system.ext2 is at MOUNT status after the system.ext2 created. check folder /mnt/system and modify or copy
remember to umount it after you finish your work,
umount /mnt/system
Click to expand...
Click to collapse
thanks again! I'll give it a try. But first, I have to figure out how to get damsel Ubuntu out of that sudden "Read only" blues madness.
Thank you finally found learning to learn!!!

[HOW TO] Install/Run Android SDK 64 Bit Native on Device

I learned about this here... http://fieldeffect.info/w/NativeCompileSDK
You can install an i386/x86_64 chroot within your existing Debian chroot using qemu-user-static to run the Android SDK on your Android phone/tablet/phablet.
1.
Get yourself a debian chroot, I recommend at least 2gb. I use DebianKit from market.
2.
You will need a X11 desktop environment and a VNC client on your device. I use androidVNC from market.
Here is my working example...
Start your Debian chroot/environment and do...
apt-get install openbox openbox-themes obmenu obconf menu menu-xdg xdg-utils xfonts-base xfonts-terminus* nautilus terminator lxappearance gmrun leafpad man-db hicolor-icon-theme tightvncserver tint2
That gives you a window manager, fonts, filebrowser, terminal emulator, text editor, theme manager, taskbar, and a VNC server.
Now lets get some GTK engines and libraries....
apt-get install gtk2-engines-auroa gtk2-engines-murrine gtk2-engines-oxygen gtk2-engines-pixbuf libgtk2.0-bin gtk3-engines-oxygen gtk3-engines-unico libgtk-3-bin
Now 7zip to handle zips and archives comfortably(put non-free in your apt sources.list)...
apt-get install p7zip p7zip-full p7zip-rar zip unzip
##The Android SDK manager, qemu, and multistrap##
apt-get install ant file openjdk-6-jre openjdk-6-jdk qemu-user-static libswt-gtk-3-java libswt-cairo-gtk-3-jni
3.
Now we can build a small x86_64 rootfs using multistrap
multistrap can use a config, have mine...
http://db.tt/hS5j3wg
Copy multistrap.conf straight into your working(pwd) directory....
cp /sdcard/Download/multistrap.conf .
Do this to avoid multistrap complaining later...
cat multistrap.conf >mstrap
mkdir /data/mnt
Determine size of rootfs for loop image..
du -hs /data/mnt/
Now make an image for x86_64 chroot
dd if=/dev/zero of=/sdcard/64bit.img bs=$(( 0x100000 )) count=YOUR IMAGE SIZE
That byte size makes your image slightly larger than the count value in Mb, for example count=78 will write 82Mb image.
mkfs.ext2 /sdcard/64bit.img
tune2fs -c0 /sdcard/64bit.img
mkdir /data/tmp
busybox mount -o loop /sdcard/64bit.img /data/tmp/
cp -r /data/mnt/* /data/tmp/
umount /data/tmp
rm -r /data/tmp/
rm -r /data/mnt/
mkdir /data/mnt
busybox mount -o loop /sdcard/64bit.img /data/mnt/
5.
Now the environment is set up and mounted, at this point install the SDK
Aim your browser to http://developer.android.com/sdk/index.html
Select "Linux" from "SDK Tools Only", thats the last thing at the bottom of the list.
cp /sdcard/Download/android-sdk_r21.0.1-linux.tgz .
7z x android-sdk_r21.0.1-linux.tgz russosv
7z x android-sdk_r21.0.1-linux.tar
Now we need a couple goodies from http://fieldeffect.info/w/NativeCompileAPK ##--Thanks to russosv from FeildEffect
These are edited from original....
#!/bin/bash
QEMU=/usr/bin/qemu-x86_64-static
64CHROOT=/data/mnt/
case "$1" in
mklinks)
if [ ! -e "./64BIT" ]; then
mkdir ./64BIT
fi
for i in $(file ./* | grep "ELF 32" | awk '{print $1}' | sed s/://g | sed s/[./]//g); do
echo "Moving $i..."
mv $i ./64BIT
ln -s ~/bin/run-64-link $i
done-
;;
*)
$QEMU $64CHROOT/lib64/ld-linux-x86_64.so.2 --library-path $64CHROOT/lib:$64CHROOT/usr/lib:$64CHROOT/usr/share/perl/5.12.4/unicore/lib:$64CHROOT/var/lib:$64CHROOT/lib/x86_64-linux-gnu:$64CHROOT/usr/lib/x86_64-linux-gnu [email protected]
;;
esac
Copy that to run-64, then...
chmod 755 run64
cp run-64 /usr/bin/
One more...
echo $(dirname $0)/64BIT/$(basename $0) [email protected]
/usr/bin/run-i386 $(dirname $0)/64BIT/$(basename $0) [email protected]
Make that run-64-link
chmod 755 run-64-link
cp run-64-link /usr/bin/
5b.
Now launch VNC server
tightvncpasswd
tightvncserver
killall Xtightvnc
cat >.vnc/xstartup<<EOF
tint2 &
terminator &
openbox-session
EOF
tightvncserver
export DISPLAY=:1
6.
Now launch the VNC client I mentioned earlier, should connect with 127.0.0.1:5901 and your password you set.
Go back to terminal or use the one launched on X11 to do...
sh android-sdk-linux/tools/android
Install at least one api.
If all went well you can now go around "debugging" yours and your friends Android devices over wifi now.
For an example, and to see it work do....
svc wifi disable(or enable) ##this turns off/on wifi
setprop service.adb.tcp.port 5555(or -1) ##this turns on/off adb over network
stop adbd
start adbd
adb connect 127.0.0.1(yours) or any other adbd addy listening on your network,
Have fun
Never did a "how to" before, go easy and I'll make corrections and answer things. Thanks for reading. Leave feedback.
Potential necro post but I believe the information is still currently valid and not readily available on searches. I've looked variations of this up for years with no luck until I hit the right search terms.
bump, and thanks.
can't believe there's no comments.
I know it's a slower than real-64-bit-pc method but not all of us have access to new hardware... or pc's. Maybe a novelty, still cool and useful if you've got the time to let the slower hardware compile.
you have preserved the scripts, original link is dead.
here is the Internet Wayback Machine cache of the original circa 2012 for reference.
http://web.archive.org/web/20120502044700/http://fieldeffect.info/w/NativeCompileAPK
appreciate you sharing.

Deodex

As of now I have all of the sys apps deodexed and about half of the framework deodexed. I'm working to find out why i cannot complete the framework deodex. I will edit this post with downloads as I go. The first edit will be the deodexed apk's and the partial on the framework. just need to get them uploaded first.
Current thanks list is:
abcdjdj- Universal Deodexer V4
Alokbina- Universal Deodexer V4
framework- http://www.androidfilehost.com/?fid=23134718111253137
apps- http://www.androidfilehost.com/?fid=23134718111253138
xkwr27 said:
As of now I have all of the sys apps deodexed and about half of the framework deodexed. I'm working to find out why i cannot complete the framework deodex. I will edit this post with downloads as I go. The first edit will be the deodexed apk's and the partial on the framework. just need to get them uploaded first.
Current thanks list is:
abcdjdj- Universal Deodexer V4
Alokbina- Universal Deodexer V4
framework- http://www.androidfilehost.com/?fid=23134718111253137
apps- http://www.androidfilehost.com/?fid=23134718111253138
Click to expand...
Click to collapse
I managed to fully deodex this ROM: P5200XXUAMG7_P5200OXXAMG4_XEH.zip (it's for P5200 3G model)
Here is the script I wrote for deodexing:
Code:
#!/bin/bash
for f in *.odex; do
no_ext=`echo $f | sed 's/.odex//'`
echo "deodexing $no_ext"
java -Xmx512m -jar /home/android/bin/baksmali-2.0b6.jar -a 17 -d ../system/framework -x $no_ext.odex
java -Xmx512m -jar /home/android/bin/smali-2.0b6.jar -a 17 -o classes.dex out
rm -rf out
if [ -e $no_ext.apk ]
then
zip -r -q $no_ext.apk classes.dex
fi
if [ -e $no_ext.jar ]
then
zip -r -q $no_ext.jar classes.dex
fi
rm -rf classes.dex
done
I used the latest baksmali and smali. It showed some error messages for Dropbox.odex and Magazines.odex files, but these two can be deodexed as well if you remove the -a switch from baksmali and smali lines.
Hope this helps.
Thanks if you have it linked anywhere on here I'll have to look at it to make sure I am not trying to do the same work twice. but in the mean time I'll give that script a try.
I have all deodexed...
But I have a update-binary issue that lets me not install a custom rom.
Status 7
set_perm issue
or
set_symlink issue
xkwr27 said:
As of now I have all of the sys apps deodexed and about half of the framework deodexed. I'm working to find out why i cannot complete the framework deodex. I will edit this post with downloads as I go. The first edit will be the deodexed apk's and the partial on the framework. just need to get them uploaded first.
Current thanks list is:
abcdjdj- Universal Deodexer V4
Alokbina- Universal Deodexer V4
framework- http://www.androidfilehost.com/?fid=23134718111253137
apps- http://www.androidfilehost.com/?fid=23134718111253138
Click to expand...
Click to collapse
i was looking for this.. but i cant downlaod it its telling me " no mirror found" but only with this file
framework- http://www.androidfilehost.com/?fid=23134718111253137
johnso said:
i was looking for this.. but i cant downlaod it its telling me " no mirror found" but only with this file
framework- http://www.androidfilehost.com/?fid=23134718111253137
Click to expand...
Click to collapse
Well I've deleted them now... Dutch dany has them completed up in a post anyway, that's why I never bothered finishing.
Oohh to bad because the one you hsve is for p5200and the one from dutchdanny is for p5210
I just need the framework data ..
Sent from my GT-P5200 using xda app-developers app
xmaczi123 said:
I managed to fully deodex this ROM: P5200XXUAMG7_P5200OXXAMG4_XEH.zip (it's for P5200 3G model)
Here is the script I wrote for deodexing:
Code:
#!/bin/bash
for f in *.odex; do
no_ext=`echo $f | sed 's/.odex//'`
echo "deodexing $no_ext"
java -Xmx512m -jar /home/android/bin/baksmali-2.0b6.jar -a 17 -d ../system/framework -x $no_ext.odex
java -Xmx512m -jar /home/android/bin/smali-2.0b6.jar -a 17 -o classes.dex out
rm -rf out
if [ -e $no_ext.apk ]
then
zip -r -q $no_ext.apk classes.dex
fi
if [ -e $no_ext.jar ]
then
zip -r -q $no_ext.jar classes.dex
fi
rm -rf classes.dex
done
I used the latest baksmali and smali. It showed some error messages for Dropbox.odex and Magazines.odex files, but these two can be deodexed as well if you remove the -a switch from baksmali and smali lines.
Hope this helps.
Click to expand...
Click to collapse
Thanks for the info about the "a" option. Ran in to this dilemma earlier.

[Help] wget/curl Script worked prior to MM? now no longer works

I had a script that I ran via tasker when I was on 5.1.1 to download the pic of the day from Nasa
https://apod.nasa.gov/apod/astropix.html
Since upgrading to MM the script no longer works. It does work just fine via command line on linux machines(most likely d/t the increased support and ease of wget/curl) so I know the formatting is correct.
here's what I have
Code:
#!/bin/sh
wget -q -c -O ~/Downloads/potd/$(date +%m-%d-%Y.jpg) https://apod.nasa.gov/$(curl -silent https://apod.nasa.gov/apod/astropix.html > astropix.html && grep "IMG SRC" astropix.html | cut -c 10- | tr -d "\"") && rm astropix.html
On android I get as far as
Code:
sslv3 alert handshake failure
Any help would be greatly appreciated. I've tried setting different ssl/tls versions via curl and still nothing.

Categories

Resources