Android Tablets Forum banner
1 - 20 of 43 Posts

·
Registered
Joined
·
97 Posts
Discussion Starter · #1 ·
Title says it all really. We seem to be short of chefs so seeing as how I've got some free time I'm gonna get into this.Any hints/tips links etc would be appreciated. Been online all afternoon reading n downloading stuff.I've got cygwin and jdk set up on my pc. But the kitchen I got was for htc. Any/all help appreciated to get me started.I'll keep a blog going highlighting my steps along the way which should act as a noobs guide to cooking. I have a background in programming but i've also written many dummies style guides so hopefully it wont be too technical. RegardsRiki
 

·
Registered
Joined
·
160 Posts
Depends on what you want to do.(I describe what you have to do using Linux. Working under Windows is more complicated. You should probably use a VM.)Simple modding - for example adding and removing applications, fonts or something like that from the rom - only involves unpacking the update.img with AFPtool.exe, mounting the system.img (mount -o loop system.img folder), copy the contents so you can modify them (cp -r folder secondfolder), adding or removing apks and the needed libraries and then repackaging with "mkcramfs secondfolder system.img". Finally, use AFPTool.exe again to make the update.img.BTW, you can use AFPtool.exe with wine under Linux.If you want to modify framework files or apks, you will need to decompile them using apktool. This will give you a folder with the resources (images, sounds, xml) and the source code in smali, which is sort of java assembly code. You can recompile with apktool, too. What works somewhat good for me is this: looking in ddms for error messages or other hints, then look in which source file the problematic error message is generated and then decompile the .jar file, comparing the smali with the java code. This usually helps you understand what the code is doing. This will usually take a long time. For fixing the rotation issue back then I had to stare at smali for about 6 hours before finding the right fix (which is a one-liner).Another thing again is compiling Android from source and trying to run it on the device. You can follow the instructions at source.android.com to build a generic build and then try to run it on the device.
 

·
Registered
Joined
·
160 Posts
Depends on what you want to do.(I describe what you have to do using Linux. Working under Windows is more complicated. You should probably use a VM.)Simple modding - for example adding and removing applications, fonts or something like that from the rom - only involves unpacking the update.img with AFPtool.exe, mounting the system.img (mount -o loop system.img folder), copy the contents so you can modify them (cp -r folder secondfolder), adding or removing apks and the needed libraries and then repackaging with "mkcramfs secondfolder system.img". Finally, use AFPTool.exe again to make the update.img.BTW, you can use AFPtool.exe with wine under Linux.If you want to modify framework files or apks, you will need to decompile them using apktool. This will give you a folder with the resources (images, sounds, xml) and the source code in smali, which is sort of java assembly code. You can recompile with apktool, too. What works somewhat good for me is this: looking in ddms for error messages or other hints, then look in which source file the problematic error message is generated and then decompile the .jar file, comparing the smali with the java code. This usually helps you understand what the code is doing. This will usually take a long time. For fixing the rotation issue back then I had to stare at smali for about 6 hours before finding the right fix (which is a one-liner).Another thing again is compiling Android from source and trying to run it on the device. You can follow the instructions at source.android.com to build a generic build and then try to run it on the device.
 

·
Registered
Joined
·
160 Posts
Depends on what you want to do.(I describe what you have to do using Linux. Working under Windows is more complicated. You should probably use a VM.)Simple modding - for example adding and removing applications, fonts or something like that from the rom - only involves unpacking the update.img with AFPtool.exe, mounting the system.img (mount -o loop system.img folder), copy the contents so you can modify them (cp -r folder secondfolder), adding or removing apks and the needed libraries and then repackaging with "mkcramfs secondfolder system.img". Finally, use AFPTool.exe again to make the update.img.BTW, you can use AFPtool.exe with wine under Linux.If you want to modify framework files or apks, you will need to decompile them using apktool. This will give you a folder with the resources (images, sounds, xml) and the source code in smali, which is sort of java assembly code. You can recompile with apktool, too. What works somewhat good for me is this: looking in ddms for error messages or other hints, then look in which source file the problematic error message is generated and then decompile the .jar file, comparing the smali with the java code. This usually helps you understand what the code is doing. This will usually take a long time. For fixing the rotation issue back then I had to stare at smali for about 6 hours before finding the right fix (which is a one-liner).Another thing again is compiling Android from source and trying to run it on the device. You can follow the instructions at source.android.com to build a generic build and then try to run it on the device.
 

