[HOW TO] Create ROMs (So you can stop PMing me ;) ) - Captivate General

Note: This guide was written for Froyo
Well to start, the Samsung leaked firmwares (many of them, at least) are located here:
http://www.samfirmware.com/WEBPROTECT-i9000.htm
You unpack that with WinRAR, and you'll get a modem.bin, factory.rfs, zImage, cache.rfs, and maybe some other crap. The modem.bin and zImage are useless as they're the modem and kernel, which would technically work on a Captivate but is less than ideal. For example the screen will be rotated 90 degrees incorrectly (Captivate kernels based on i9000 firmwares that have the problems fixed are frequently called reoriented kernels for this reason). The speaker will only work if headphones are plugged in (and headphones only work when they're not plugged in, which is a bit of a problem).
The cache.rfs has the CSC folder, mostly, which you can use but it's also not ideal. If there's ever an sbl.bin or boot.bin those need to be deleted as they're locked bootloader files. The leaked firmware for the Tab had these and people got locked into Samsung firmwares from flashing them. Don't know if that was ever fixed or not.
Then there's factory.rfs. You can open up the .rfs in Magic ISO and extract the /system files.
From there the system apps have to be deodexed, (which takes the .apk files and their corresponding .odex file and puts it into one single .apk file). This allows the .apk to be modified without worrying about the .odex becoming incompatible. The /system/framework contains a bunch of .jar files and two .apks that have to be deodexed also.
From there you can begin to remove the useless junk. The Samsung Apps, the FM Radio (doesn't work), the Book Reader app, Voice Recorder, etc. Some things you're stuck with, the Contacts and the Dialer.
In this particular firmware base (JPY) there's a couple things that are messed up that need to be addressed. The wifi firmware needs to be rolled back to an older one to improve battery life, the gallery app needs to be swapped out to prevent a battery drain problem, there's a camera-related driver file that needs to be swapped out so the Camera will work without the Email app being present. Things like that.
The .apks can be decompiled to edit them (for example Contacts, Dialer, etc. have "Video Call" buttons that need to be edited out in the .xml files that are contained). This can de done with APK Manager, or directly with APK Tool. Either way it comes down to changing things in Notepad++. I've got a guy named ChanceM that I talk to in IRC... he's great with this part and helped with a lot of different things. Particularly the 4 lock screen mod, and he keeps a battery mod maintained for people that like that sort of thing.
As far as theming them, you can either copy over images in 7-zip, or decompile them with APK Manager. Depends on what you need to do. To change colors of text, what the text says, layouts, etc. you need to decompile it and look at the .xml files. If it's a .png that doesn't end in .9.png then you can just copy it over as you see fit.
If the .png ends in .9.png, there's a special 1 pixel border around the image that only appears after it's been decompiled. It's either black or transparent and that governs the stretching of the image. This is called 9patch data. If you simply copy over an image without decompiling it, decompiling it afterwards will not work correctly and you'll have to recreate the image with that one pixel border.
As far as what the 9patch data actually tells the system, I'll differ to this picture I found on developer.android.com:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is used on buttons and things, so that one image can be used to create multiple buttons with different sizes. For example:
Beyond the theming of the system apps and the (tw)framework-res.apk (these two are used to draw things like the status bar and menus), there's also some heavy duty modifying to the android.policy.jar. This changes the Power Menu such that Reboot/Recovery/Download are added to the bottom of the standard options. This gives easy access to those modes without the use of the SDK. The fix for the home haptic button is also in android.policy.jar. The lock screens are all inside android.policy.jar.
Unlike .apks, it's a bit more difficult to modify the .jar files. You've got to open the .jar in 7-zip or some such, and then extract a classes.dex file into any old folder. You'll also need a baksmali.jar and smali.jar inside that folder too. Then (after you've installed the Java SDK, Android SDK, and added them to the Windows PATH file) you must enter into a Command Prompt the following:
java -jar baksmali.jar -o classout/ classes.dex
Click to expand...
Click to collapse
This creates a classout folder that contains an entire hierarchy of .smali files ready to be edited in Notepad++. Not as easy as .xml edits, because these are written in straight up code and can be thousands of lines long for each .smali. However, once you're done, the following will convert it back into a classes.dex file, which can replace the original using 7-zip:
java -Xmx512M -jar smali.jar classout/ -o classes.dex
Click to expand...
Click to collapse
From there you can add any apps and tweaks you like. A custom kernel, a modem you like, and you're almost done.
You've still got to install the files for busybox, root, etc. Those go in /system/xbin.
Once you've got it down to a useable state you've got to write an update-script to actually install it. This is what mine is:
show_progress 1 0
Click to expand...
Click to collapse
Sets the progress bar equal to zero.
format SYSTEM:
format CACHE:
format DATADATA:
format DATA:
delete_recursive SDCARD:.android_secure
delete_recursive SDCARD:Voodoo
delete_recursive SDCARD:Android
delete_recursive DBDATA:
Click to expand...
Click to collapse
Out with the old...
copy_dir PACKAGE:system SYSTEM:
copy_dir PACKAGE:data DATA:
copy_dir PACKAGE:updates TMP:/updates
copy_dir PACKAGE:sdcard SDCARD:
Click to expand...
Click to collapse
...and in with the new.
symlink toolbox SYSTEM:bin/cat
symlink toolbox SYSTEM:bin/chmod
symlink toolbox SYSTEM:bin/chown
symlink toolbox SYSTEM:bin/cmp
symlink toolbox SYSTEM:bin/date
symlink toolbox SYSTEM:bin/dd
symlink toolbox SYSTEM:bin/df
symlink toolbox SYSTEM:bin/dmesg
symlink toolbox SYSTEM:bin/getevent
symlink toolbox SYSTEM:bin/getprop
symlink toolbox SYSTEM:bin/hd
symlink toolbox SYSTEM:bin/id
symlink toolbox SYSTEM:bin/ifconfig
symlink toolbox SYSTEM:bin/iftop
symlink toolbox SYSTEM:bin/insmod
symlink toolbox SYSTEM:bin/ioctl
symlink toolbox SYSTEM:bin/ionice
symlink toolbox SYSTEM:bin/kill
symlink toolbox SYSTEM:bin/ln
symlink toolbox SYSTEM:bin/log
symlink toolbox SYSTEM:bin/ls
symlink toolbox SYSTEM:bin/lsmod
symlink toolbox SYSTEM:bin/mkdir
symlink toolbox SYSTEM:bin/mount
symlink toolbox SYSTEM:bin/mv
symlink toolbox SYSTEM:bin/nandread
symlink toolbox SYSTEM:bin/netstat
symlink toolbox SYSTEM:bin/newfs_msdos
symlink toolbox SYSTEM:bin/notify
symlink toolbox SYSTEM:bin/printenv
symlink toolbox SYSTEM:bin/ps
symlink toolbox SYSTEM:bin/reboot
symlink toolbox SYSTEM:bin/renice
symlink toolbox SYSTEM:bin/rm
symlink toolbox SYSTEM:bin/rmdir
symlink toolbox SYSTEM:bin/rmmod
symlink toolbox SYSTEM:bin/route
symlink toolbox SYSTEM:bin/schedtop
symlink toolbox SYSTEM:bin/sendevent
symlink toolbox SYSTEM:bin/setconsole
symlink toolbox SYSTEM:bin/setprop
symlink toolbox SYSTEM:bin/sleep
symlink toolbox SYSTEM:bin/smd
symlink toolbox SYSTEM:bin/start
symlink toolbox SYSTEM:bin/stop
symlink toolbox SYSTEM:bin/sync
symlink toolbox SYSTEM:bin/top
symlink toolbox SYSTEM:bin/umount
symlink toolbox SYSTEM:bin/vmstat
symlink toolbox SYSTEM:bin/watchprops
symlink toolbox SYSTEM:bin/wipe
symlink /system/xbin/su SYSTEM:bin/su
Click to expand...
Click to collapse
This creates symlinks for various commands that you or the system might need.
set_perm_recursive 0 0 0755 0644 SYSTEM:
set_perm_recursive 0 2000 0755 0755 SYSTEM:bin
set_perm_recursive 0 0 0755 0755 SYSTEM:etc
set_perm_recursive 1002 1002 0755 0440 SYSTEM:etc/bluetooth
set_perm_recursive 0 0 0777 0777 SYSTEM:etc/init.d
set_perm 0 3003 02755 SYSTEM:bin/netcfg
set_perm 0 3004 02755 SYSTEM:bin/ping
set_perm 0 0 0755 SYSTEM:etc/bluetooth
set_perm 1002 1002 0440 SYSTEM:etc/dbus.conf
set_perm 1014 2000 0550 SYSTEM:etc/dhcpcd/dhcpcd-run-hooks
set_perm 0 2000 0550 SYSTEM:etc/init.goldfish.sh
set_perm 0 0 04755 SYSTEM:xbin/su
set_perm 0 0 04755 SYSTEM:xbin/busybox
set_perm 1000 1000 0771 DATA:app
set_perm 0 0 755 TMP:/updates/redbend_ua
Click to expand...
Click to collapse
This sets the permissions on the files and folders to what's necessary.
run_program /system/xbin/busybox --install -s /system/xbin
Click to expand...
Click to collapse
This will install busybox.
run_program /tmp/updates/redbend_ua restore /tmp/updates/modem.bin /dev/block/bml12
Click to expand...
Click to collapse
This installs the modem.
run_program /tmp/updates/redbend_ua restore /tmp/updates/zImage /dev/block/bml7
Click to expand...
Click to collapse
This installs the kernel.
show_progress 1 10
Click to expand...
Click to collapse
That's a followup command to the original command for the progress bar.
-----
That pretty much covers the basic stuff. I tried to keep it as short as possible.

Nice job. This should help alot of people.
And like you said. Stop "some" of the PMs for you...

Glad to see this all put together. Gives everyone a better idea of all the hard work you guys do.
Sent from my SGH-I897 using XDA App

I agree. It took me a while to figure it out. And this is so much more detailed. Great job Mikey.

IamSonoma said:
I agree. It took me a while to figure it out. And this is so much more detailed. Great job Mikey.
Click to expand...
Click to collapse
10charchar

Two things....
1)THIS NEEDS TO BE STICKIED
2) Oh just wait for it..... wait.....wait... for the DEV section to get cluttered with an ass-ton of freshly released, half-working, quadrant scores of 3 million, CWM flashable brick.zip, works of art
Thank you Mikey for the detailed write up.

