yashsingh1/xdaforums huggingface dataset:
[XPERIA X10 Android Development] MrHassell:
updates

Latest! - zdzihu has released a new version which is for Beta 4 variants specifically - http://www.mediafire.com/?5rr5ygl1udldla1

This fix should not be applied on Trip's MIUI ROM until further notice!

Thanks to My_Immortal & kmilof for pointing out that there is an issue with TripNRavER MIUI :)

Unsure why there was a problem with TripNMui, I will investigate. The permission groups are different and am investigating.

1: Replaces a critical system file with correct system permissions.

How to tell if this exists or if you need this update? It's very easy :) Using a file explorer (i.e; Root Explorer) also others work, browse to the directory; /system/bin/ <- look for the file charger as @cobrato pointed out, it should be identical.

14356 = Binary file size

-rwsr-xr-x = Unix file permission

The permissions are the important part and during the night it was posed, this could be handled with the following command - busybox chmod u+s - while this is true, it is context sensitive. For example if this command is issued in the context of root, the setuid is included and created for root. This file belongs to a special group which can't be modified. If anything it should reset permissions on a file which exists and enable correct permissions on the charger and enable it to work again.

It appears to have been too late for one x10 last night. I received another P.M of death by USB and the problem is real and has claimed many devices, although I am having a hard time pinpointing what caused it, I'm unable to say that much other than this is potentially a cure if even partial as pointed out by picking up on a modification from DooMLoRD, to optimize offline charging.

To prevent your x10 from battery death after modification, never allow the battery to run below 5% - replacing battery might be the only hope if this happens!
[XPERIA X10 Android Development] gregbradley:
Thanks for your effort in explaining what this zip does.

Not entirely sure what it all means but I understand it to mean everyone on any 2.2 CUSTOM ROM should flash this. I will do so and report back any issues.

PS. I have never had a WLOD FC yet.

BB58 wolfbreak latest update and tweaks test zip. Stock kernal

EDIT: Flashed onto WB ROM...no issues so far.
[XPERIA X10 Android Development] colossus:
@mrHassell

my question is, do we need to flash this everytime we flash a new rom or is it something that just needs to be done once?

I have said before, but thanks again for your tirelress work, you too give a great deal to our x10 forum, thanks for your hardwork my friend.;)
[XPERIA X10 Android Development] jimbo77:
Well if the new Custom Roms that will be developed from now onwards include it you won't need to flash it every time but lets said that you'll be flashing FreeX10Beta4 or WB CM 6 ROMS you'll have to do it every time since those ROMS doesn't include it for now and every time you flash a new ROM it overwrites the existing /system/bin folder...

Jim
[XPERIA X10 Android Development] calvenyow:
not so sure what is the uses.
[XPERIA X10 Android Development] kmilof:
i flashed this in TripNMiUI FINAL 1.0.63.. after bootanimation screen's turn black, cant do anything =/.
[XPERIA X10 Android Development] iridaki:
I flashed it over Trip's 1.0.2 and everything went fine. Phone booted normally.

I haven't 100% understood what it does, but it certainly did not do me any damage.

Did you make a nandroid before flashing?
[XPERIA X10 Android Development] kmilof:
yup, i did make a nandroid before flashing, i could restore it and the everything went back to normal. :P

maybe something changed between trip 1.0.2 and 1.0.63 :P
[XPERIA X10 Android Development] Neo.:
Thank you for this one
[XPERIA X10 Android Development] kozxmartt:
I flashed this over reindeiro's scramble ROM without any issues. Thanks for this.
[XPERIA X10 Android Development] chiefy009:
Not entiley sure what this is for but still flashed into beta 4 all ok. Thanks

sent from my Z orignal and modded 2.2 powered c64
[XPERIA X10 Android Development] GlossGhost:
Me, too..

Can somebody explain?