·
Registered
Joined
·
101 Posts
Superb information Roger. Thanks a lot.My hands have been itching to start doing some tweaking of my own. This will absolutely help me on getting my feet wet.
 

·
Premium Member
Joined
·
2,596 Posts
Roger I wish you could teach a class on doing simple firmware changes with video , I know I would watch it . Members email me all the time looking for guidance I tell them to look for a Fw developer and ask them
 

·
Registered
Joined
·
97 Posts
Discussion Starter · #7 ·
Hi Roger, cheers for the info mate. Have you used eclipse at all for any of your work?I have just done a dual boot install of Ubuntu using the Wubi installer via windows7 (so much easier than the other way).I have eclipse set up on my win7 partition and it runs easily. I cant get it to display the source code of droid though. I know there is a work around, but the only guides are for the Linux version (hence why I have installed ubuntu).I spent the best part of yesterday setting it all up and getting the droid sdk and adt working. Not had a chance to test it yet though, so I have no idea if it is setup correctly yet :)I have used eclipse for many of my forrays, although I tend to use Codeblocks as my main IDE as it is so simple to integrate into.What I would like to do is actually strip the code back and look at possible ways to get it working in whatever device I want to use it in.I would also like to get a source of the archos ROM so that I can see just how they have implementd the dsp. IF we could see how they have done things we might be able to copy it into any new ROMs (especially those that are based on 2.x).
 

·
Registered
Joined
·
16 Posts
To get the AFP Tool just go to this linkhttp://code.google.com/p/apad-irobot/downloads/listAt the top of the web page next to search be sure to change it to "All Downloads" and then click SearchOn the results you get there, click on "Rockchip SDK Update Flash and Package Tool Chinese"On the next page click on the link to download the zip fileUnzip the file when it is downloaded. The AFPTool will be in the MydroidDevTool_v1.0rockdev directoryThe AFPTool is a Windows executable and can be run with no command line parameters for options.Even though the description for the link says its the chinese version the command line help is in English
 

·
Registered
Joined
·
5 Posts
Hi mikekelly666, thank you for your AFPTool.after i download, now i can get a few img files include system.img.But How can i access system.img ? i'm windows's user who looking for use Android & quite new for Android.i'v no idea to access img file....... Can u guide me?
 