vunuts said:
Two things....
1)THIS NEEDS TO BE STICKIED
2) Oh just wait for it..... wait.....wait... for the DEV section to get cluttered with an ass-ton of freshly released, half-working, quadrant scores of 3 million, CWM flashable brick.zip, works of art
Thank you Mikey for the detailed write up.
Click to expand...
Click to collapse
No don't curse it.although we all know is bound to happen. No good deed goes unpunished
Sent from my SGH-I897 using XDA App

crystalhand said:
No don't curse it.although we all know is bound to happen. No good deed goes unpunished
Sent from my SGH-I897 using XDA App
Click to expand...
Click to collapse
I just figured I might as well throw it out there so, BOOM, it's here on the front page of this thread, so hopefully people see this and don't go into the DEV section and decide to flash one of the 46 new rom's that might pop up in the next week or so.
You notice how quiet this thread is?
People are up to something.... And I don't like it lol.

vunuts said:
You notice how quiet this thread is?
People are up to something.... And I don't like it lol.
Click to expand...
Click to collapse

vunuts said:
I just figured I might as well throw it out there so, BOOM, it's here on the front page of this thread, so hopefully people see this and don't go into the DEV section and decide to flash one of the 46 new rom's that might pop up in the next week or so.
You notice how quiet this thread is?
People are up to something.... And I don't like it lol.
Click to expand...
Click to collapse
Can't be any worse than some of the cut and paste rom building that already occurs.
Nice that you took the time to write this up mikey.

MikeyMike01 said:
Click to expand...
Click to collapse
^^^^Yea, something like that^^^^
I thought most of the cut and paste rom's got locked? I know that the ports from different galaxy s phones are legit, I just thought it was the people building in the kitchen and posting as their own got shut down.
Eh, whatever though. People will do what they do, more power to them.

vunuts said:
I thought most of the cut and paste rom's got locked?
Click to expand...
Click to collapse
Some peoples release dates been a little too... convenient.
Sent from my Captivate.

MikeyMike01 said:
Some peoples release dates been a little too... convenient.
Sent from my Captivate.
Click to expand...
Click to collapse
I for one may never post mine. Not to be rude or anything. There are currently many roms to choose from. Most are well done.
For me it is just a learning experience. I managed to get the HTC Kitchen working. After figuring out a few quirks. My custom rom is JS3. I figure I could help out more if I understood the steps from beginning to end.
I could know I could just use someone else but there is no personal gain out of copying someone's else stuff if you can't do it yourself.
Thank you Mikey for thinking of others and taking the time especially for the individuals who want to learn.

IamSonoma said:
Thank you Mikey for thinking of others and taking the time especially for the individuals who want to learn.
Click to expand...
Click to collapse
There's almost nothing on Samsung ROM...ing. It's all HTC/AOSP/etc.

U R the MAN
MIKEY_MIKE my humble hat off 2 U

Mike this is a great post, I really appreciate the info. This will help answer a question I've been pondering a while- can the default tab in the dialer be changed (say to "Call logs" or "Favorites")?
I'm guessing if I decompile the dialer APK I may be able to find such a setting in its XML.
If anyone already knows the answer to this feel free to let me know.

This definitely shows how much work it takes to make a ROM. Too time consuming for me to try this anytime soon. I've only customized.a theme, a mashup of many different ones. I thank all the devs though for their hardwork.
Sent from my Captivate running Cezar's Continuum v.2.0 with hardcore's k12q kernel.

tzabka said:
MIKEY_MIKE my humble hat off 2 U
Click to expand...
Click to collapse
10charararar

Woot I got a sticky!

Congrats...well deserved!

Related

update-script syntax - A guide for ROM devs, modders, and themers