Anyways, installed succesfully on Trip's MIUI 0.0.98. (The IRIS one.)
[XPERIA X10 Android Development] fiscidtox:
A few people saying their phones have been bricked (thinking they were, you can't brick an x10) and getting either a wlod, or three blinking red led flashes, because their battery level got so low and they were unable to offline charge it.

This fixes it and makes sure that cannot happen.

That is what it is for...
[XPERIA X10 Android Development] GlossGhost:
I was thinking to be this, I mean not to let the phone to go in soo low battery level. :cool:
[XPERIA X10 Android Development] BULL3TPR00F:
thats weird, i always drain my battery to completely dead (3 red flashes) when im trying to recalibrate the battery and never ran into this issue. I have however had issues with low battery causing multiple WLOD reboots over and over.

Is this recommended to use for 2.3.3 as well? I will try n flash it now on J's CM7 017 STOCK.
[XPERIA X10 Android Development] chiefy009:
I see thanks for explaining.

sent from my Z orignal and modded 2.2 powered c64
[XPERIA X10 Android Development] BULL3TPR00F:
flashed fine on Js CM7 017
[XPERIA X10 Android Development] kmilof:
dunno what's happening, i flashed again in trip 1.0.63, and again black screen after the boot screen. any idea? :E
[XPERIA X10 Android Development] 9Lukas5:
is it also installed if i include it in a own package who only removes the existing charger in system/bin and then copys the new one or do i have to install the zip you uploaded that it would be installed right?
[XPERIA X10 Android Development] a.monteiro:
simply flash file with xrecovery right?

I do the same and never ran into this issue as well, however, he states there's a "potential damage" in doing so, good to know someone figured this out before something bad happened to my device. :)
[XPERIA X10 Android Development] gregbradley:
Wolfbreak now includes this in his latest v006 (Uploaded just an hour ago) and redeiro2005 provides a link to it for his ROMS.
[XPERIA X10 Android Development] cobrato:
Sorry for my ignorance, but I compare the extracted charger file to z's beta4 charger file and they are binary identical.

So does it mean there are some hidden changes and we have to use your method of copy charger to /system/bin folder?
[XPERIA X10 Android Development] MrHassell:
p == preserve permissions

The important part is making sure the permissions remain in tact. For example you could do the following with adb shell or terminal.

cd /data/local/tmp

tar -pxvzf charger.tar.gz /system/bin/

p == preserve permissions

x == extract archive

c == create archive

v == verbose (print names while making tar)

z == gzip

f == tar file name
[XPERIA X10 Android Development] MrHassell:
single patch

:) Hi my friend, very happy to hear from you! Hope this is part of a solution to a one off patch. Should only need to be applied once, if you flash again it wouldn't make any harm, it's simply ensuring the special permissions are present and the file is the correct file so as when it is loaded into memory, the /sys/class - either AC or USB are going to be able to reach it and direct their pass through correctly.

Linker files are loaded into memory and governed by GROUP permissions. In Linux this is what the SWAP file system is for as it is a special place to load off the file system and make it immediately available to any calling classes or code that requires it.

Android uses Unix groups and permissions but some special tools were omitted, to enhance security? The GROUP is defined at build time, so special permissions are assigned in code, while firmware is compiled and linked so classes can access the functionality, when executing in native memory.

You wouldn't want to wait when you plug in your charger for a menu to ask you if you want to connect your phone or charge it, this is why it needs to be directly addressable by system and available in memory. If it wasn't present and charge is being sent to the battery, the phone circuit board could become damaged at worst (over loaded with charge), certainly the battery receives a load, system does not know about and battery stats, they would not exist in any way the system is aware of.

This is the problem with setuid and "Sticky" files, especially "ELF" or linker files, is they are created in the context of SYSTEM, PUBLIC etc... is that in order to be in this group, you would need to have an account within that group or be a member of SYSTEM or PUBLIC.

charger - is loaded and reserved in memory, it need's to be as a linker, it has to have pass through associations for the USB and AC class to handle LED and POWER states.

If this file is not with the exact permissions (even though assuming it exists, let's say someone did a chmod 06755 to it..) this would not have really damaged the file, theoretically it should still be part of the SYSTEM group and should still work, if however the permissions were lost and then reassigned, it is no longer part of the special group - hence it does not have the correct security group access and if it is loaded to memory at all, it will not be able to be reached by the calling AC and USB classes.

Hope to see 'concept' more than file itself, taken to consideration and applied with modifications for the X10 :) I love some of the work done with firmware and rom's here, if for anything this is just a tiny patch to help knock this charger bug off the issue list!
[XPERIA X10 Android Development] bleached45:
Just wondering, after I flash the zip are my permissions supposed to look like this on charger?

Because I have flashed twice on Z's Beta 4 and my permissions are

-wxrw--wt...
[XPERIA X10 Android Development] MrHassell:
Found is not copying into location correctly and am putting up - charger_fix_v2 - which should resolve.

other solution would be to;

cp /system/bin/charger /data/local/tmp

cp /data/local/tmp/charger.tar.gz /

