Related
Hey everyone, I just have a quick question:
I'm following the tutorial in the Hell, Android book (2nd edition) and I've followed every single step properly, but on page 39 it asks me to create a colors.xml file, which I put in res/values/, whcih is where it says it should go. For some reason it says that there are a lot of errors in it, but I did everything just as the book said. here's the code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="background">#3500ffff</color>
</resources>
it says there's a problem with the very first line, but I don't see any problems with it. If anybody could help me out, that'd be great. Thank you
EDIT: it also says it ends prematurely, so that confuses me, too. Should I just delete the file and add the background/color information in the main "strings" thing? Not the "strings.xml" tab, but the strings tab next to it.
I also found another problem. In my res/layout-land/main.xml file, it says there's no attribute for "orientation" found in package "android", but in my res/layout/main.xml file, I have androidrientation in there a couple of tiems and it's perfectly fine. Any ideas? I'm using Eclipse.
EDIT #2:
I've managed to get rid of all of the errors, so it shows the project is entirely error free, but whenever I try to run it in the Emulator, it gives me a force close, and at that stage in the book, it says I should be able to run the app fine. Any ideas?
PrestoMovie said:
it says there's a problem with the very first line, but I don't see any problems with it. If anybody could help me out, that'd be great. Thank you
Click to expand...
Click to collapse
I think there may be some "invisible" chars, especially if you copied content from WWW, pdf or such. Try to delete this file, create it again and type content by hand. Or create it using notepad and paste content to it.
PrestoMovie said:
I also found another problem. In my res/layout-land/main.xml file, it says there's no attribute for "orientation" found in package "android", but in my res/layout/main.xml file, I have androidrientation in there a couple of tiems and it's perfectly fine. Any ideas? I'm using Eclipse.
Click to expand...
Click to collapse
I guess you have omitted xmlns:android declaration.
PrestoMovie said:
I've managed to get rid of all of the errors, so it shows the project is entirely error free, but whenever I try to run it in the Emulator, it gives me a force close, and at that stage in the book, it says I should be able to run the app fine. Any ideas?
Click to expand...
Click to collapse
Run logcat and look, what was the error.
Brut.all said:
Run logcat and look, what was the error.
Click to expand...
Click to collapse
Logcat?
and I looked at the res/layout-land/main.xml and it actually still says there's an error with the first line, but after I retyped it, it says there are no errors with the project, but it still has the little red mark in the right that says there's an error. I'm really confused now.
Brut.all said:
I think there may be some "invisible" chars, especially if you copied content from WWW, pdf or such. Try to delete this file, create it again and type content by hand. Or create it using notepad and paste content to it.
I guess you have omitted xmlns:android declaration.
Click to expand...
Click to collapse
you mean the xmlns at the very top? the "<?xml version="1.0" encoding="utf-8"?>"? I have that, if that's what you mean.
P.S.
I really appreciate your help with all of this!
PrestoMovie said:
Logcat?
Click to expand...
Click to collapse
http://wiki.cyanogenmod.com/index.php/Logcat
Or just type "logcat" into Google.
PrestoMovie said:
you mean the xmlns at the very top? the "<?xml version="1.0" encoding="utf-8"?>"? I have that, if that's what you mean.
Click to expand...
Click to collapse
No, no. Look into res/layout/main.xml file, there should be 'xmlns:android="http://schemas.android.com/apk/res/android"' somewhere (probably in first tag). This is feature of XML, not Android: if you want to use "xxx:yyy" tag or attribute name in XML file, then you should first declare this 'xxx'.
Brut.all said:
http://wiki.cyanogenmod.com/index.php/Logcat
Or just type "logcat" into Google.
No, no. Look into res/layout/main.xml file, there should be 'xmlns:android="http://schemas.android.com/apk/res/android"' somewhere (probably in first tag). This is feature of XML, not Android: if you want to use "xxx:yyy" tag or attribute name in XML file, then you should first declare this 'xxx'.
Click to expand...
Click to collapse
oh, ok. I have that there in the main.xml file. its exactly as you put it there, so how would I declare it?
PrestoMovie said:
oh, ok. I have that there in the main.xml file. its exactly as you put it there, so how would I declare it?
Click to expand...
Click to collapse
Do you have it in errorous file? (res/layout-land/main.xml)
Brut.all said:
Do you have it in errorous file? (res/layout-land/main.xml)
Click to expand...
Click to collapse
yes. I've also had a ton of other errors pop up, but I'm trying to see if I can resolve those on my own, because there's quite a few.
So guys...after surfing many websites..restoring my nandroid backup for almost 10 times i finally found a safe way to edit the build.prop file.. I don't exactly know if this happens on other android smartphones but whenever you try to edit the build.prop file via any editor on your phone or in my case even via adb i get bootloops...
So i tried remounting system and then unmounting it...i tried many file editors file explorers but every time what i got was a god damn phone stuck at the galaxy s2 logo
And also i would mention that I SEARCHED OVER XDA TOO!!.....the guys had great tools developed but they did not work in my case either.
So no more talkingss.....just how to do it...its rather very simple...you just need an app called Rom Toolbox...its free as well as paid too...download as per your requirement.. AND obviously YOU NEED ROOT.
Well open it(duh) and go into the performance tab and select the build.prop editor...well i will explain you what these values stand for...i am not going to explain each and every value but the ones you would require...leave the unlisted in the comments...
ro.build.date - Change your roms build date
ro.build.description - Your phone's description
ro.build.display.id - Change the build no.(dont use it on custom roms....respect the devs)
ro.build.product - Change your model number....
ro.build.version.release - change the android version(not really actually )
ro.product.brand - Phone's company (Samsung in my case)
ro.product.device - Change the device name
ro.product.model - change the model number
ro.sf.lcd_density - Change the lcd density(dont ask me what it is...google it)\
So guys dont change the values out of range like setting lcd density to 5000...or anything else...and also if anything happens to your phone I AM NOT RESPONSIBLE....
also this is my first thread so guys bear with me....i am a new semi pro java developer i would really like to contribute....
build.prop editing = Root Explorer, long press, open in text editor...
karendar said:
build.prop editing = Root Explorer, long press, open in text editor...
Click to expand...
Click to collapse
+1
Sent from my GT-I9100 using XDA
Or build.prop editor from the market.
Never had any trouble editing the LCD Density with root explorer :/
B3311 said:
Or build.prop editor from the market.
Click to expand...
Click to collapse
I second this.
I had bootloops....
I had bootloops dont you guys read.......!! I used root explorer...and text editor too
May be its the rom thats causing problems......
rohan999 said:
I had bootloops dont you guys read.......!! I used root explorer...and text editor too
May be its the rom thats causing problems......
Click to expand...
Click to collapse
Check for ownership and permissions before restarting. They are probably messed up and are causing bootloops. Or you made a typo somewhere and cause bootloops that way. Root Explorer always works fine for me.
No bootloops here either using root explorer or rom toolbox
Sent from my GT-I9100 using Tapatalk
rohan999 said:
I had bootloops dont you guys read.......!! I used root explorer...and text editor too
May be its the rom thats causing problems......
Click to expand...
Click to collapse
Maybe it's you bro
Sent from my GT-I9100 using xda premium
Please be dont be too hard on him. And i heard someone said it needs to be edited at two places sometimes, but i didnt read the threaded comments till the end. Its lost now. I guess thats that the thread starter means. On some roms, it caused bootloops. Is there any special thing to be taken care of cuz bootloop does happen on certain roms when u edit the build.prop on certain custom roms? On stock deodexed roms, no issues for me
Sent from my GT-I9100 using xda premium
The OP is definitely onto something, because it happened to me.
Specifically, I was trying to edit the DPI setting. Out of the stock ROM, the lcd_density setting was present twice in the file (kind of strange, but oh well - normally it shouldn't cause problems). Edited from 240 to 200 without typos, I'm not allowed to do that due to my line of work , reboot, bam! boot loop.
Replaced the build.prop from backup, edited with "build.prop Editor" from Market - no problems. Really don't see what was the difference, except the duplicated key which was gone after editing with build.prop Editor (probably it does some sort of unique key checking). Oh well, not serious enough to investigate further.
VAXXi said:
The OP is definitely onto something, because it happened to me.
Specifically, I was trying to edit the DPI setting. Out of the stock ROM, the lcd_density setting was present twice in the file (kind of strange, but oh well - normally it shouldn't cause problems). Edited from 240 to 200 without typos, I'm not allowed to do that due to my line of work , reboot, bam! boot loop.
Replaced the build.prop from backup, edited with "build.prop Editor" from Market - no problems. Really don't see what was the difference, except the duplicated key which was gone after editing with build.prop Editor (probably it does some sort of unique key checking). Oh well, not serious enough to investigate further.
Click to expand...
Click to collapse
How did u replace it with ur backup? I normally restore back my nandroid. Is there a much simpler way such as putting it in an update zip or something? Mind to share?
Sent from my GT-I9100 using xda premium
kyleforge said:
Maybe it's you bro
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
bpivk said:
Check for ownership and permissions before restarting. They are probably messed up and are causing bootloops. Or you made a typo somewhere and cause bootloops that way. Root Explorer always works fine for me.
Click to expand...
Click to collapse
override182 said:
Please be dont be too hard on him. And i heard someone said it needs to be edited at two places sometimes, but i didnt read the threaded comments till the end. Its lost now. I guess thats that the thread starter means. On some roms, it caused bootloops. Is there any special thing to be taken care of cuz bootloop does happen on certain roms when u edit the build.prop on certain custom roms? On stock deodexed roms, no issues for me
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
thank you really mate....you are not like the others who just need a reason to insult.....well this is my first thread...so its noobish....but i am a programmer (java) so i will be bringing some good roms later..
override182 said:
How did u replace it with ur backup?
Click to expand...
Click to collapse
I made a copy of /system/build.prop before editing it, of course. After rebooting and getting the bootloop, it's just replacing this file from the backup copy.
I've been using build.prop editor from Nathan Campos, 0 issues so far.
VAXXi said:
I made a copy of /system/build.prop before editing it, of course. After rebooting and getting the bootloop, it's just replacing this file from the backup copy.
Click to expand...
Click to collapse
Im still not clear on this. How did u managed to replace when u cant boot the device and edit it back again to the working build.prop. Did u push back via adb or some update.zip?
Sent from my GT-I9100 using xda premium
The device boots just fine, it just doesn't complete the booting process and remains at the spinning S with blue particles. You can use ADB during that time.
VAXXi said:
The device boots just fine, it just doesn't complete the booting process and remains at the spinning S with blue particles. You can use ADB during that time.
Click to expand...
Click to collapse
Noted. Thx
Sent from my GT-I9100 using xda premium
rohan999 said:
thank you really mate....you are not like the others who just need a reason to insult.....well this is my first thread...so its noobish....but i am a programmer (java) so i will be bringing some good roms later..
Click to expand...
Click to collapse
Most of us didn't insult. Don't jump the gun. Just giving the other side of the coin. Root explorer editing works fine, as others have stated it's possibly a messed up rom giving weird permissions to build.prop. chmod 644 build.prop usually solves the issue though.
I can't speak for everyone, but I wasn't hard on you... Noobs are noobs and I'm fine with that. Most info is readily available on the forums though... Just not necessarily on this forum. XDA is bigger than the sgs2 forums and other communities have very interesting ideas and threads!
***edit*** yeah, after re-reading, noone was harsh in any way. So... yeah!
Sent from my GT-I9100
ICS Framework-res.apk does not like to be decompiled and recompiled by APK tool.
The work around is to use 2 different versions of APK tool and keep swapping files for decompile and recompile.
I have put this in a handy little batch file package to manage all this. It really is basic stuff, but hopefully for those who are not quite sure, it will ease the pain a little.
Please feel free to test it. Enjoy:
This is an updated script to modify ICS *.apk using APK tool.
I take no credit for Apk tool or the process.
I have simply automated it for Windows as there are issues with ICS framework-res modification
Pre -requisites
1. WinRar
2. Java
Click to expand...
Click to collapse
Initial setup
1. Extract the apk folder from the .zip to the root of C:\
The structure should then look like c:\apk\ACTIONS
2. Go into c:\apk\ACTIONS\Install_files
3. Double click "Setup_Install.bat"
Click to expand...
Click to collapse
Usage
Simply double click START.bat and follow the instructions
Click to expand...
Click to collapse
Limitations
Can decompile any one .apk with any name at a time. Do not put any .apk files into the "in" folder until prompted to.
Click to expand...
Click to collapse
Thanks to Rob222 for confirming the method.
Updated the OP. Now can decompile / recompile any name .apk
Simple script. Double Click start and follow prompts.
hi!
got this problem
Ficheiro não encontrado
1 ficheiro(s) copiado(s).
Error: Unable to access jarfile C:\Windows\System32\\apktool.jar
Click to expand...
Click to collapse
any hint ?
i already made the java paths .. tryed java6 and java7
but always that error
ruizit0 said:
hi!
got this problem
any hint ?
i already made the java paths .. tryed java6 and java7
but always that error
Click to expand...
Click to collapse
What command did you run when you did that?
Did you run the setup file first?
You will need to be an administrator. Are you? If so try right click on the start script > Run as administrator
Just realised I somehow had left part of the usage instructions for the old version in the post by mistake. That maybe why some of you have issues.
Nice one bro... that was surely something that many have tried.. nice work..
Sent from my GT-I9300 using Tapatalk 2
Did not work
I set up the script as per the OP but I get the error attached
Think I need this. Getting errors trying to build apks.
Sent from my GT-I9300 using xda premium
Phone_Guru said:
I set up the script as per the OP but I get the error attached
Click to expand...
Click to collapse
Please walk me through, step by step what you did from downloading to receiving this error
Sent from my GT-I9300 using Tapatalk 2
Hey I'm a total noob with apktool on win. But I have unzipped apks on my phone using root explorer swapping res files and made working theme mods...
Could you guide to a good guide to doing this stuff on windows with a GUI I'm code illiterate virtually but know what's going on
Sent from my GT-I9300 using xda premium
I was able to get the CM 10 Framework-res to decompile and recompile using this version:
http://www.mediafire.com/?clk29i70rg7n8i9
The beauty of apks is that if you're swapping oranges for oranges, you don't need to decompile. You only really need to decompile if you're changing XML files.
To swap one image for another image with the same name is easy.
1)Download winrar (or 7zip - but I use winrar).
2)Open the apk with winrar (do NOT extract)
3)Delete the images you want to change
4)Drag the replacement images back in. When the window pops up with options, change "compression" to "store"
5)Close winrar
Sent from my GT-I9300 using Tapatalk 2
rootSU said:
The beauty of apks is that if you're swapping oranges for oranges, you don't need to decompile. You only really need to decompile if you're changing XML files.
To swap one image for another image with the same name is easy.
1)Download winrar (or 7zip - but I use winrar).
2)Open the apk with winrar (do NOT extract)
3)Delete the images you want to change
4)Drag the replacement images back in. When the window pops up with options, change "compression" to "store"
5)Close winrar
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Oh... yeah cool so this automates replacing different images in the apk with the same location... I just use a vrtheme skeleton CMW.zip folder and zip it when done for flashing.
So how do you decompile the arsc archive and mess with deeper stuff?
Sent from my GT-I9300 using xda premium
thankssssssssssssssssssssss Alot
first i Run Setup_instal.bat as administrator in "C:\apk\ACTIONS\Install_Files"
after that my problem solve (i have problem like post 2 and 3)
and thats Awsome ,
graffixnyc said:
content removed
Click to expand...
Click to collapse
Kindly remove your link. This thread is about the mod I am sharing, which I scripted. It is not about other mods.
rlorange said:
Oh... yeah cool so this automates replacing different images in the apk with the same location... I just use a vrtheme skeleton CMW.zip folder and zip it when done for flashing.
So how do you decompile the arsc archive and mess with deeper stuff?
Sent from my GT-I9300 using xda premium
Click to expand...
Click to collapse
No, you don't use this at all if you're going to be changing images. This is for the deeper stuff.
rootSU said:
Please walk me through, step by step what you did from downloading to receiving this error
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
I did exactly what the OP says, extracted the files into the root of the C drive, ran the setup and clicked on the start.bat and followed instructions. I now ran the setup again and took a screenshot of what appeared because it was so fast I couldn't see it. It said access denied and 0 files copied. I then took ownership of the System32 folder and ran setup again and it said 1 file copied. I now ran the start.bat again and got the attached error.
So am I right in thinking that you can't simply merge folders/files and zip like you can with root explorer because windows is not a Linux system?
Sent from my GT-I9300 using xda premium
Phone_Guru said:
I did exactly what the OP says, extracted the files into the root of the C drive, ran the setup and clicked on the start.bat and followed instructions. I now ran the setup again and took a screenshot of what appeared because it was so fast I couldn't see it. It said access denied and 0 files copied. I then took ownership of the System32 folder and ran setup again and it said 1 file copied. I now ran the start.bat again and got the attached error.
Click to expand...
Click to collapse
can you try right clicking the start.bat and run as administrator please? You're still getting access denied messages.
rlorange said:
So am I right in thinking that you can't simply merge folders/files and zip like you can with root explorer because windows is not a Linux system?
Sent from my GT-I9300 using xda premium
Click to expand...
Click to collapse
You can swap anything like-for-like. You can put in a replacement folder, xml file or png as long as everything has the same name.
If you want to edit an existing XML, you cannot do this without decompiling as when an xml is compiled, it does not appear as plain text. Similarly if you want to add more pngs or xml files, resources changed so it has to be decompiled too.
But if its simply swapping like-for-like, you can just use winrar or 7zip as mentioned earlier.
rootSU said:
can you try right clicking the start.bat and run as administrator please? You're still getting access denied messages.
Click to expand...
Click to collapse
I tried that and still got the error messages.
I was wondering, is it possible to have it on Kindle running CM10.1 ?
The only time i've seen it on Kindle was while i was running CM7 as alt-rom. Can it be ported to CM10.1 ?
For those who dont know what i'm talking about, check out the video
Yeah, i saw that, but i cant find 'values' folder in framework-res.apk :S
I was using old version of apktools, that was the problem... Thanks btw
no luck... i cant get pass the boot animation...
something is fishy with file size as well, because after i compile it, it has ~4mb less than the original file
Jessica said:
It's because you didn't complete it yetn
a.k.a. Urahara
The truth! I'm really a girl!
Click to expand...
Click to collapse
do explain
btw. you're fast
Jessica said:
Read again.
a.k.a. Urahara
The truth! I'm really a girl!
Click to expand...
Click to collapse
I decompiled it, changed the value, compiled it and pushed it over adb. Also set 644 permission on the file. So, what didnt i do properly ?
Jessica said:
It's because you didn't complete it yet.
Once you recompile it, you open the new one and the old one with 7-zip. Then you drag the resources, classes.dex, and res folder from the new one into the original one. Then the original one will have the new changes, but won't give you a boot loop. Also, make sure the permissions are rw,r,r. You can use adb or terminal emulator for that too, using chmod 644.
Click to expand...
Click to collapse
Ok, i see now you've edited your post, sneaky
I'll try it and report back.
Edit: it works!! yay :highfive:
I have rooted my phone and installed cwm recovery with the loki images built in. I am trying to modify my build.prop file so I can hide my soft keys manually and use lmt pie, but when I'm using Root Explorer (after I've mounted it as r/w) and when I open it with a text editor from RE it says "This file is too I large..." and displays a truncate version. It also won't let me save any edits. What am I doing wrong?
in_dmand said:
I have rooted my phone and installed cwm recovery with the loki images built in. I am trying to modify my build.prop file so I can hide my soft keys manually and use lmt pie, but when I'm using Root Explorer (after I've mounted it as r/w) and when I open it with a text editor from RE it says "This file is too I large..." and displays a truncate version. It also won't let me save any edits. What am I doing wrong?
Click to expand...
Click to collapse
I can do that above with RE, very strange problem you have.
Try a build.prop editor, i used this in the link. It sets correct permissions after editing and so on. Use the pencil icon in the bottom right to edit.
https://play.google.com/store/apps/details?id=com.jrummy.apps.build.prop.editor
Hi,
Same thing for me with Root Explorer, instead I use build.prop Editor
EDIT: not fast enough :laugh:
qsec said:
I can do that above with RE, very strange problem you have.
Try a build.prop editor, i used this in the link. It sets correct permissions after editing and so on. Use the pencil icon in the bottom right to edit.
https://play.google.com/store/apps/details?id=com.jrummy.apps.build.prop.editor
Click to expand...
Click to collapse
I got it and tried exactly like you said, and while it does pull it up and my keyboard pulls up and I can feel the haptic feedback, no letters will be inserted in deleted...? Really weird.
Maybe it's related to my root access? TB is showing I'm rooted, but check out my superuser app when I try to update an install new binaries...
Get rid of Superuser and try SuperSu instead. Sometimes the old Superuser has issues on ROMs since ICS.
EniGmA1987 said:
Get rid of Superuser and try SuperSu instead. Sometimes the old Superuser has issues on ROMs since ICS.
Click to expand...
Click to collapse
Downloaded and installed... Removed the old one. Still not letting me edit... Looks an feels like it is but won't enter any characters. At least RE isn't giving me the "too large" error anymore
in_dmand said:
I got it and tried exactly like you said, and while it does pull it up and my keyboard pulls up and I can feel the haptic feedback, no letters will be inserted in deleted...? Really weird.
Click to expand...
Click to collapse
i had the same issue, couldn't figure out why. try replacing a commented line with the code to disable the nav bar
How do I know if it's just a commented line and not necessary to the program?
in_dmand said:
I have rooted my phone and installed cwm recovery with the loki images built in. I am trying to modify my build.prop file so I can hide my soft keys manually and use lmt pie, but when I'm using Root Explorer (after I've mounted it as r/w) and when I open it with a text editor from RE it says "This file is too I large..." and displays a truncate version. It also won't let me save any edits. What am I doing wrong?
Click to expand...
Click to collapse
i had the same issue any help?
If you are in stock android 4.4.2 dont do it
You will stuck on bootloop
If you still wand to do let copy your build.prop to pc and edit with notebat++ or some program and recopy overwrite to your phone
Sent from my LG-D802 using xda app-developers app
maxkanick said:
If you are in stock android 4.4.2 dont do it
You will stuck on bootloop
If you still wand to do let copy your build.prop to pc and edit with notebat++ or some program and recopy overwrite to your phone
Sent from my LG-D802 using xda app-developers app
Click to expand...
Click to collapse
You are right, I have tried to edit it on pc and stuck on a bootloop.
Use build.prop editor app from playstore
_____________________________________Read more write less and be smart