·
Registered
Joined
·
16 Posts
[quote name='tommylee;23998]Hi mikekelly666' date=' thank you for your AFPTool.after i download, now i can get a few img files include system.img.But How can i access system.img ? i'm windows's user who looking for use Android & quite new for Android.i'v no idea to access img file....... Can u guide me?[/QUOTE'] I can do that for you. Its not that easy because the tool to unpack and pack the system.img file is a Linux based tool. I'll give you the quick and easy steps to set it up. If you have any questions let me know. FYI, I have only tried this in WIndows XP. Your mileage may vary with Vista and 71.) Go to http://cygwin.com/ and download the setup program. After you download and start it, just accept the defaults it presents. This will install a Linux based shell in Windows so you can unpack and pack the system.img file.For the rest of these instructions I'll assume that it was installed in C:Cygwin. If you installed it in a different directory then subsitute that path for C:Cygwin.2.) Add the path C:Cygwin to your PATH environmental variable3.) Go to this link http://www.motorolafans.com/forums/...9-cramfs-file-firmware-possible-mount-pc.html Sorry for the long link. Scroll down to the post by prabhubng. You will see a link for cramfs-1.1-1.tar.bz2. Download it and save it.4.) If you have WinRAR installed, use it to open the file you downloaded. Within the archive go to usrbin directory and you will see two files. Extract those two files to the C:cygwin directory. If you don't have WinRAR then I could put those two files into a ordinary zip file if need be.Now your ready to start unpacking the system image.1.) On the desktop you should see a icon for Cygwin Bash Shell. Start it and you will be dumped into the Linux version of the DOS prompt. This is where it gets tricky. You will see a $ and a blinking cursor. Type the command MOUNT and press enterYou will see how Cygwin mounted your drives into a Linux based filesystem. I will not go into great detail on how it works, but the main thing to worry about is that you need to use / instead of for your path seperator. For my example I will assume that the images that the AFPTool extracted are in C:Images. You will notice from the output of the MOUNT command that C: is /cygdrive/c so the path to your images will be /cygdrive/c/images So all I had to do to figure out the path in Linux to my images from the path that Windows used is to subsitute c: with /cygdrive/c Ok moving on2.) Type in CD /cygwin/c/images to get to the directory where the system.img is located3.) Type in the command cramfsck -x ./system system.ing Make sure you have the period before /system4.) If there was no error messages then system.img has been unpacked to the system subdirectory. You can now use your Windows tools to play around with the files in the system image. I would leave the Cygwin shell up because your going to need it to pack the system.img when you get done playing with the files in it.5.) When your done changing the files around in the system. Go back to your Cygwin shell and execute this command: mkcramfs ./system system.img6.) You will get a error about GIDs. Don't worry about it. Now you are ready to use AFPTool to pack the update.img with your modified system.img and flash it to the APad.KEEP A BACKUP COPY OF A UNMODIFIED update.img HANDY. It is very possible that you can and will screw up the system image. You know you have a screwed up system image when after flashing the Apad it keeps booting into recovery mode. If you have a unmodified update.img handy you can reflash and try again.I hope the directions are as clear as mud
It will get easier with practice to play around with the system image in Windows. If you have any questions let me know, and I'll try my best to answer them
 

·
Registered
Joined
·
38 Posts
Hi mikekelly666,Thanks for the info.I've got cygwin installed on win7 and have downloaded AFPToolThis may sound foolish, but I'm unable to unpack the update.imgI tried unpacking update.img of rb_hybrid_fw_for_apad_5.1.img as well as update.img of Apad_iRobot_Update_0706-CNhowever, i get an error while unpacking.Can't open/create file: extracted/Image/system.imgDoes the AFPTool.exe need to be used under the cygwin prompt?
 

·
Registered
Joined
·
16 Posts
The AFPTool is a Windows Program. So there is no need to run it under Cygwin.You may have a problem with access rights. Right click the shortcut for the Command Prompt and select "Run as Adminstrator" and follow the prompts to get a elevated Command Prompt (i.e Full Access Rights)The same thing will probably apply when you use Cygwin and cramfsck to unpack the system.img. Right click on the shortcut for the Cygwin Bash Shell and select "Run as Adminstrator"If you still have problems with the AFPTool using the elevated command prompt then let me know and I'll see what happens on my end when I try it with Windows 7.
 

·
Registered
Joined
·
1 Posts
YasinSiddiqui I am using Win 7 also and I do not have to run as AdministratorIt looks like afptool is not able to find the location to save the filesI get the same error when trying to save to a folder inside of another folder Try to save directly to the rb51 folder this is what I do and I have not had any trouble i.e. afptool -unpack rb51update.img rb51
 

·
Registered
Joined
·
16 Posts
[quote name='tommylee;24962]Hi mikekelly666' date=' i'v try your solution. It's WORK !now i can add THAI font my APAD already. it's make me happy since i buy APAD... ;)Thank you very much for your kind.[/QUOTE'] Your welcome
 
1 - 20 of 43 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top