tar -pxvzf /charger.tar.gz /system/bin

Execute via adb shell or with a terminal, this will backup your current charger to /data/local/tmp - in case you need it again - copy the tar.gz file with the updated charger to the root directory and then unpack to /system/bin - uploading the fix to front of thread now.

This happens when working late and tired - apologies to all.
[XPERIA X10 Android Development] kmilof:
my file charger has the following permissions

rwxr-xr-x

the size is the same

it's okey<?

:D

thanks
[XPERIA X10 Android Development] bleached45:
Is it just me or is V2 not working either?

Using FreeXperia Recovery I can't be too sure but it seems like the update is failing. I tried downloading from phone and from my laptop... The message flashes really quick so I can't be sure, but I believe it's saying update failed.

And my permissions are still the same.

I tried extracting it manually with a terminal emulator and it says

"tar: system/bin: not found in archive" (roughly, typed that from memory) then the led flashes and the phone reboots...

I don't know much about command line so I can't troubleshoot, but are you sure the code is correct (or is it just me, because that is a possibility as well)? I tried extracting the .zip and running the .sh in it myself... still nothing... I can't get it to work at all.
[XPERIA X10 Android Development] MrHassell:
EDIT: The above is wrong! I contacted kmilof to notify him that I made a mistake wit my assessment of his permissions and ironically, this is the entire point of this thread :D - we are people and we make mistakes and this is something we all must remember, the importance of our connections, and watching out for one another! ;)

Thank you very much to Byrana for pointing this out and the most excellent pick up!

14356 = Binary size

-rwsr-xr-x = Unix permission

The - s - means STICKY or SetUID and this is the important part! I missed this is an oversight in my response and this is not right. It must have the S part or it probably isn't working and your phone is potentially at risk!

Make a nandroid (xRecovery) back before hand as a measure it can't hurt, also if you are unsure copy the original file to your sdcard, just in case.

If you do not have the file, it's a smaller file size (or 0kb..) and the permissions (most importantly) are different - you need this - v3 is most recent.
[XPERIA X10 Android Development] MrHassell:
confussed

I'm without an X10 to modify right now and anyone to help isn't available.. What is happening is using "Tar" (Unix tape archive) and Gunzip (compression) to preserve permissions of that special system group.

If you have the file and it matches the permissions / size, then you don't need it;

1: copy charger.tar.gz to root of X10

2: tar -pxvzf /charger.tar.gz /system/bin

If you have Root Explorer and a terminal, is all you need. I would test more if I had an X10 but it is not in my hands, hence am unable to test it right now but it should be work and I'm surprised that it isn't..
[XPERIA X10 Android Development] bleached45:
Yeah, it just doesn't want to work for me on FreeX10 B4. I have root explorer and a terminal so I'm surprised it's not too.

Every time I try to execute that command in a terminal (after su right?) it says something like

"tar: /system/bin/: not found in archive" (then the phone reboots and permissions don't change).

It almost sounds like it's looking for /system/bin in the tar?

But like I said, I don't know much about Linux or command line.

I even tried moving charger.tar.gz to /system/bin, changing directories to /system/bin, and then typing

tar -pxvzf charger.tar.gz (I'm assuming that this would extract it to the current directory but it's just a shot in the dark for me)

I don't get the "tar: /system/bin/: not found in archive" error.. but the phone still reboots and the permissions don't change.

Anyways, thanks for trying to help, I appreciate it. I'll keep messing around with it, but I'm not holding my breath about getting it working on my own.
[XPERIA X10 Android Development] DooMLoRD:
@MrHassell

i think i got wht the problem is...

the charger.tar.gz is trying to extract charger in system/bin/ (which is relative to current path) so... here is a possible solution...

cp /data/local/tmp/charger.tar.gz /.
cd /
tar -pxvzf charger.tar.gz
ls -l /system/bin/charg*

i will try n create a corrected update.zip in the evening when i am back home....

EDIT:

modify the extract_charger.sh in the update.zip as follows:

#!/sbin/sh

cp /data/local/tmp/charger.tar.gz /.
cd /
tar -pxvzf charger.tar.gz >> /data/local/tmp/extract_charger_status.txt 2>> /data/local/tmp/extract_charger_status.txt
rm /charger.tar.gz

this should work...

it will also create a "log" file @ /data/local/tmp/extract_charger_status.txt so u can check if the command was executed at all and if any error was encountered (stderr will also be dumped to extract_charger_status.txt) [Thank you anantshri for this 2>> tip ;) ]
[XPERIA X10 Android Development] iridaki:
I did it manually and it worked!

