Related
I just saw a tutorial in 4PDA by R0iz and wanted to share it here!
The link to the original post translated:
http://tinyurl.com/self-assembly-androidOS
Extract the files *. img
To extract system.img, used unyaffs (http://code.google.com/p/unyaffs/)
I have compiled under Ubuntu 64. With Unyaffs can only be extracted system.img.
To extract boot.img use extract-kernel.pl and extract-ramdisk.pl
# extract-kernel.pl boot.img
# extract-ramdisk.pl boot.img
Click to expand...
Click to collapse
Rebuilding boot.img
After extracting boot.img with the enclosed extract-*. pl
In order to collect boot.img with Custom kernel in the same folder run:
# mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
# mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Click to expand...
Click to collapse
Rebuilding system.img
At first glance it seems that you can simply mount the image and format it with YAFFS, but it's not because, as SPL Hero does not allow flash system.img directly.
You must use the format update.zip packages for this. (читайте ниже) (See below)
Write update.zip quite simple really. For example, to add the package test.apk in your rum:
- Create an empty folder <workdir>
- Create a folder structure for test.apk (<workdir> / system / app) and copy test.apk
- Create a folder structure for the update-script (<workdir> / META-INF/com/google/android)
- Edit <workdir> / META-INF/com/google/android/update-script
- Insert the following:
show_progress 0.1 0 show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM: copy_dir PACKAGE: system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app set_perm_recursive 0 0 0755 0644 SYSTEM: app
show_progress 0.1 10 show_progress 0.1 10
- Pack the contents <workdir> in zip (not the folder itself <workdir>, only its contents)
Now you have to sign a zip file. Testsign.zip download and copy it to your <SDK> / tools.
Unzip it there, thus creating a sub-folder sign with a file testsign. in it.
Then in the folder <workdir>, run this command:
java-classpath "<SDK> / tools / sign / testsign.jar" testsign file.zip file-signed.zip
Everything is now ready for your update.zip pouring into the apparatus by a modified recovery.
Click to expand...
Click to collapse
Change. Apk package
apk can just unpack an archive, change what you need and pack it back. But in the end you have to sign it as well as update.zip packages.
ODEX files
- What is it? Answer
- How to get rid of them?
For deodex ODEX files, use this howto
Then you can create classes.dex file by running smali from your "out". Then rename it to classes.dex and add it to apk.
- How to create them?
Use dexopt-wrapper on the device.
Click to expand...
Click to collapse
Porting ROM with other devices.
Well, this part is simple smile_good.gif
- Extract system.img
- Extract boot.img
- Replace boot.img-kernel of the original Roma HTC Hero.
- Rebuild boot.img
- Collect update.zip (see how it's done in any Custom rum for Hero)
- Sign and flash.
Device should start, and even be able to call, but probably will not work WiFi, BT, trackball.
Androsign script (Linux)
Androsign allows you to quickly sign the zip and apk. Just put it in <SDK> / tools, then CHMOD + X. If the path to the folder \ tools registered in the PATH, then you can run this script by typing:
androsign /dev/folder1/folder2/update.zip
He will Update-signed.zip (or App-signed.apk, etc.) in the same folder where the original file.
THANKS ARE WELCOMED!
Can we actually use this to port Sense or MIUI ?
this explains part of the process, the steps to do fo that purpose extracting and rebuilding but of course not about the code. i've heard MIUI is complex than sense
Most of us know this allready but nice to see it being said instead of learning the hard way
Sent from my GT540 using XDA Premium App
Hey, this is my first boot and down animation for the HTC Desire HD.
It's made to match the splash screen which i made available here too.
**PLEASE NOTE. I'm not responsible if anything goes wrong. The install methods below are not mine, they just worked for me**
Boot Animation Preview
Boot Animation preview - actual animation is a lot smoother than this
{
"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"
}
Down Animation preview - actual animation is a lot smoother than this
----------------------------------------------------------------------
bootanimation.zip goes in /data/local/
easiest method is:
Code:
adb remount
adb push bootanimation.zip /data/local
or copy bootanimation.zip to your sd card and move the file to /data/local/ with Root Explorer
----------------------------------------------------------------------
downanimation.zip goes in /system/customize/resource/
easiest method is to copy the downanimation to your sd card and use the following:
Code:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/customize/resource
# cp /sdcard/downanimation.zip /system/customize/resource/
# chmod 755 /system/customize/resource
#exit
----------------------------------------------------------------------
Follow the instructions here or hereto install the Splash image.
I have also attached the wallpaper to match. Hope you like it The wallpaper can be saved from the preview image, all other files must be downloaded from the attachments
Hi,
Downanimation can be copied as the bootanimation, using Root Explorer?
Thx
What do you set permissions to?
Sent from my Desire HD using XDA App
hXc71 said:
Hi,
Downanimation can be copied as the bootanimation, using Root Explorer?
Thx
Click to expand...
Click to collapse
You can try, but it might look a little weird when on boot up the animation says shutting down
mattmiller said:
What do you set permissions to?
Sent from my Desire HD using XDA App
Click to expand...
Click to collapse
I just have both set as 755. Not sure if it makes a difference!
I mean once you use file explorer, what do you set the read/write settings to? Ex:rw-r-r?
Sent from my Desire HD using XDA App
rwxr-xr-x is what mine is set to.
mark_1000 said:
rwxr-xr-x is what mine is set to.
Click to expand...
Click to collapse
Hi,
How exactly can do that?
Any step by step guide?
Sorry if this question is too noob to be answered.
Thanks...
kscheah said:
Hi,
How exactly can do that?
Any step by step guide?
Sorry if this question is too noob to be answered.
Thanks...
Click to expand...
Click to collapse
Is your phone rooted? and if so, do you have Root Explorer?
What's the x's? I no option for x's
mark_1000 said:
rwxr-xr-x is what mine is set to.
Click to expand...
Click to collapse
Sent from my Desire HD using XDA App
R is Read, W is Write, X is Execute. What file explorer are you using?
I hope there will be an Inspire version of this For now, I'll still use it~
mark_1000 said:
downanimation.zip goes in /system/customize/resource/
easiest method is to copy the downanimation to your sd card and use the following:
Code:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/customize/resource
# cp /sdcard/downanimation.zip /system/customize/resource/
# chmod 755 /system/customize/resource
#exit
----------------------------------------------------------------------
Click to expand...
Click to collapse
Reboot screen is now black....
Any issue?
Did it 100% as u explained above
bootanimation and Splash1 wrks great only downanimation won´t
EDIT:
Got it... i´v typed chmod 777 instead of 755....
Now it works like a charm
THX
mark_1000 said:
Hey, this is my first boot and down animation for the HTC Desire HD.
It's made to match the splash screen which i made available here too.
**PLEASE NOTE. I'm not responsible if anything goes wrong. The install methods below are not mine, they just worked for me**
Boot Animation Preview
Boot Animation preview - actual animation is a lot smoother than this
Down Animation preview - actual animation is a lot smoother than this
----------------------------------------------------------------------
bootanimation.zip goes in /data/local/
easiest method is:
Code:
adb remount
adb push bootanimation.zip /data/local
or copy bootanimation.zip to your sd card and move the file to /data/local/ with Root Explorer
----------------------------------------------------------------------
downanimation.zip goes in /system/customize/resource/
easiest method is to copy the downanimation to your sd card and use the following:
Code:
adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/customize/resource
# cp /sdcard/downanimation.zip /system/customize/resource/
# chmod 755 /system/customize/resource
#exit
----------------------------------------------------------------------
Follow the instructions here or hereto install the Splash image.
I have also attached the wallpaper to match. Hope you like it The wallpaper can be saved from the preview image, all other files must be downloaded from the attachments
Click to expand...
Click to collapse
No need for commands on Downanimation...
just copy it to the root of your SD card
open root explore mark the downanimation.zip and copy to /data/local overwite if the file already there .. agin mark the downanimation.zip the choose permissions and in read mark owner - group - others.. and in write just mark owner.. then push ok and its saved..
worked for me .. sorry for my bad english
You don't need to use adb to push the file into /data/local.
It can be copied directly using the terminal application.
cp /sdcard/bootanimation.zip /data/local
The same can be done for the down animation
nice animation, installing!
Hey Mike, any chance you could do a "Boot Animation" that says Desire S?
I like!
Would it be possible to get the boot animation & splash screen done for the plain old Desire?
Tnx!!! Like!!!
Thanks for these! Works great on my phone! Much better looking than the stock one's.
Hi,
I got myself the android.policy.jar (313bytes) and android.policy.odex (350.584bytes) from the /system/framework.
I then copied the whole /system/framework folder from my P880 for baksmali, also.
I then baksmalied the android.policy.odex with:
java -Xmx512m -jar baksmali.jar -x android.policy.odex -d framework -o output
and resmalied it (this is a test) with:
java -Xmx512m -jar smali.jar output/ -o classes.dex
This all works without an error message.
I end up with the classes.dex (314.716bytes).
Here my trouble begins. I put classes.dex with 7zip and normal compression into the original android.policy.jar (now 143.886bytes)
I removed the ORIGINAL android.policy.odex and android.policy.jar from my phone and copied the new android.policy.jar (143.886bytes) into the their place (/system/framework).
After reboot I am stuck with a bricked phone
To investigate, I then reodexed android.policy.jar with
dexopt-wrapper android.policy.jar new.android.policy.odex /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.lge.bluetooth.jar:/system/framework/com.lge.core.jar
which works fine, but my NEW android.policy.odex is not the original 350.584bytes, but 322.368bytes
I added the file signature from the old odex, but the size remains the same.
My questions:
Why did my android.policy.jar (143.886bytes) not work, although I changed none of the coding?
Why did my android.policy.odex (322.368bytes) not have the same size as the original odex in the rom?
I attach these two files for you. Please help me. :crying:
Thank you!
PS: I had to rename the odex to txt, because it cant be attached otherwise.
1.use kitchen extract rom from N7000ZSLO2_N7000OZSLO2_N7000XXLSO_HOME.tar.md5, then deodex rom.
2.copy android.policy.jar to sdcard.(android.policy.jar is unmodified.)
3.use dexopt-wrapper reodex ,get android.policy.odex.
4.copy android.policy.odex to /system/framework/android.policy.odex and set 644 permissions
5.reboot device and stay at samsung logo frame
now,How to deal with this problem? help,thx.
process
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
attach file is logcat information.The log file alway display "DexOpt: Some deps went away"
What Rom are you using?
But more important: Why do you want to do this?
If you using a deodexed rom, you don't need an odexed jar
ThaiDai said:
What Rom are you using?
But more important: Why do you want to do this?
Click to expand...
Click to collapse
offical rom:N7000ZSLO2_N7000OZSLO2_N7000XXLSO_HOME.tar
i want to add a recovery menu item.
now after update file,device status:
framework-res.apk OK
android.policy.jar fail
nokiamodeln91 said:
If you using a deodexed rom, you don't need an odexed jar
Click to expand...
Click to collapse
in framework folder,all is odex.so if i want to modify a jar, must need an odex file.i want to update file as little as possible.
update.
quywz said:
Code:
adb shell
su
busybox cp -f /data/local/tmp/odex/dexopt-wrapper /system/bin/dexopt-wrapper
chmod 755 /system/bin/dexopt-wrapper
busybox cp -f /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
busybox cp -f /system/framework/android.policy.odex /system/framework/android.policy.odex.bak
rm /system/framework/android.policy.odex
busybox cp -f /data/local/tmp/odex/android.policy.jar /system/framework/android.policy.jar
dexopt-wrapper /system/framework/android.policy.jar /system/framework/android.policy.odex
busybox dd if=/system/framework/android.policy.odex.bak of=[COLOR="Red"][B]/data/local/tmp/odex/android.policy.odex[/B][/COLOR] bs=1 count=20 skip=52 seek=52 conv=notrunc
rm /system/framework/android.policy.jar
busybox cp -f /system/framework/android.policy.jar.bak /system/framework/android.policy.jar
rm /system/framework/android.policy.jar.bak
rm /system/framework/android.policy.odex.bak
chmod 644 /system/framework/android.policy.odex
reboot
Click to expand...
Click to collapse
Is there a reason you're copying the .odex signature to /data/local/tmp/odex/android.policy.odex instead of /system/framework/android.policy.odex ? With your script, /system/framework/android.policy.odex remains unsigned.
Einril said:
Is there a reason you're copying the .odex signature to /data/local/tmp/odex/android.policy.odex instead of /system/framework/android.policy.odex ? With your script, /system/framework/android.policy.odex remains unsigned.
Click to expand...
Click to collapse
sorry,In this thread,I write wrong.
The actual operation is "busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc".but the result is same.
if=/system/framework/android.policy.odex.bak is input file.
of = /system/framework/android.policy.odex is output file.
copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.
quywz said:
sorry,In this thread,I forgot to copy "busybox cp -f /data/local/tmp/odex/android.policy.odex /system/framework/android.policy.odex".
The actual operation don't forgot.but the result is same.
Click to expand...
Click to collapse
So what you're doing is :
1. optimize /system/framework/android.policy.jar to create /system/framework/android.policy.odex
2. copy the signature from /system/framework/android.policy.odex.bak to /data/local/tmp/odex/android.policy.odex
3. copy /data/local/tmp/odex/android.policy.odex to /system/framework/android.policy.odex
Am I right ? If I am, you're deleting the .odex file created from android.policy.jar, and replacing it with another one.
Einril said:
So what you're doing is :
1. optimize /system/framework/android.policy.jar to create /system/framework/android.policy.odex
2. copy the signature from /system/framework/android.policy.odex.bak to /data/local/tmp/odex/android.policy.odex
3. copy /data/local/tmp/odex/android.policy.odex to /system/framework/android.policy.odex
Am I right ? If I am, you're deleting the .odex file created from android.policy.jar, and replacing it with another one.
Click to expand...
Click to collapse
sorry,In this thread,I write wrong.
The actual operation is "busybox dd if=/system/framework/android.policy.odex.bak of= /system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc".but the result is same.
if=/system/framework/android.policy.odex.bak is input file.
of = /system/framework/android.policy.odex is output file.
copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.
1.right
2.copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.above is my copy wrong.
3.used new signed /system/framework/android.policy.odex.
4.reboot,device stay at logo frame
edit.invalid context
quywz said:
1.right
2.copy .odex signature from /system/framework/android.policy.odex.bak to /system/framework/android.policy.odex.above is my copy wrong.
3.used new signed /system/framework/android.policy.odex.
4.reboot,device stay at logo frame
Click to expand...
Click to collapse
Is the attached script the entire script ?
If it is, why are you only copying the .odex files from /data/local/tmp/odex/ to /system/framework/, and not android.policy.jar and framework.jar ?
Einril said:
Is the attached script the entire script ?
If it is, why are you only copying the .odex files from /data/local/tmp/odex/ to /system/framework/, and not android.policy.jar and framework.jar ?
Click to expand...
Click to collapse
yes,entire script.
somebody tell me "Pls use original jar".I tried to use new jar.but the result is same.:crying:
quywz said:
yes,entire script.
somebody tell me "Pls use original jar".I tried to use new jar.but the result is same.:crying:
Click to expand...
Click to collapse
You don't set the permissions for the files any longer. Is there a reason for that ? Permissions should be 644 I guess.
Einril said:
You don't set the permissions for the files any longer. Is there a reason for that ? Permissions should be 644 I guess.
Click to expand...
Click to collapse
I tried you said,isnt reason.I had set Permissions 755 and 777,all invalid :crying:
I dont understand why fail.I am finding reason....
quywz said:
I tried you said,isnt reason.I had set Permissions 755 and 777,all invalid :crying:
I dont understand why fail.I am finding reason....
Click to expand...
Click to collapse
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Einril said:
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Click to expand...
Click to collapse
thx.
I tried to update files one by one.after update framework-res.apk is ok.android.policy.jar is fail.so I dont modfiy android.policy.ja.then optimized it. updating android.policy.odex refer to attached script(not including framework part).but device is NG.
I dont find a NG reason.
Einril said:
Hum, I personally don't find any error in your script then... Maybe this is due to an error in the new files (framework-res.apk, framework.jar or android.policy.jar). I guess you modified them, and maybe you did some mistakes :/
Click to expand...
Click to collapse
today ,I found a problem.dexopt-wrapper android.policy.jar and get android.policy.odex.Compare origial android.policy.odex,we fond dex's magic is different.origial android.policy.odex is "dex035", new origial android.policy.odex is "dex036".if i manually modify different,device is still stay.I guss if i manually modify different,odex's checknum is wrong.what do lead to new odex's magic change?is API Level ?
quywz said:
today ,I found a problem.dexopt-wrapper android.policy.jar and get android.policy.odex.Compare origial android.policy.odex,we fond dex's magic is different.origial android.policy.odex is "dex035", new origial android.policy.odex is "dex036".if i manually modify different,device is still stay.I guss if i manually modify different,odex's checknum is wrong.what do lead to new odex's magic change?is API Level ?
Click to expand...
Click to collapse
In dexFile.h :
Code:
/* current version, encoded in 4 bytes of ASCII */
#define DEX_MAGIC_VERS "036\0"
/*
* older but still-recognized version (corresponding to Android API
* levels 13 and earlier
*/
#define DEX_MAGIC_VERS_API_13 "035\0"
So yes, your dexopt-wrapper uses an API level >= 14 (ICS and JB), whereas your original ROM file must be older.
Einril said:
In dexFile.h :
Code:
/* current version, encoded in 4 bytes of ASCII */
#define DEX_MAGIC_VERS "036\0"
/*
* older but still-recognized version (corresponding to Android API
* levels 13 and earlier
*/
#define DEX_MAGIC_VERS_API_13 "035\0"
So yes, your dexopt-wrapper uses an API level >= 14 (ICS and JB), whereas your original ROM file must be older.
Click to expand...
Click to collapse
offical rom version is 4.1.2.so API level should is 16.but extract odex from device is 035.
Recently I designed my own android bootanimation.zip file. I'm very proud of it and would like to make it my boot animation (the graphic that shows up when you start up your phone). However, I ran into a complication that I can't seem to solve or find any solutions to online.
Info: I'm running Cyanogen 12 on a Motorola Nexus 6. I placed my bootanimation.zip in the /system/media folder (and /data/local, but that didn't work).
The issue (read carefully please!): I have confirmed that my bootanimation.zip file IS formatted correctly and DOES display properly. When I enter my phone's shell as root I can properly execute the /system/bin/bootanimation command. This command simply previews bootanimation. However, I can't execute the binary as non-root (which I should be able to do). I even went as far as changing the ownership of bootanimation to the shell (non-root account). Basically, I see something like this.
Code:
shell> bootanimation #/system/bin/bootanimation should by in my $PATH
/system/bin/sh: bootanimation: not found
shell> cd /system/bin
shell:/system/bin> ls bootanimation
bootanimation: Permission denied
shell:system/bin> ./bootanimation
/system/bin/sh: ./bootanimation: not found
shell:system/bin> su #log in as root
root> cd /system/bin
root:/system/bin> ls -l bootanimation
-rwxr-xr-x shell shell 34252 2015-11-03 11:07 bootanimation
Finally, the device is clearly unable to execute this on startup because the boot animation is never displayed, instead a silver 'google' is displayed. I tried putting back the original cyanogen bootanimation (as well as other Nexus 6 bootanimations downloaded from xda), but alas to no success. I definitely muffed up something along the way.
I appreciate any input, thanks!