Introduction ___________________________________
Android, as it is on HTC devices, has quite an advanced system for installing the OS and updates thereof, not unlike install systems for PC's, like the Windows installer system and NullSoft Install System (NSIS).
"ROM"s for Android aren't necessarily ROMs, but packages. containing files. Technically, a Nandroid backup of a clean install could be considered a ROM.
The update-script file, found in /META-INF/com/google/android/update-script (relative to the package), is necessary for any ROM, no matter how simplistic, to be flashed through the recovery.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
(Nandroid-style, or ROM Flash-images, found in a collection with [system|data|cache|boot|recovery|radio|bootloader|splash|etc.].img files, can usually be flashed using fastboot, or adb/terminal via flash_image, but that is out of the scope of this guide.
They can, however, be flashed through an update.zip file, which will be discussed in detail below.
Goldcards, .nbh files and flashing from the bootloader is not covered; see an unbrick/root guide for details.)​Examples! __________________________
Now that we got that out of the way, let's take a look at an update-script file, from KiNgxKxKlair-Hero-Eclair-v1.3_signed (since I have this readily at hand.) Code abridged somewhat (thousands of symlink commands trimmed off).
Highlight syntax:
Commands bold, black
Functions light-blue
Strings red
Integers/numbers and booleans orange
Variables dark-blue
ROOT: green, bold, path/path green
Equal signs, etc pink
Parentheses light-purple
Code:
[B]assert[/B] [COLOR=DeepSkyBlue]compatible_with[/COLOR][COLOR=Plum]([/COLOR][COLOR=Red]"0.2"[/COLOR][COLOR=Plum])[/COLOR] [COLOR=Magenta]==[/COLOR] [COLOR=Red]"true"[/COLOR]
[B]show_progress[/B] [COLOR=DarkOrange]0.1 0[/COLOR]
[B]format[/B] [B][COLOR=YellowGreen]SYSTEM:[/COLOR][/B]
[B]copy_dir[/B] [B][COLOR=YellowGreen]PACKAGE:[/COLOR][/B][COLOR=YellowGreen]system[/COLOR] [B][COLOR=YellowGreen]SYSTEM:[/COLOR][/B]
[B]symlink[/B][COLOR=YellowGreen] dumpstate [B]SYSTEM:[/B]bin/dumpcrash[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] toolbox [B]SYSTEM:[/B]bin/newfs_msdos[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] toolbox [B]SYSTEM:[/B]bin/renice[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] toolbox[B] SYSTEM:[/B]bin/notify[/COLOR]
[COLOR=Silver][I][----------snip----------][/I][/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/zcip[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/zcat[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/yes[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/xargs[/COLOR]
[COLOR=Silver][I][----------snip----------][/I][/COLOR]
[B]set_perm_recursive[/B][COLOR=DarkOrange] 0 0 0755 0644[/COLOR] [B][COLOR=YellowGreen]SYSTEM:[/COLOR][/B]
[B]set_perm_recursive[/B][COLOR=DarkOrange] 0 2000 0755 0755 [/COLOR][COLOR=YellowGreen][B]SYSTEM[/B]:bin[/COLOR]
[B]set_perm_recursive[/B][COLOR=DarkOrange] 0 2000 0755 0755[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]xbin[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 0 3004 02755[/COLOR][COLOR=YellowGreen][B] SYSTEM:[/B]bin/ping[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 0 0 04755[/COLOR][COLOR=YellowGreen][B] SYSTEM:[/B]bin/su[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 0 0 04755 [/COLOR][COLOR=YellowGreen][B]SYSTEM:[/B]xbin/busybox[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 0 0 04755[/COLOR][COLOR=YellowGreen] [B]SYSTEM:[/B]xbin/iptables[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 0 0 04755[/COLOR][COLOR=YellowGreen][B] SYSTEM:[/B]xbin/dnsmasq[/COLOR]
[B]set_perm_recursive[/B][COLOR=DarkOrange] 1002 1002 0755 0440[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/bluez[/COLOR][B]
set_perm[/B][COLOR=DarkOrange] 0 0 0755[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/bluez[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 1002 1002 0440[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/dbus.conf[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 1014 2000 0550[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/dhcpcd/dhcpcd-run-hooks[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 0 2000 0550 [/COLOR][COLOR=YellowGreen][B]SYSTEM:[/B]etc/init.goldfish.sh[/COLOR]
[B]set_perm_recursive[/B][COLOR=DarkOrange] 0 0 0755 0555[/COLOR][COLOR=YellowGreen][B] SYSTEM:[/B]etc/ppp
[/COLOR]
[B]format[COLOR=YellowGreen] DATA:[/COLOR][/B]
[B]copy_dir[/B][COLOR=YellowGreen][B] PACKAGE:[/B]data [B]DATA:[/B][/COLOR]
[B]symlink[/B][COLOR=YellowGreen] /data/app_s[B] SYSTEM:[/B]app[/COLOR]
[B]symlink[/B] [COLOR=YellowGreen]/data/system-framework[B] SYSTEM:[/B]framework[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 1000 1000 0771[/COLOR][COLOR=YellowGreen][B] DATA:[/B]app
[/COLOR]
[B]show_progress[/B][COLOR=DarkOrange] 0.2 0[/COLOR]
[B]format[COLOR=YellowGreen] BOOT:[/COLOR][/B]
[B]write_raw_image[COLOR=YellowGreen] PACKAGE:[/COLOR][/B][COLOR=YellowGreen]boot.img [/COLOR][B][COLOR=YellowGreen]BOOT:[/COLOR][/B]
[B]show_progress[/B][COLOR=DarkOrange] 0.2 10[/COLOR]
[B]format[COLOR=YellowGreen] CACHE:[/COLOR][/B]
Whoa . Lotsa weird numbers and long commands. But it installs a functioning, rooted Eclair Hero, with busybox, on the G1 with all the right permissions, with no hiccups.
Let's pull it apart. ​
How It Works ________________________
The update-script seems greatly over-complicated, but a lot of it is simple (and some can just be copy-pasted as-is to make up the skeleton of the script.
Code:
[B]assert[/B] [COLOR=DeepSkyBlue]compatible_with[/COLOR][COLOR=Plum]([/COLOR][COLOR=Red]"0.2"[/COLOR][COLOR=Plum])[/COLOR] [COLOR=Magenta]==[/COLOR] [COLOR=Red]"true"[/COLOR]
[B]show_progress[/B] [COLOR=DarkOrange]0.1 0[/COLOR]
The first line here is an "assert", a boolean condition.
If the argument following the assert (a function, command, or "variable" condition) is true, the script continues, otherwise it halts.
If you are writing an update-script for a recovery that's compatible with specification v0.2 (which I cover here, and is on most modded post-Cupcake recovery systems to date), you MUST include this first line.​The compatible_with() is a function, which itself returns true if "0.2" OR "0.1" is passed to it, in a v0.2-spec recovery (post-Cupcake).
The second line changes the progress-bar fill. It takes two arguments, a fraction and a duration. Half of the progress bar is taken by verification before this point, so the remaining fraction is relative to the second half (1.0 is half, 0.5 is a quarter, and so forth.)
The fraction is relative to 1.0, which is the post-verification progress.
The duration is in seconds, and specifies how slowly the fraction fills.
Code:
[B]format[/B] [B][COLOR=YellowGreen]SYSTEM:[/COLOR][/B]
[B]copy_dir[/B] [B][COLOR=YellowGreen]PACKAGE:[/COLOR][/B][COLOR=YellowGreen]system[/COLOR] [B][COLOR=YellowGreen]SYSTEM:[/COLOR][/B]
This looks easy. Because it is.
The format command takes a "root", a.k.a partition name, as its only argument, and does exactly what it says on the tin - formats a "root" clean.
FORMATTING ERASES DATA IRREVERSIBLY. Just wanted to make that clear, in case it wasn't already.​The available roots are listed in the appendix.
The copy_dir command is also fairly simple. It copies the contents of a folder from one place, to another, making the folder if it doesn't exist.
In this case, it copies from the update package's system folder to /system/.
Code:
[B]symlink[/B][COLOR=YellowGreen] dumpstate [B]SYSTEM:[/B]bin/dumpcrash[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] toolbox [B]SYSTEM:[/B]bin/newfs_msdos[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] toolbox [B]SYSTEM:[/B]bin/renice[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] toolbox[B] SYSTEM:[/B]bin/notify[/COLOR]
[COLOR=Silver][I][----------snip----------][/I][/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/zcip[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/zcat[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/yes[/COLOR]
[B]symlink[/B][COLOR=YellowGreen] busybox[B] SYSTEM:[/B]xbin/xargs[/COLOR]
[COLOR=Silver][I][----------snip----------][/I][/COLOR]
These are important, too, especially for a rooted/modded rom. The symlink command takes two arguments. Not quite like your Linux/Unix/POSIX "ln -s" command, since it accepts a ROOT: path syntax. The first argument is taken as-is, though, and can be either of:
- A linux executable that's in the $PATH environment (such as SYSTEM:/bin, :/sbin, :/xbin
- A file somewhere.
The command, in the source code, does the following:
- Counts arguments. Exactly two taken, or fail with error.
- Translates the ROOT: path notation into something POSIX compatible, or fails with an error
- Double-checks that ROOT: is mounted, and mounts, otherwise throws an error and stops
- symlink(argv[0], path) - standard C. Takes the first argument, and the translated ROOT: path, and links the path to the first argument. Or fails with an error.
The first argument is the target, i.e., what to link to.
The second argument is the link itself.
Code:
[B]set_perm_recursive[/B][COLOR=DarkOrange] 1002 1002 0755 0440[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/bluez[/COLOR][B]
set_perm[/B][COLOR=DarkOrange] 0 0 0755[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/bluez[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 1002 1002 0440[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/dbus.conf[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 1014 2000 0550[/COLOR] [COLOR=YellowGreen][B]SYSTEM:[/B]etc/dhcpcd/dhcpcd-run-hooks[/COLOR]
[B]set_perm[/B][COLOR=DarkOrange] 0 2000 0550 [/COLOR][COLOR=YellowGreen][B]SYSTEM:[/B]etc/init.goldfish.sh[/COLOR]
[B]set_perm_recursive[/B][COLOR=DarkOrange] 0 0 0755 0555[/COLOR][COLOR=YellowGreen][B] SYSTEM:[/B]etc/ppp
[/COLOR]
Permissions. Ugggh. Probably one of the more confusing things here, since if they're set wrong, some parts of, if not the entire Android system, will fail hard.
You have two commands, set_perm and set_perm_recursive. They both set the ownership and UNIX permissions on files; one on a single file, or a folder (not its contents), and the other acts on everything within the folder.
______________________________________________________​
Changelog:
v0.1: Initial version, explanation of recovery system and parts of the update-script from King's eclair hero
v0.2: Incomplete still, added more tear-apart of the King update-script. And... SYNTAX HIGLIGHTING!
Will continue on explaining set_perm/_recursive in v0.3, expected later tonight.
Space reserved for expansion: Command glossary and reference.
Appendix A: Roots and Partitions ________
This is a list of all the available roots in the Android recovery, as scoped from roots.c in the source code, and df and mount on the device.
Code:
ROOT: (Linux block device) /mountpoint/ fs, size
Description.
BOOT: (/dev/mtdblock[?]) / (RAM) Raw
Kernel, ramdisk and boot config.
DATA: (/dev/mtdblock5) /data/ yaffs2, 91904kb
User, system config, app config, and apps (without a2sd)
CACHE: (/dev/mtdblock4) /cache/ yaffs2, 30720kb
OTA cache, Recovery/update config and temp
MISC: (/dev/mtdblock[?]) N/A Raw
[TODO: Get info on MISC:]
PACKAGE: (Relative to package file) N/A
Pseudo-filesystem for update package.
RECOVERY: (/dev/mtdblock[?]) / (RAM) Raw, [?]kb
The recovery and update environment's kernel and ramdisk.
Similar to BOOT:.
SDCARD: (/dev/[B]mmcblk[/B]0(p1)) /sdcard/ fat32, 32MB-32GB
The microSD card. Update zip is usually here.
SYSTEM: (/dev/mtdblock3) /system/ yaffs2, 92160kb
The OS partition, static and read-only.
TMP: /tmp/ in RAM
Standard Linux temporary directory.
Cleared on poweroff/reboot.
[TODO: Find mtd partition for BOOT:, RECOVERY:, MISC:]
One more space, if I should need it in the near future. Hey, rom devs get away with it, why not the documenters, upon whom they depend?
This is a great topic!
I know most of these commands, but always wanted to perfect my understanding towards it's use in general for different tasks.
Great tut!
RichieDaze said:
This is a great topic!
I know most of these commands, but always wanted to perfect my understanding towards it's use in general for different tasks.
Great tut!
Click to expand...
Click to collapse
Thanks! I knew it would be useful. But I haven't even finished it yet, mainly 'cause I had to dash off to school at the last minute.
I'm going to add to it now that I'm back home.
Command to remove/delete file/dirs
Great post.
You could also add:
write_radio_image PACKAGE:radio.img
(working for Motorola MB200 Cliq/Dext at least)
I was wondering is there is there any command that can be used in update-script to remove files and/or directories?
Any further reference about this?
Thanks in advance
adlxdum said:
Great post.
You could also add:
write_radio_image PACKAGE:radio.img
(working for Motorola MB200 Cliq/Dext at least)
I was wondering is there is there any command that can be used in update-script to remove files and/or directories?
Any further reference about this?
Thanks in advance
Click to expand...
Click to collapse
Pretty sure to delete it would be
delete SYSTEM:app/Mms.apk
This would remove the stock messaging app for example
run sh script from update-script
You can also run a custom #!/sbin/sh script from update-script:
run_program PACKAGE:script.sh
cool!
great resource. What language is are these zip files written? There has to be a syntax guide out there.
Simply awesome.....sticky!
-nevermind-
This should be a sticky.
Agreed. sticky this.
It took me weeks to figure all this out.
This thread is a few months too late
Thanks a lot anyway.
Great write up.. thank you for putting the time into this!
hello
Can i copy some app to data/app, if data/app is a simlink to /system/sd/app?
Or can I test if the folder SYSTEM:sd/app exists?
And skip or overwrite existing files?
Thanks
OK, I see system/sd is not mounted, then I can't copy apps from update.zip?
If I wanted to copy these files for FMRadio (extracted from the ROM Cliq) to my milestone without root, can I run this script through the update. zip?
Is correct?
Thanks!
mount("MTD", "system", "/system");
ui_print("Copying in your phone...");
package_extract_file("system/bin/fmradio", "/system/bin/fmradio");
package_extract_file("system/bin/fmradioserver", "/system/bin/fmradioserver");
package_extract_file("system/lib/libFMRadio.so", "/system/lib/libFMRadio.so");
package_extract_file("system/lib/libfmradio_jni.so", "/system/lib/libfmradio_jni.so");
package_extract_file("system/lib/libfmradioplayer.so", "/system/lib/libfmradioplayer.so");
package_extract_file("system/app/FMRadio.apk", "/system/app/FMRadio.apk");
set_perm(0, 0, 04755, "/system/bin/fmradio");
set_perm(0, 0, 04755, "/system/bin/fmradioserver");
set_perm(0, 0, 04755, "/system/bin/libFMRadio.so");
set_perm(0, 0, 04755, "/system/bin/libfmradio_jni.so");
set_perm(0, 0, 04755, "/system/bin/libfmradioplayer.so");
set_perm(0, 0, 0644, "/system/app/FMRadio.apk");
unmount("/system");
zimphishmonger said:
Simply awesome.....sticky!
Click to expand...
Click to collapse
jubeh said:
This should be a sticky.
Click to expand...
Click to collapse
domenukk said:
Agreed. sticky this.
Click to expand...
Click to collapse
Sticky? It's not even finished yet!
And on that note, I'm sorry I haven't kept up with it. Been busy with non-android junk, school, and my website and projects.
I'll hopefully update later tonight. No promises, but I have this thread on e-mail alert so every post in here is almost like a reminder to me lol
Also, through tearing apart some update-zips I've seen some very useful commands that I haven't covered yet. (Cyanogen is like, an update-script wizard)
domenukk said:
It took me weeks to figure all this out.
This thread is a few months too late
Thanks a lot anyway.
Click to expand...
Click to collapse
jrummy16 said:
Great write up.. thank you for putting the time into this!
Click to expand...
Click to collapse
You're all welcome! Always happy to serve the fellow devs.
adlxdum said:
You can also run a custom #!/sbin/sh script from update-script:
run_program PACKAGE:script.sh
cool!
Click to expand...
Click to collapse
I can't believe that I didn't cover that. Will be in next version.
jackal424 said:
great resource. What language is are these zip files written? There has to be a syntax guide out there.
Click to expand...
Click to collapse
The update-script is a custom format, implemented by the Android recovery environment. It's actually parsed by (I think) recovery.c using rules in commands.c (not sure, haven't seen that source since I first wrote this up)
luca_v3r said:
If I wanted to copy these files for FMRadio (extracted from the ROM Cliq) to my milestone without root, can I run this script through the update. zip?
Is correct?
Thanks!
Click to expand...
Click to collapse
I don't have any experience with the Motorola devices, so I wouldn't be certain. It looks alright though.
I might be redoing the write-up for CyanogenMod 5, as it's got better examples of commands and it's way more up-to-date.
Also, I see that a lot of the script structure has changed since I last touched on this subject, from a BASIC-like language to something almost resembling C. I'll be covering that, too.
Any help apriciated since I am still new in this stuff, here is the thing I have problem with booting once I flash an update I created. If I flash my update.zip right after I flashed rom, the phone freezes in boot screen, but if I first boot the phone without my update, and then flash update it works normally. Any ideas?
And one more problem if I add "copy_dir PACKAGE:data DATA:" to update-script I always get E:syntax error
Reagards
Serris said:
Any help apriciated since I am still new in this stuff, here is the thing I have problem with booting once I flash an update I created. If I flash my update.zip right after I flashed rom, the phone freezes in boot screen, but if I first boot the phone without my update, and then flash update it works normally. Any ideas?
And one more problem if I add "copy_dir PACKAGE:data DATA:" to update-script I always get E:syntax error
Reagards
Click to expand...
Click to collapse
try a reboot, sometimes it gets 'stuck' and throws that syntax error even if you 'fixed' it
Serris said:
Any help apriciated since I am still new in this stuff, here is the thing I have problem with booting once I flash an update I created. If I flash my update.zip right after I flashed rom, the phone freezes in boot screen, but if I first boot the phone without my update, and then flash update it works normally. Any ideas?
And one more problem if I add "copy_dir PACKAGE:data DATA:" to update-script I always get E:syntax error
Reagards
Click to expand...
Click to collapse
I have different experience. I have this line, there's no error/warning whatsoever. At the same time, files are not copied over
If it matters, I am using AmonRa Recovery 1.32
and I am packaging in data/local/bin/busybox.bin
I also tried
mount("MTD","data","/data")
package_extract_dir("data","/data")
Still not copy.
However, I do see /data/local/bin/busybox.bin when I go into recovery terminal!. I wonder if my problem is because the real data partition is not mounted in recovery

CUSTOM Script on Custom Roms

hey,
whenever i flash a new rom i edit the zip to replace keylayouts, apps in /system and /data , bootscreens and some other stuff......
i now want to symlink some directories with a script which will be loaded during rom flash because otherwise i would need a pc to access it through adb...
the script i want FOR NOW (i may use it for other things in the future)
is about symlinking the
/system/customize/resource/bootanimation.zip to /data/local/bootanimation.zip
/system/customize/resource/android_audio.mp3 to /data/local/android_audio.mp3
i can do this through adb as i said but i'd prefer it to be done automatically by a script during flash.... i know the commands to use but i need a way to implement the script into the rom.....
i think it's like the a2sd+ script but i am not sure....
if anyone knows please help me
you need to split open your boot.img and modify the init.rc (the file where services are initialised at Android startup)
See this link for notes on working with the boot.img
you can create the symlinks directly in this file, have a look at the syntax and you should be able to work it out. The ln command doesn't work though, use the format:
Code:
symlink /system/customize/resource/bootanimation.zip /data/local/bootanimation.zip
Or you can create a dummy 'service' which executes a file on your filesystem (like /etc/rc.local) and put your "ln -s" commands in there.
Why not just create a custom update.zip with your changes only, then you can apply it after flashing any rom.
Klutsh said:
Why not just create a custom update.zip with your changes only, then you can apply it after flashing any rom.
Click to expand...
Click to collapse
How would you do this?
Say I wanted an update.zip that would remove plurk and add a certain app. How would I go about creating that?
removing and adding is easy with the update signer app.....i just want to add a script that symlinks directories at boot in order to avoid the use of a pc.....i tried the trick st0kes said and i am waiting for the flashing now to complete and send my feedback
nope it didn't work.....is there any specific place to put the command ????
i put it at the very end of the init.rc file
ok after a lot of reading i created a service which runs a folder with scripts...where i have the script that symlinks the files.....
service myscripts /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/myscript.d
oneshot
Click to expand...
Click to collapse
this is the service code
and here is the code i have into the "bootanimation" script which is inside the myscript.d folder
#!/system/bin/sh
mount /system
mount /data
ln -s /system/customize/resource/bootanimation.zip /data/local/bootanimation.zip
ln -s /system/customize/resource/android_audio.mp3 /data/local/android_audio.mp3
Click to expand...
Click to collapse
what am i doing wrong here ????? please someone with knowledge enlighten me!! the script does not run
damn....it's been a long night and still haven't found a way to do it !!!!!!
i tried all the followings:
1) added a file called "myscript" (it contained two lines with the symlink commands) in init.d folder in order to execute when the boot is complete - FAILED
2) added the same file into another folder and added a service at the bottom of the init.rc file that called it
service myscript /system/etc/myscripts/myscript
oneshot
Click to expand...
Click to collapse
-FAILED
3) added the SYMLINK commands into the init.rc file
a)at the bottom -FAILED
b) before the bootanim, bootsound services -FAILED
c) before the bootcomplete = 1 value in init.rc -FAILED
d) after sysinit execution in init.rc -FAILED
e) before sysinit execution in init.rc - FAILED
f) at the top after some lines of code in init.rc - FAILED
i read that HTC change the boot process and to run custom scripts at boot you must add their commands in "bootcomplete.bravo.rc"
i tried that too but FAILED again....i think this is logical cause these scripts are executed after the boot and just when the phone is gonna show the pin dialog....
i think it's something to do with the init.rc file...but i dunno what else to add....
is there anything i have to mount in order to symlink ???? add busybox to something or anything ??????
PLEASE someone with success at scripting like a2sd+ please help me
Try naming your script
Code:
03BootAnim
and place it in
Code:
/system/etc/init.d
Also don't forget to chmod +x it
how to chmod +x ??? nvm i did it...i am now signing it to try it
in adb
Code:
adb shell chmod +x /system/etc/init.d/03BootAnim
chmod 755 does the same, makes it executable by the system
Klutsh said:
Try naming your script
Code:
03BootAnim
and place it in
Code:
/system/etc/init.d
Also don't forget to chmod +x it
Click to expand...
Click to collapse
hey klutsh i tried what you said but it didn't work...
look i created the file
Code:
03BootAnim
and placed it into the
Code:
/system/etc/init.d
the commands i have into the file are these
Code:
#!/system/bin/sh
ln -s /data/local/bootanimation.zip /system/customize/resource/bootanimation.zip
ln -s /data/local/android_audio.mp3 /system/customize/resource/android_audio.mp3
ok i edited the commands like these but no result too.....
Code:
#!/system/bin/sh
busybox mount /system
busybox mount /data
busybox ln -s /data/local/bootanimation.zip /system/customize/resource/bootanimation.zip
busybox ln -s /data/local/android_audio.mp3 /system/customize/resource/android_audio.mp3
i checked with the
Code:
ls -l /system/etc/init.d
command and the permissions are all the same (they are all enabled i think, -rwxr-xr-x )
i wiped everything, flashed, rebooted but no bootanimation!!! the default android logo with the moving shade appears (i have deleted the animation in the system/customize/resource folder in order for the symlink to work)
what am i doing wrong ???? is there something with the script ?
I'm trying to get this working, and so far it is running before the bootanimation, but I get
Code:
run-parts: can't execute '/system/etc/init.d/03BootAnim': No such file or directory
Yet it is available...
what commands do you have in yours ????
maybe a reboot will fix it o yours since it will rescan ?
edit: hey klutsh i logcated my boot and i see that the symlinks do not work cause it says that /system/customize/resource/bootanimation.zip and android_audio.mp3 directories are read-only file systems
That's the problem then.
Already got a fix that you apply once only to a flashed rom then the boot anim runs from /data/local and can be replaced.
http://www.asificanrememberthat.com/DeLite/BootAmin_to_Data.zip
Flash that after any Sense rom that normally has bootanimation in /system/customize
It will delete the 2 files in /system/customize/resource
flash my own bootanimation to /data/local
create the required symlinks that survive reboot's.
You can then just replace the files in /data/local as needed.
as i see you made it with the update sign and packager isn't it ????
nice idea....
BUT why can't we access /system files through boot ???? is there any way to get root access at booting ???
THANKS YOU VERY MUCH for the great effort you made....
is there a way to implement the update-script into the 03BootAnim in order not to have to flah anything ????
the reson i want this is cause i am cooking my roms on my own and i want them to have all i need inside....not having to flash mod1, mod2 etc
It's a feature of the desire, no write access to /system unless in recovery.
You can just take those bit's from my update-script and add them to your own rom's script.
oh yes...this is what i was asking i have tow update-scripts though, one old and one in the android.new folder
i am using dsixda kitchen....in which should i put it ??? does it matter where is it?
edit: found it....signing to flash
HURRAYYYYYYYYYYYYYYYYYYYYYYY
hey klutsh i thank you a lot.....
it was so easy to do it just copy paste the update-script but we (I) took the hard way of READ-ONLY file system....anw i learned A LOT (if you think that i am reading 15hours constantly about this)
PROBLEM SOLVED
You can delete the android.new folder, it isn't used.

Droid 2 Deodex and Zip Aligned System & Framework Files

This is the stock Droid2 System and Framework files deodexed and zip aligned. This first of two packages that contains my Black (HTC) Status Bar Theme that looks like this. The next package will be the stock Droid2 deodexed and zip aliagned with stock status bar.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
( Picture from my Droid2 Theme for Droid 1. Status bar is exactly the same. Too lazy to update pic )​
It contains all original Droid2 files so if you have renamed or removed files it will replace them. This includes all Droid2 widgets and bloatware. If you have removed or renamed files then you can rename or remove the files from the app folder you placed on your memory card so you do not have to go back after install to clean up.​
A couple of apk files have been modified so the status icon matches status bar better. I still need to fix up a few more apk files and will post them as an update.zip file.​
I will have a update.zip file soon so it can be installed with clockwork. If you would like to test it for me please message me to let me know.​
Root Privilege:
You must have Root Access to install the files.
Check this thread and this thread on how to root your phone.​
ADB:
You also need to have The Android SDK installed so you can use adb commands.​
Clockwork Recovery:
Download from Android Market or check here and make donation after you download.​
Download:
Droid2 Deodexed Black Status Bar Command Line Install​
Droid2 Deodexed Stock Status Bar Command Line Install​
Install Instructions - Recommended Method - Command Line:
Prep
Download the archive from above, extract file to your compter. Place app and framework folders from archive on the root of your sd card (/sdcard/app /sdcard/framework).​
Make sure your phone is plugged into the USB cable and PC Mode is selected and that you have debugging enalbed on the phone application settings.​
Open DOS prompt and type the following commands or paste them at the DOS prompt.
adb shell
su
stop
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /sdcard/app/* /system/app/
cp /sdcard/framework/* /system/framework/
rm /system/app/*.odex
rm /system/framework/*.odex
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
reboot​
Install Instructions - Clockwork:
Coming Soon!​
After reboot it will take a few minutes too boot up so be patient. Your phone has not hung on boot unless the droid eye stops moving.​
Launcherpro:
Download themed LauncherPro 0.7.9.0 here.
Extract the com.fede.launcher.apk file and place on root of SD Card.
Make sure your phone is in PC Mode and Debugging is enalbed in Applications settings on phone.
Open command prompt on pc and type following commands.
adb shell
su
stop
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /sdcard/com.fede.launcher.apk /system/app/
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
reboot​
Looking forward to the clockwork package. This is the mod I've been waiting for.
wsfanatic said:
Looking forward to the clockwork package. This is the mod I've been waiting for.
Click to expand...
Click to collapse
Go with the command line for now. Having adb will be better in the long run and have to figure out how to write a script for update.zip to delete all the odex files when installing from clockwork.
If I've already deodexed, would I still need the script to remove the *.odex files?
I think its worth noting that your phone needs to be in PC Mode when plugging it in, with debugging on. If your in mass storage, it won't work because adb won't be able to access the sdcard while its mounted on the computer. These commands should also work via Android Terminal, although I imagine it's easier copying and pasting with a mouse and keyboard.
I know this may be obvious to some, but when you have people not knowing what they're doing in the first place, they assume that certain instructions were omitted intentionally.
Natty_lite said:
I think its worth noting that your phone needs to be in PC Mode when plugging it in, with debugging on. If your in mass storage, it won't work because adb won't be able to access the sdcard while its mounted on the computer. These commands should also work via Android Terminal, although I imagine it's easier copying and pasting with a mouse and keyboard.
I know this may be obvious to some, but when you have people not knowing what they're doing in the first place, they assume that certain instructions were omitted intentionally.
Click to expand...
Click to collapse
Thanks! It's there under the install instructions.
Natty_lite said:
These commands should also work via Android Terminal, although I imagine it's easier copying and pasting with a mouse and keyboard.
.
Click to expand...
Click to collapse
It isn't a good idea to try installing system files from the phone especially in terminal when there is a "stop" command because this will hault the GUI and the system so you'd be stuck.
Please stick to ADB for this at least. A strong suggestion.
newk8600 said:
It isn't a good idea to try installing system files from the phone especially in terminal when there is a "stop" command because this will hault the GUI and the system so you'd be stuck.
Please stick to ADB for this at least. A strong suggestion.
Click to expand...
Click to collapse
I was just going to suggest that too...
-----------
LauncherPro has been updated to 0.7.9.0 Check bottom of first post for download link and install instructions.
MotoBoy said:
I was just going to suggest that too...
Click to expand...
Click to collapse
LOL great minds think alike!
newk8600 said:
It isn't a good idea to try installing system files from the phone especially in terminal when there is a "stop" command because this will hault the GUI and the system so you'd be stuck.
Please stick to ADB for this at least. A strong suggestion.
Click to expand...
Click to collapse
You're right. I didn't think about that. I'll make sure I remember that for future reference. Thank God I used ADB
MotoBoy said:
Thanks! It's there under the install instructions.
Click to expand...
Click to collapse
No problem at all. Very clean work. I'm running the black status bar on my phone as we speak.
Natty_lite said:
You're right. I didn't think about that. I'll make sure I remember that for future reference. Thank God I used ADB
No problem at all. Very clean work. I'm running the black status bar on my phone as we speak.
Click to expand...
Click to collapse
Cool...so I take it that theme install went well.
MotoBoy said:
Cool...so I take it that theme install went well.
Click to expand...
Click to collapse
Yep, thanks to you. I had issues getting the Deodex tool to work properly on my W7 64 bit machine. This file made life easier.
Someone just upped a D1 theme in the Theme and Apps subforum. Shouldn't I be able to replace the .apks from your file with those? (I'm trying to get the stock Android icons back for browser, music, dialer, sms, and calendar)
Natty_lite said:
Yep, thanks to you. I had issues getting the Deodex tool to work properly on my W7 64 bit machine. This file made life easier.
Someone just upped a D1 theme in the Theme and Apps subforum. Shouldn't I be able to replace the .apks from your file with those? (I'm trying to get the stock Android icons back for browser, music, dialer, sms, and calendar)
Click to expand...
Click to collapse
That should work...
Would this work if I have already installed a custom rom? Or would it mess things up?
Thanks!
-John
What exactly is theme in the launcherpro? Sorry to have to ask but couldn't the image be provided for the app drawer from the screenshot? Thanks for the great work!
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
cp /sdcard/app/* /system/app/
cp /sdcard/framework/* /system/framework/
rm /system/app/*.odex
rm /system/framework/*.odex
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
reboot
Questions:
1. Could you explain the Mount line?
2. When you "rm" the odex files what happens. I mean have you done something to the associated .apx files?
If not, does that mean I could just use these commands and remove my .odex files and I would be what is called deodex'ed?
3. What is the benefit of de oxed' ing?
I am keeping an text file with abd instructions for different categories and do not understand some of the commands like the mount line that is the same in most of the procedures.
I have been googleing around trying to find a tutorial or lesson plan for adb and keep bookmarks on sites I find. Most of the info on the net that I find, you can get by typing adb help. That is fine, except it does not really explain what the commands mean or do.
Understand you are busy man, so if you do not have time for this, I'll understand. I am retired and have nothing else to do. Ha!
This is probably more information than you wanted to know, but you seem to be interested in learning so...
chrstdvd said:
Questions:
1. Could you explain the Mount line?
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
Click to expand...
Click to collapse
This line mounts the /system partition in read-write instead of the default read-only. In linux, hardware has special device files that are housed in the /dev/ directory. These devices get "mounted" for use to a mount point which usually has a nice, human-readable name. In this case, "/system". The "-t ext3" part defines the file system type. Typical linux file systems are ext2 and ext3. Winblows file systems are things like FAT32 and NTFS.
So, the command spelled out is something like this: remount in read-write mode the block device at "/dev/block/mmcblk1p21" to the mount point "/system" using the file system type "ext3".
2. When you "rm" the odex files what happens. I mean have you done something to the associated .apx files?
Click to expand...
Click to collapse
Yes something has been done. Deodexing is a lengthy process that, in part, converts the .odex files back to .dex files and reincorporates that data back into the associated .apk file. This is necessary for theme creation and some other kinds of development. The .odex files tend to prevent modification of .apk's, which is required for things like themes. The default .apk's are also signed zip files with a signature to prevent against tampering. In other words, although you can rename an .apk to .zip and extract it, you can't decompress an .apk, modify its contents (change an image or icon, for example) and then recompress without some consequences. Deodexing removes the signature stuff, making it far easier for developers to get at the guts of the content within the .apks.
If not, does that mean I could just use these commands and remove my .odex files and I would be what is called deodex'ed?
Click to expand...
Click to collapse
No. Simply removing the .odex files without replacing the .apk's with modified (deodexed) versions would leave you with non-functioning applications. The .odex files contain code that has been removed from the .apk files by developers in an effort to compress data and speed up the initial boot process.
Basically, when you phone boots for the first time, a lot of information is being decompressed into the /data directory for easy, quick access. The .odex files help streamline this process. With their data reincorporated into the .apk's, booting takes longer, but the benefits, like themes and other fixes that probably won't ever be available to non-deodexed phones, usually far outweigh the drawbacks.
3. What is the benefit of de oxed' ing?
Click to expand...
Click to collapse
For now, the ability to install custom themes is the main benefit. However, community developers are often able to provide fixes to problems on deodexed phones that the official devs will not, like the HTC Hero's stock lock screen issues.
If you're interested in learning more about adb, you will probably want to swan dive into some linux documentation. Without a linux background, the adb stuff will seem pretty foreign. I'd include links to some sources, but I'm new here and that's been restricted.
Stephan_ said:
What exactly is theme in the launcherpro? Sorry to have to ask but couldn't the image be provided for the app drawer from the screenshot? Thanks for the great work!
Click to expand...
Click to collapse
All that is themed in launcher pro are the icons when you long home press the home screen. So Shortcuts, Widgets, Folders and Wallpapers are using the same icons as Blur Home. Also the people and phone icons have been replaced to match the blur icons when you are using the default icons.
goliathvt said:
This is probably more information than you wanted to know, but you seem to be interested in learning so...
This line mounts the /system partition in read-write instead of the default read-only. In linux, hardware has special device files that are housed in the /dev/ directory. These devices get "mounted" for use to a mount point which usually has a nice, human-readable name. In this case, "/system". The "-t ext3" part defines the file system type. Typical linux file systems are ext2 and ext3. Winblows file systems are things like FAT32 and NTFS.
So, the command spelled out is something like this: remount in read-write mode the block device at "/dev/block/mmcblk1p21" to the mount point "/system" using the file system type "ext3".
Yes something has been done. Deodexing is a lengthy process that, in part, converts the .odex files back to .dex files and reincorporates that data back into the associated .apk file. This is necessary for theme creation and some other kinds of development. The .odex files tend to prevent modification of .apk's, which is required for things like themes. The default .apk's are also signed zip files with a signature to prevent against tampering. In other words, although you can rename an .apk to .zip and extract it, you can't decompress an .apk, modify its contents (change an image or icon, for example) and then recompress without some consequences. Deodexing removes the signature stuff, making it far easier for developers to get at the guts of the content within the .apks.
No. Simply removing the .odex files without replacing the .apk's with modified (deodexed) versions would leave you with non-functioning applications. The .odex files contain code that has been removed from the .apk files by developers in an effort to compress data and speed up the initial boot process.
Basically, when you phone boots for the first time, a lot of information is being decompressed into the /data directory for easy, quick access. The .odex files help streamline this process. With their data reincorporated into the .apk's, booting takes longer, but the benefits, like themes and other fixes that probably won't ever be available to non-deodexed phones, usually far outweigh the drawbacks.
For now, the ability to install custom themes is the main benefit. However, community developers are often able to provide fixes to problems on deodexed phones that the official devs will not, like the HTC Hero's stock lock screen issues.
If you're interested in learning more about adb, you will probably want to swan dive into some linux documentation. Without a linux background, the adb stuff will seem pretty foreign. I'd include links to some sources, but I'm new here and that's been restricted.
Click to expand...
Click to collapse
He took the words right out of my mouth
Thanks!
Thank you so much for the info. Linux huh, guess I will dive right in. My background is Basic, FORTRAN, COBAL AND Visual Basic for Apps (Excel only). I quit trying to keep up with Visual Basic because Object Oriented Programming was really starting to irritate me. I was fairly good in DOS back in the day. These adb commands remind me of DOS, so hopefully I will catch on and understand.
At least in the olden days you got a manual to explain the commands with some examples.
Anyway, Thank you. I will start Googleinh Linux.
Found this site and I am in pig heaven. Thanks again, things are starting to make sense, from the "old days perspective".
http://www.linux-tutorial.info/

Better integrating Busybox (2012-11-17)

Most Android ROMs use toolbox as primary binary with symlinks in /system/bin and /system/xbin. The problem with toolbox is that it sucks. On some ROMs it's even so limited that it does not even allow for --prefix
Busybox is a great replacement for toolbox, but in order to use it, you have to call it using 'busybox cmd'. I would much rather use it by calling 'cmd' but this would execute toolbox instead of busybox.
Most would think the command 'busybox --install' would fix this, but it does'nt. It tries to install links at /bin and /sbin.
The script below will replace any toolbox links in /system/bin and /system/xbin that is supported by the busybox version installed on the Android device running the script. This will make busybox the default binary when executing regular commands without adding 'busybox' at the beginning of the command.
For an example 'ls' instead of 'busybox ls'
Download as an update.zip
v1.3.0 (Nov 17, 2012) (MD5: c233964f0f62a16d7376739041e8b250) - busybox_installer.zip (Only for ArmV7 devices)
v1.3.0 (Nov 17, 2012) (MD5: e921a6c4119644a18d4feea565824ab1) - busybox_installer-nobin (Without binaries)
busybox.sh
Code:
#!/sbin/sh
for cmd in test find basename readlink ln rm; do
eval export "_$cmd=\"/sbin/busybox $cmd\""
done
_busybox=$($_find /system -type f -name "busybox")
_toolbox=$($_find /system -type f -name "toolbox")
if $_test -e "$_busybox" && $_test -e "$_toolbox"; then
sToolboxList="watchprops wipe vmstat date uptime reboot getevent getprop setprop id iftop ioctl ionice log lsof nandread newfs_msdos notify ps r schedtop sendevent setconsole setprop sleep smd start stop top"
sBusyboxList="`$_busybox --list`"
for applet in $sBusyboxList; do
if $_test -L /system/bin/$applet; then
if $_test "`$_basename $($_readlink -f /system/bin/$applet)`" = "toolbox"; then
$_ln -sf $_busybox /system/bin/$applet
if $_test -L /system/xbin/$applet; then
$_rm -rf /system/xbin/$applet
fi
fi
elif $_test -L /system/xbin/$applet; then
if $_test "`$_basename $($_readlink -f /system/xbin/$applet)`" = "toolbox"; then
$_ln -sf $_busybox /system/xbin/$applet
fi
elif ! $_test -e /system/bin/$applet && ! $_test -e /system/xbin/$applet; then
$_ln -sf $_busybox /system/bin/$applet
fi
done
for applet in $sToolboxList; do
$_ln -sf $_toolbox /system/bin/$applet
done
fi
Toolbox install links
watchprops, wipe, vmstat, date, uptime, reboot, getevent, getprop, setprop, id, iftop, ioctl, ionice, log, lsof, nandread, newfs_msdos, notify, ps, r, su, schedtop, sendevent, setconsole, setprop, sleep, smd, start, stop, top
Busybox install links
Whatever the currently installed busybox supports that is not in the list of toolbox install links
Change log
Dec 10 2011, 21:39 UTC:
The script will now leave skip replacing /system/bin/reboot as it needs to be pointed at toolbox
Dec 11 2011, 10:08 UTC:
Added an update zip that will configure busybox and it provides an extended 1.4MB binary instead of the regular 480KB most ROM's provide
Dec 12 2011, 09:25 UTC:
Added new busybox build (1.20.0.git 2011-12-11) since there was problem with the old one for some people
Added more busybox search dirs (/system/sbin and /sbin)
Added Toolbox install to make sure that some android specific links uses toolbox instead of busybox. See list above.
Jun 27 2012, 13:45 UTC:
Better Busybox and Toolbox search
Added symlink check to make sure that busybox only replaces toolbox links and not things like "sh -> mksh"
Nov 17 2012, 10:30 UTC:
Added a custom toolbox binary to the ArmV7 installer
Added latest CM9 busybox binary to the ArmV7 binary
Added an auto search function to locate the binaries on the device
Fixed both installers to work with newer devices that uses EXT4 file system
Thanks, dk_zero-cool. I've been looking for a guide to installing BusyBox, since I can only find an add-supported installer in the Android Market.
Thanks, nice job!!
Ran the script, worked and did fine....ONE BIG ISSUE....now if you have any script or app that relies on the "reboot" function, it no longer works. For example, rom manager & bootstrapper will not boot into recovery. I even open up terminal and typed:
Code:
$ su
# reboot
...and nothing...does the reboot in /bin need to not be linked to busybox?
KMDonlon said:
Ran the script, worked and did fine....ONE BIG ISSUE....now if you have any script or app that relies on the "reboot" function, it no longer works. For example, rom manager & bootstrapper will not boot into recovery. I even open up terminal and typed:
Code:
$ su
# reboot
...and nothing...does the reboot in /bin need to not be linked to busybox?
Click to expand...
Click to collapse
Try to relink it back to toolbox and then I will update the script to leave reboot alone.
1: mount -o remount,rw /system
2: rm -r /system/bin/reboot
3: ln -s /system/bin/toolbox /system/bin/reboot
Great! Will try again!
Cool... can I steal this?
I'd implement it with a busybox install script
I'm not a super expert on the subject but is /system/sbin a possible location?
zeppelinrox said:
Cool... can I steal this?
I'd implement it with a busybox install script
I'm not a super expert on the subject but is /system/sbin a possible location?
Click to expand...
Click to collapse
You can use this as you like.
And you can type "echo $PATH" in an adb shell, if /system/sbin is there, then it will work. But why? /system/xbin is usually the default dir for placing busybox, otherwise /system/bin. And you will have to change the script since it will only check in /system/bin and /system/xbin
All times in my scripts report UTC time instead of system time, I am sure there is one other applet in /bin that was linked to toolbox that is now linked to busybox and reporting the date wrong or at least the date/time that busybox says (UTC time).
KMDonlon said:
All times in my scripts report UTC time instead of system time, I am sure there is one other applet in /bin that was linked to toolbox that is now linked to busybox and reporting the date wrong or at least the date/time that busybox says (UTC time).
Click to expand...
Click to collapse
Do the same as before, only this time replace 'reboot' with 'date'
This must be a setting in the busybox compile menu. A new binary might fix this because busybox should be able to display system time. But for now point date back to toolbox and it will work for you.
Yup, did what you just said and all is fine. Thanks! Is there a way you can implement the reboot and date applet ignore in the script within the .zip you made.... I think it will save users some headaches.
dk_zero-cool said:
You can use this as you like.
And you can type "echo $PATH" in an adb shell, if /system/sbin is there, then it will work. But why? /system/xbin is usually the default dir for placing busybox, otherwise /system/bin. And you will have to change the script since it will only check in /system/bin and /system/xbin
Click to expand...
Click to collapse
Well bb is sometimes installed elsewhere.
At first SuperCharger only looked in those 2 locations and stopped when it wasn't found.
What would happen if there was a second version elsewhere?
I suppose it wouldn't matter because of the symlinks.
KMDonlon said:
Yup, did what you just said and all is fine. Thanks! Is there a way you can implement the reboot and date applet ignore in the script within the .zip you made.... I think it will save users some headaches.
Click to expand...
Click to collapse
The reboot fix is already in the zip file.
The date fix I don't want in it, I would much rather fix busybox to work properly.
I'm currently looking at that.
zeppelinrox said:
Well bb is sometimes installed elsewhere.
At first SuperCharger only looked in those 2 locations and stopped when it wasn't found.
What would happen if there was a second version elsewhere?
I suppose it wouldn't matter because of the symlinks.
Click to expand...
Click to collapse
No that does not mater because of the symlinks.
That's why I referrer to the complete path, f.eks, "/system/xbin/busybox" and not just the binary name "busybox".
I am going to try your binary for Busybox and see, I am currently using JRummy's BB installer which installed v1.19.3 which is about 1.06MB....
EDIT: Just flashed the .zip, my phone will not boot past the logo....did a battery pull several times and can't get into CWR....SBF time
KMDonlon said:
I am going to try your binary for Busybox and see, I am currently using JRummy's BB installer which installed v1.19.3 which is about 1.06MB....
EDIT: Just flashed the .zip, my phone will not boot past the logo....did a battery pull several times and can't get into CWR....SBF time
Click to expand...
Click to collapse
Put in your USB cable, open a terminal/console on your computer and try "adb logcat" to see what it says when it stops booting.
You must of cause have adb installed on your computer, and USB drivers if you use windows, which I don't and cant help with.
Already reflashed phone back....sorry, no logcat....
Do it again...
C'mon take one for the team... hehe...
LMFAO!!!! Sorry dude, I ain't gonna do it....will let some other poor soul ....I got honey do's today, it's Sunday!!
Whatever it was I can't recreate it. Works fine when I flash the damn thing.
Here's a thought.....make a script that reverses the toolbox links, I can undo it and try to flash again....I was unable to manually install your busybox version so I think some other toolbox applet is causing me trouble.....

[MOD] Enable Stock Hotspot on Verizon

I have gotten the built-in wireless tether to work. I know there's been some discussion about getting Wireless tether without FoxFi and similar.
Since we cannot use the recovery method directly, you can still use the tools and everything from it.
So to begin:
Obviously, you must have root for this to work.
1) Download the patch.zip from the original thread. [here: http://forum.xda-developers.com/showthread.php?t=2768837 ]
2) extract the zip to somewhere on sdcard. I extracted mine to the Download folder. You may need to edit the script below to reflect your locations.
3) okay, this part gets a little weird, but bear with me...
Save this code as run.sh in Download folder or wherever you extracted. You can over-write the old run.sh if you save it in toggle folder where original was located-- BE SURE TO EDIT AS REQUIRED
Code:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/data/local/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
4) now open up adb on pc (preferred!!! So you can still see progress and if necesary you can undo/alter/fix things) or terminal emulator (untested but should work, may be weird since you have to reboot phone while it's interface is locked up)
Run:
adb shell
su
sh /mnt/sdcard/Download/toggle/run.sh [or where ever you saved it]
5) Your phone will probably lock up now because you've just replaced the framework-res.apk while the system was running.
adb reboot or reboot by other methods.
6) Profit ;]
I DO NOT WARRANTY OR GUARANTEE THIS METHOD. USE AT YOUR OWN RISK
I believe the sqlite edits serve the purpose of showing the icon in the quick settings pull down. Otherwise, just replacing the framework-res.apk with the correct changes is enough: See this thread for the changes needed:
http://forum.xda-developers.com/showthread.php?t=2759119
Incidentally, I was attempting to make the changes on my own and recompile the framework-res.apk, and I must've done something not quite right because the phone hung at the verizon logo. Thankfully adb was up so I was able to remount system as rw to replace the edited framework-res.apk from the original thread OP linked. Interestingly enough, as soon as I finished copying the edited file, the phone continued booting just fine, and I'm posting from the native tethered connection now.
Edit: I was able to do the changes on the framework-res.apk extracted/decompiled from my phone after all. I'm guessing that the phone didn't like deflate method as opposed to store method (no compression) on the resources.arsc file in the apk file. Had to use the 7zip command line tool to save the modified resources.arsc file without compression to the original apk:
7z u -mx0 framework-res.apk.zip resources.arsc
where -mx0 means no compression (copy)
Got it enabled by just replacing the framework-res.apk, and noticed speeds were really slow. I get 1.88mbps on LTE at home (so-so coverage), but only .15mbps on my iPad connected to my phone via Wi-Fi.
I did this: http://forum.xda-developers.com/showpost.php?p=53431713&postcount=9
SO MUCH EASIER than what you guys were doing. :good:
Droid_Evo_8 said:
I did this: http://forum.xda-developers.com/showpost.php?p=53431713&postcount=9
SO MUCH EASIER than what you guys were doing. :good:
Click to expand...
Click to collapse
It's a manner of preference. In terms of overhead, this native method should technically be quicker to enable, as it does not have to wait for the exposed module to intercept the call and return an empty array of apps to execute for the provision check. That being said, we're probably talking miliseconds at most. While I use xposed for other modules sometimes, others might prefer not to, and this native method does not require it.
vacaloca said:
It's a manner of preference. In terms of overhead, this native method should technically be quicker to enable, as it does not have to wait for the exposed module to intercept the call and return an empty array of apps to execute for the provision check. That being said, we're probably talking miliseconds at most. While I use xposed for other modules sometimes, others might prefer not to, and this native method does not require it.
Click to expand...
Click to collapse
I don't know much about adb or terminal emulator so I'm fine with it. :good:
Here's to hoping for an easy tethering mod!
fillyo said:
Here's to hoping for an easy tethering mod!
Click to expand...
Click to collapse
I'm not sure how easier it can get than installing xposed framework + X Tether mod and rebooting, or replacing the framework-res.apk file on your phone with the one listed in the OP... either will work. This of course assumes you have the Verizon model. Replacing the premade framework-res.apk on any other S5 model would probably cause issues and wouldn't solve anything .
I just made it 'harder' on myself by deciding to copy the original framework-res.apk from my phone, and using the latest apktool and aapt to extract the apk, make the modifications, rebuild it, and replace it on my phone (after renaming the original to .bak). I mostly did this to refresh my memory on how to do it as I had done the process with another phone a while back to do the same mod. As I mentioned earlier, the sqlite stuff is only necessary if you want a toggle in the quick settings bar... otherwise you can just go into settings menu and enable it that way.
vacaloca said:
I'm not sure how easier it can get than installing xposed framework + X Tether mod and rebooting, or replacing the framework-res.apk file on your phone with the one listed in the OP... either will work.
Click to expand...
Click to collapse
I don't see the framework-res.apk file in OP, am I missing something? I have no idea how to decompile mine to make changes.
fillyo said:
I don't see the framework-res.apk file in OP, am I missing something? I have no idea how to decompile mine to make changes.
Click to expand...
Click to collapse
It's linked to in step (1). It's inside the zip file that's meant to be flashed in a recovery... however, because our bootloader is still locked, we cannot flash a recovery, so the way to do it is by replacing the framework-res.apk file as the filesystem is live, which as the OP mentions, will trigger a soft reboot as this file is used extensively by Android apps.
vacaloca said:
It's linked to in step (1). It's inside the zip file that's meant to be flashed in a recovery... however, because our bootloader is still locked, we cannot flash a recovery, so the way to do it is by replacing the framework-res.apk file as the filesystem is live, which as the OP mentions, will trigger a soft reboot as this file is used extensively by Android apps.
Click to expand...
Click to collapse
I got the framework-res apk from the zip package, I guess I am a little nervous since this is from a dev edition, correct? Anyone else successfully just replace framework-res from the zip package on their retail Verizon GS5?
fillyo said:
I got the framework-res apk from the zip package, I guess I am a little nervous since this is from a dev edition, correct? Anyone else successfully just replace framework-res from the zip package on their retail Verizon GS5?
Click to expand...
Click to collapse
The OP (presumably), user in post #3, and myself before I did the changes manually.
SO I followed these instructions and this is what i get both from adb and Term Em.
mount: No such file or directory
: Read-Only file systemramework-res.apk.bak
: Read-Only file systemramework-res.apk
/mnt/sdcard/download/toggle/run.sh[8]: /mnt/sdcard/download/toggle/sqlite3: can't execute: permission denied
I use the same folder structure you did, created a download folder and extracted the zip...
Thoughts?
tangoboyz said:
SO I followed these instructions and this is what i get both from adb and Term Em.
mount: No such file or directory
: Read-Only file systemramework-res.apk.bak
: Read-Only file systemramework-res.apk
/mnt/sdcard/download/toggle/run.sh[8]: /mnt/sdcard/download/toggle/sqlite3: can't execute: permission denied
I use the same folder structure you did, created a download folder and extracted the zip...
Thoughts?
Click to expand...
Click to collapse
Seems at least like 2 errors... the mount command can't find the input or output directories, thus you attempt to copy the files and get read-only file system, and it looks like sqlite3 needs to be changed to executable... chmod +x sqlite3
Also make sure you're running as root, obviously.
I saw a similar post int the android development subforum, and they seem to believe you will bootloop if you try to overwrite your framework-res. I chickened out and just did the xposed and x tether mod.
vacaloca said:
Seems at least like 2 errors... the mount command can't find the input or output directories, thus you attempt to copy the files and get read-only file system, and it looks like sqlite3 needs to be changed to executable... chmod +x sqlite3
Also make sure you're running as root, obviously.
Click to expand...
Click to collapse
I am rooted. Here's what i had in my run.sh:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
NOW does this look right??
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod +x 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
I'm sorry as I'm very new to this.
tangoboyz said:
I am rooted. Here's what i had in my run.sh:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
NOW does this look right??
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod +x 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
I'm sorry as I'm very new to this.
Click to expand...
Click to collapse
The original script should work assuming the files are in the right path... when I mentioned make sure you are running as root meant, make sure you run the 'su' command and get the # prompt before you run the script, otherwise the script won't run with root permissions and will fail.
For the third line, you (and the OP) can replace the mount command with:
Code:
mount -o,remount rw /system
----
As an aside, the chmod 0777 part in the original script already does mark the file as executable... chmod works with generic +rwx (read,write,execute) distinctions or the regular numbering permissions (777 means rwx for everyone)
Edit: the last line of the script should start with: /data/local/tmp/sqlite3
because that's the one that you set the permissions to rwx, not the one in your sdcard
vacaloca said:
The original script should work assuming the files are in the right path... when I mentioned make sure you are running as root meant, make sure you run the 'su' command and get the # prompt before you run the script, otherwise the script won't run with root permissions and will fail.
For the third line, you (and the OP) can replace the mount command with:
Code:
mount -o,remount rw /system
----
As an aside, the chmod 0777 part in the original script already does mark the file as executable... chmod works with generic +rwx (read,write,execute) distinctions or the regular numbering permissions (777 means rwx for everyone)
Edit: the last line of the script should start with: /data/local/tmp/sqlite3
because that's the one that you set the permissions to rwx, not the one in your sdcard
Click to expand...
Click to collapse
Hmm still no dice... Something isn't working right. Really I wanted the Hotspot in the pull down menu. I am currently paying for hotspot anyway....
Just found that wanam xposed has an option to skip provisioning check. Anyone tried this yet? Seems to enable native tethering but doesn't give a quick settings button.
dlscott1111 said:
Just found that wanam xposed has an option to skip provisioning check. Anyone tried this yet? Seems to enable native tethering but doesn't give a quick settings button.
Click to expand...
Click to collapse
Yes, we have tried it and it works. The quick settings button, as I have mentioned earlier in this thread, is what the sqlite3 executable and the file commands it takes in (just a simple text file of DB commands) take care of. You could also just get sqlite editor ($3 from the play store, IIRC) and do them manually if you don't like command line tools. it's basically adding "WiFiHotspot" to system -> notification_panel_active_app_list_for_reset and notification_panel_default_active_app_list in the settings.db file in /data/data/com.android.providers.settings/databases/
Or you could just do it the free with the command line sqlite3 using the tools already at your disposal

Categories

Resources