Thank you! :)
[XPERIA X10 Android Development] bleached45:
I got it to work thanks to this as well.

I already had the charger.tar.gz on the root of the phone so I just changed the .sh to

#!/sbin/sh
cd /
tar -pxvzf /charger.tar.gz

And it worked!

Thank you both MrHassell and DooMLoRD for your help!
[XPERIA X10 Android Development] iridaki:
I have something rather odd to report here.

I am on Trip's MIUI (Froyo) 1.0.2 with lots of fixes from Cobrato.

I never had a single WLOD.

After applying the charger fix, I got 2 WLOD using the phone (not heavily, just writing an SMS the first time and scrolling through the Launcher the second) while charging via USB on my PC.

It happened a few hours after applying the fix, and I made sure that the charger has the right permissions and size.

It's not a big deal, I removed the battery and everything was back to normal,

just saying that maybe there's more to it...
[XPERIA X10 Android Development] MrHassell:
Sorry guy's for bad timing, had something which meant I've been unable to test or do anything and taken me offline for too many hours!

TripNRaveR rom's require some more investigation, so I'm loading and will look into why this is happening and will contact Trip to see what the diff''s are that he may be aware of. Thank you very much for bringing this up!

Loading and testing on TripNMuI... will report back and hope to catch Doom and see what has happened in the past 24 hours - back from awol :)
[XPERIA X10 Android Development] bleached45:
Glad to hear you're back. Thanks for all the hard work.

Sorry I wasn't more help with testing this. :(

Good luck getting everything sorted out with the .zip and Trips Roms.
[XPERIA X10 Android Development] iridaki:
Glad to see you are back!

Now, I am afraid I have some more bad news.

Today, while my phone was on USB, it rebooted

and since then it's been stuck in bootloop.

So, I think for the time being, you should add to the OP that

this fix should not be applied on Trip's MIUI ROM until further notice!
[XPERIA X10 Android Development] Adolf1994:
in the newest root explorer one can change a file's special permissions, and when I checked the charger file, the UID and sticky things weren't checked.

doesn't this fix sets those permissions?
[XPERIA X10 Android Development] Neo.:
Is it safe to apply this fix for WB or CM 7 (Baseband: 54).??

Thanks!
[XPERIA X10 Android Development] MrHassell:
I'm going to have to test each individual ROM to find out the correct answer to this question, which is why I posted into the DEV section, for the developers of their ROM's to look into this and if required use to include in updates for releases or patches to ROM's.

It's not designed for end users... but if you know what you're looking for and are certain you need this, here it is essentially.

Currently looking into FreeXperia and Trip rom's and reporting back.
[XPERIA X10 Android Development] MrHassell:
Yes it is supposed to do exactly that. Can you tell which firmware or rom you are using please, post back as much info - i.e; WolfBreak v5 or Froyo Beta4, which base band does not matter :) thanks!
[XPERIA X10 Android Development] xtbk9999:
Applied this on Achotjan's 2.2.1 rom which is based on FreeXperia I believe..

been running it for almost 2 days now so far so good, baseband .58
[XPERIA X10 Android Development] Adolf1994:
Eternity 2 build 003a by SEMPITERNAL and am using Z's very first custom kernel

it has xRecovery 0.2

I took a look at that -p switch for tar in the busybox

for

xRecovery, but it's missing:eek:

and I can't check the one

in

xRecovery, because its linked to somewhere, maybe to the one

for

xRecovery:confused:
[XPERIA X10 Android Development] iridaki:
Thank you very much for you work MrHassel!

As I've said I am on Trip's MIUI Froyo, if you want me to try anything to help you, pm me! :)
[XPERIA X10 Android Development] Adolf1994:
why don't you use this code:

#!/sbin/sh
cd /
tar -xvzf /charger.tar.gz
chmod 5755 /system/bin/charger
[XPERIA X10 Android Development] Wolfbreak:
Its already included in my latest ROM :)
[XPERIA X10 Android Development] Wolfbreak:
Sry for double Post i didnt saw it. MrHassell you have a PM
[XPERIA X10 Android Development] MrHassell:
This is fantastic am very happy to see this is working! Out of interest there is another version that I noticed also release by zdzihu - http://www.mediafire.com/?5rr5ygl1udldla1

Can you confirm that this is working correctly in your latest firmware?
[XPERIA X10 Android Development] MrHassell:
Because you don't want to change the mode or permissions ;)
[XPERIA X10 Android Development] Adolf1994:
just curious, but does that -p switch exist in the busybox binaries we have?

I looked at the 1.17.1 and it misses that as well... don't mention the one for xRecovery *cough* 1.15.3 *cough*
[XPERIA X10 Android Development] DooMLoRD:
@glen

xRecovery-charge-offline.zip is a very old release (1st Feb 2011)...

the link to file u posted above (zdzihu) has same md5 hash as the one released before...
[XPERIA X10 Android Development] DooMLoRD:
"-p switch exist" ??? wht is it exactly?
[XPERIA X10 Android Development] Adolf1994:
the -p switch tries to recreate the original permissions
[XPERIA X10 Android Development] DooMLoRD:
u mean:

cp -p <infile> <outfile>

??
[XPERIA X10 Android Development] Adolf1994:
@Doomlord

kinda, but this can't preserve the permissions/special bits/owner and group saved in a tar pack

can someone compile a tar binary, that actually contains that -p switch? because none of the zips provided here sets those "important" permissions
[XPERIA X10 Android Development] chiefy009:
Gone back beta 4, will flash this again I think
[Nexus One Q&A, Help & Troubleshooting] sandydemandy:
*Im coming from an Inspire and An Atrix and there are SO fewer options for those phones.

*I have searched both Google and XDA but I still have no idea whats best for my phone.

I have a stock N1 running 2.3.3 build GRI40

I have gotten as far as unlocking the bootloader. Now I need to know whats the best way to get what I want out of this phone.

My requests are simple, I want a rom/mod? that will enable different color trackball notifications thats fast and stable and will also install root. If I need to root first than please advise which is the cleanest way. I have read about a super one click available for the N1, but am a bit apprehensive as that method made a mess of my Atrix (busybox issues)

I'm just looking for some kind advice and a push (preferably a nudge :o) in the right direction here. Im a fast learner, just slow to get going ;)

Thanks in advance to anyone willing to help. :)
[Nexus One Q&A, Help & Troubleshooting] Hollow.Droid:
As youve already unlocked your bootloader and are looking for a new rom then you dont need to root your current one. Simply boot to the bootloader, flash your recovery of choice, reboot into it and flash your rom of choice. You'll find plenty of guides/info in the dev forum or nexus one wiki.

As for the rom, I've tried the majority of roms out there but have ended up coming back to cm7. It has trackball alert/wake and inbuilt support for trackball notifications (And the Trackball alert app from the market). I did remove several apps using titanium backup but its still an excellent rom. It also has a great community following, receives regular updates (There are even nightlies for flash addicts) and has numerous add ons/themes for cm7 exclusively.

However you may be best at trying a few roms and seeing how they feel as every users needs differ. Should you end up going with cm7 make sure to go to Settings - Cyanogenmod settings, that's where all the fun is ;)
[Nexus One Q&A, Help & Troubleshooting] ricky9237:
I think unlocking the bootloader does not necessarily mean you get the root access right away, Right? Please correct me if I am wrong. In case you need to root your stock gingerbread, you can try gingerbreak v1.2. It is easy to use and works for me.

In my experience, cm7.0.2.1 is still the most functional mod for n1 so far. Regarding the trackball notification, I like the Light flow with stock gingerbread better because it allows me to use different colors even with different gmail accounts.
[Nexus One Q&A, Help & Troubleshooting] sandydemandy:
thank you both!!

regarding light flow, I installed it on the phone as is right now (bootloader unlocked) 2.3.3 and the notifications dont work. Is light flow functional only after root?

Again, thank you SO much, I really appreciate all the help! You guys are geniuses here! :)

Also, which recovery is best? I used clockwork mod on my other phones, but didnt know if that was optimal for the N1

Thank you!!!! :)
[Nexus One Q&A, Help & Troubleshooting] ricky9237:
According to the light flow app, it should work in non-rooted stock (although my stock gingerbread has been rooted). Have you changed the accessibility setting?

I will recommend to use either RA 2.2.1 or clockwork 2.5.1.4 for recovery. I have tried clockwork 3.0.0.5 before. It messed up my SD card.
[Nexus One Q&A, Help & Troubleshooting] RogerPodacter:
The best option for color track ball is installing cyanogen 7. It has full color track ball built right into the main phone settings menu. Stable, most options of all choices out there, and easiest.