yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] Ateisti:
Not as such, but technically it should be possible with some additional coding. I however don't have the time to undertake such a task.

This might be a ROM version thingy. On my system there are actually two XML files with that same setting, but only one of them works (the one I mentioned in my original post). Just search all your framework-res xml files for "config_disableMenuKeyInLockScreen", and change every instance to true. Should do the trick.

Or if all else fails, just edit the file LockScreen.smali, method "shouldEnableMenuKey()", and make it always return 0 ("return v4" -> "return v6").

That is unfortunately the case. The music controls (as well as the puzzle pieces) are coded into the GlassLock class, so it would required some additional reverse engineering to implement those in the stock keyguard.
[Galaxy S I9000 Android Development] kjusiel:
4 hours working and it works (jm2).

I'm going to test on the jpc.

EDIT:

I put it on the jpc and it doesn't work.
[Galaxy S I9000 Android Development] Etzolin:
Did not work with JPC :( I really want to use the stock lockscreen!
[Galaxy S I9000 Android Development] billytcf:
hi guy thanks for your instruction. However I'm using samset's 1.9f which has the ROM deodexed and i found no .odex files but .jar files. Is there a way to workaround this? I'd really love to revert back to stock eclair lockscreen~!
[Galaxy S I9000 Android Development] iZz0s:
same here :( no odex files...
[Galaxy S I9000 Android Development] Etzolin:
Because it is "deodexed" ;)
[Galaxy S I9000 Android Development] iZz0s:
I know ...

But we need an Workaround otherwise i have to reflash
[Galaxy S I9000 Android Development] Tayutama:
Upload the android.policy,jar file you got and ill make it for you
[Galaxy S I9000 Android Development] iZz0s:
Thanks for that Tayatuma but i have already flashed the JM8 Firmware and wanna do this now :)

P.S: You said you works already at your JM8 ROM - When can we get this ROM? :D I NEED IT ;)
[Galaxy S I9000 Android Development] Tayutama:
Building the full themed rom atm and then i need to test it before making the other versions
[Galaxy S I9000 Android Development] jeanveupas:
anyone have the jar and odex file for official JM1 ? thx :D
[Galaxy S I9000 Android Development] ikenley:
Can anyone package an update.zip to change the Glass Lockscreen to Eclair Lockscreen. It would be really handy for the not tech savvy, like myself.
[Galaxy S I9000 Android Development] Mr_Chupon:
Hi,

Im stuck at using dexopt-wrapper. I get this message when I try your command:

Usage:dont use this.

I've verify that I was in the framework folder also.

Do you think you can help me out?

Thanks
[Galaxy S I9000 Android Development] kjusiel:
On jm2 when you press menu button you don't have to slide on the screen. a bug?
[Galaxy S I9000 Android Development] billytcf:
Hello Tayutama, here is the jar I got.

Mm, I am using JM5 + samset's 1.9f

If possible would you teach me how to do this? It'd really kind of you but on the other hand I'd wanna learn to do it myself so won't need bother you ;)
[Galaxy S I9000 Android Development] Tayutama:
Here you go :)

Also it's pretty easy to do if you are on a deodexed ROM.

1. Use adb to pull out /system/framework/android.policy.jar

2. Type the following command: java -jar baksmali.jar -x android.policy.jar -o android.policy

3. Open LockPatternKeyguardView.smali and find the method getLockScreenMode()Lcom/android/internal/policy/impl/LockPatternKeyguardView$LockScreenMode;

4. Replace the contents of this method with the attached file getLockScreenMode.txt.

5. Save LockPatternKeyguardView.smali.

6. Use the following command to compile the changes back: java -jar smali.jar android.policy -o classes.dex

7. Copy the newly made file classes.dex into android.policy.jar

8. Push the file to /sdcard

10. On your phone, do:

$ su

# cd /sdcard

# cp android.policy.jar /system/framework/android.policy.jar

# sync

Should work then

If you want to disable the menu key then do this while you still are working on the .smali files:

1. Open LockScreen.smali and find the .method shouldEnableMenuKey()

2. Change "return v4" so it reads "return v6"

3. Save file
[Galaxy S I9000 Android Development] Ateisti:
It seems you are trying to run dexopt instead of dexopt-wrapper (they are different programs). Check the download link for dexopt-wrapper in the original post.

No, read my original post again.

As for deodexed ROMs, the modding procedure just becomes a bit simpler, as pointed out by Tayutama.
[Galaxy S I9000 Android Development] jodue:
thank you very much. i wanted to replace the lockscreen for some time now but all the app aren't doing a very good job. this however worked perfectly :D
[Galaxy S I9000 Android Development] billytcf:
I tried finding the getLockScreenMode in LockPatternKeyguardView$LockScreenMode.smali, no wonder I can't find it.

Thanks very much
[Galaxy S I9000 Android Development] billytcf:
worked like charm, thank you very much!
[Galaxy S I9000 Android Development] Mr_Chupon:
Hi,

Im still stuck at the dexopt-wrapper step. It seems that I do not have the dexopt program install on my SGS. Because it says :

---would reduce privs here

execl</bin/dexopt> failed: No such file or diectory

Im using a GT-I9000M with

PDA:I9000UGJH2

PHONE: I9000UGHJH2

CSC:I9000BMCJH2

Is it possible that my ROM does't have dexopt, or am I missing something here?

Would you mind posting the dexopt program also? (I have been trying to find it on google and on these forums, but everyone seems to have it already installed)
[Galaxy S I9000 Android Development] GXFX:
Hey guys !

trying it here on JM7 and when i try to enter this :

java -jar baksmali.jar -x android.policy.jar -o android.policy

it says : Unable to access jarfile baskismali.jar :confused:

somebody help me please ?
[Galaxy S I9000 Android Development] seraphine:
I get the following error:

/system/framework # dexopt-wrapper android.policy.jar patched.odex /system/frame
work/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/
framework/android.policy.jar:/system/framework/services.jar
dexopt-wrapper android.policy.jar patched.odex /system/frame
work/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/

framework/android.policy.jar:/system/framework/services.jar
--- BEGIN 'android.policy.jar' (bootstrap=0) ---
--- would reduce privs here
--- waiting for verify+opt, pid=2248
--- END 'android.policy.jar' --- status=0xff00, process failed
/system/framework #

Any idea what I'm doing wrong?
[Galaxy S I9000 Android Development] seraphine:
Oh no I killed the thread. :(
[Galaxy S I9000 Android Development] l7777:
Better than killing your phone like me. :) A quick flash to stock and all was better. I messed up the signature, instead of copying 0x34 - 0x47, I copied 0x34 - 0x37. All I got after that was the AT&T splash screen. :( I was looking for an excuse to start over with SRE 1.3 though.

While I can't say what's wrong, I would start working backward and downloading/generating new copies of everything and see if that makes a difference. Everything worked for me on a samsung captivate except my oversight in the signature copying.
[Galaxy S I9000 Android Development] Ateisti:
Hmm, that's weird. I'm not sure if the binary differs between ROMs, but I've attached the one from JM2 if you want to try it. It was in /system/bin/.

baksmali.jar needs to be in the same folder you're running the command from.

It's difficult to say just from this. Make sure you don't have any extra spaces in the command line. The correct syntax is:

dexopt-wrapper <jar-file> <outputfile> <bootclasspath>

I guess it's also possible for the bootclasspath to be different on your device. You can find the right one in /init.rc by typing:

cat /init.rc | grep BOOTCLASSPATH
[Galaxy S I9000 Android Development] skiddhard:
Hey there guys.

Major noob here. ;)

I would really appreciate if someone could give an easier walk through for the procedure. For eg, I haven't been able to push through step 3. :eek:

For me, its pretty cryptic. I found the file needed and also have the content that is to be used to replace the original. But I am still stumped on how to copy the content over to the original.

Please people. Noob I am, but don't want to loose on a better lockscreen.

Cheers....

EDIT: See what I a jackass I have been?? All I had to do was open the damn file in silly little NOTEPAD...... :)

Now that I have it, I suspect, I have to replace the part all the way till ".end method"..... Right??
[Galaxy S I9000 Android Development] skiddhard:
Ok. Now I am all the way down to step 8. Do I have to put the "dexopt-wrapper" file downloaded into the same "/system/framework" folder??

On second thoughts, I am going to wait till someone figures out an easier way of doing this. Ideally an "apk" would be perfect, but under the circumstances, even a tutorial (noob ready... ;)) would do.

Until then then......

Cheers to the OP nonetheless..... :)
[Galaxy S I9000 Android Development] amwbt:
I did a step wrong when doing this and I am trying to fix it. What is the command to rename a file in adb shell?
[Galaxy S I9000 Android Development] EarlZ:
Another vote for making this automated for 2.1 and 2.2 =D
[Galaxy S I9000 Android Development] skiddhard:
See if this here helps.....

http://xdaforums.com/showthread.php?t=517874

Or this....

http://xdaforums.com/showthread.php?t=502010

Or....

http://xdaforums.com/showthread.php?t=532719

:D

Cheers....
[Galaxy S I9000 Android Development] seraphine:
Use the move command:

mv a b

That will rename a to b.
[Galaxy S I9000 Android Development] seraphine:
BTW I seemed to have missed a step or something. Re-ran it all from scratch and it works fine now.

Thanks a LOT man! Love the default lock screen!
[Galaxy S I9000 Android Development] thE_29:
I wanted to make a bat/sh script, but your usage guide is JUST CRAP...

ad 1) you need also core.odex, ext.odex and framework.odex

That was not hard to find out, but is it so hard to write it?

ad 2) Ok, that was easy (maybe a link where to download smali/baksmali)

ad 3-5) I want to use sed, but didnt made it yet (should be easy)

ad 6) worked also

ad 7) HOW do i put the classes.dex back into it? Just with jar? And in which directory or just in root?!

ad 8) I DONT HAVE "dexopt-wrapper". I just have dexopt on the mobile. Is it the same? Do i have to run this in the framework directory or can i execute it also in a tmp directory (so i dont have to overwrite the android.policy.jar)

If you can answer me this questions, i could make a bat/sh for standard 2.1 firmwares...
[Galaxy S I9000 Android Development] fduraibi:
Thanks a lot

It works on my Vibrant :)

However, trying dd from my device returned an error message about conv disabled, not sure if that will change anything but I did the dd again from my linux box just to be sure.

(And i think i have the latest busybox installed [v1.18.0.git])

dd if=android.policy.odex of=patched.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
conv option disabled
[Galaxy S I9000 Android Development] huxflux2003:
Can this work with 2.2 (JPH)?
[Galaxy S I9000 Android Development] Project1.exe:
wow learned and discovered a lot from doing this lol. i'm stock lockin :P thanks Ateisti
[Galaxy S I9000 Android Development] zaduma:
One Click Tool For Samsung Galaxy S Vibrant Users

If you have another Galaxy S device and are brave go ahead and try it.

If you have another Galaxy S device and are not quite as brave and not brave enough to follow these instructions PM me if you can help me get some files off your phones.
[Galaxy S I9000 Android Development] LadFromWales85:
Got my hopes up then! Deodexed here sadly :( JPH...
[Galaxy S I9000 Android Development] furstrated:
does this affect in anyway the dropdown music control in lockscreen?

i need the music control in lockscreen but i wanna do this

thanks
[Galaxy S I9000 Android Development] lfielder:
Running into a similar issue as someone above. I am on the captivate running JF6. Here is the error I am getting:

# dexopt-wrapper android.policy.jar patched.odex /system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
--- BEGIN 'android.policy.jar' (bootstrap=0) ---
--- would reduce privs here
--- waiting for verify+opt, pid=3005
--- END 'android.policy.jar' --- status=0xff00, process failed
#

I think this is a problem with the step 7 regarding "add the newly created classes.dex to it" I was simply using the mv command to move classes.dex into android.policy.jar. It appeared to work as I couldn't see the classes.dex file after the move. For step 7 am I supposed to be using some form of -jar to get it to work? Everything else seems pretty straight forward, but getting hung at this point.

- I followed the previous suggestion for getting the correct output for step 8 and confirmed it is the same.
[Galaxy S I9000 Android Development] Ateisti:
If you have so much trouble following the tutorial and can't figure those things out for yourself, I suggest you leave the scripting to someone more experienced in these matters. As I mentioned in my original post, the tutorial was not meant for total beginners.

Yes, you can't use mv to add a file to jar archive. You need to either use a graphical archiving utility (e.g. Winrar) or jar (the command line tool). The first alternative is probably easier in this case.
[Galaxy S I9000 Android Development] Project1.exe:
I'm trying to get this to work on froyo, but my question would perhaps be how did you know that the signature bytes on android.policy.jar is located at 0x34? or is it something that's fixed?

edit:

w00t :) JPH on AOSP lock! yeah

thanks again Ateisti
[Galaxy S I9000 Android Development] fduraibi:
I have two questions about your method:

1- Is there a way to change the lock screen and make the slider on the right set the phone on vibrate mode instead of silent?

2- Regarding the signing step, can I do the same thing with any odexed file? If I got a program from another SGS variant and want to sign it to work on mine can I do the same steps here? and will the signature offset and length be the same? if not how can I find the right offset and length for a certain package?

Thanks again for and awesome and easy to follow instructions.
[Galaxy S I9000 Android Development] cntwoods:
my phone is htc magic, in the file LockPatternKeyguardView.smali,i can't find the method getLockScreenMode().
[Galaxy S I9000 Android Development] Ateisti:
The signature location and length should always be the same, so you can modify other framework files as well. For example, I've also edited services.odex to get rid of that friggin' annoying notification tone when the battery has been fully charged.

Yes, should be possible. I can look into this.

Eh, you do realize you're in a Galaxy S thread, right? :)

If the HTC Magic also has a custom lock screen, I doubt the instructions here can be directly applied to it.
[Galaxy S I9000 Android Development] Rawat:
I too would love to see this.
[Galaxy S I9000 Android Development] GantengX:
I'm stuck at step 7.. I'm using ryanza one click lagfix and when trying to do adb push to /system/framework I got permission denied error..

I even tried to copy the files to sdcard and tried to move the file using adb shell but I got cross device link error... :(
[Galaxy S I9000 Android Development] thE_29:
I am no beginner, but dexopt-wrapper was hard to find..

And that i dont like, that the one-click method is using an "exe", i will try to make a script.. (At least i have finaly all i need)

Ok, patching the smali file is done (need more then 1 cmd..).

But what do you mean here:

Pull /system/framework/android.policy.jar, add the newly created classes.dex to it, and push it back to the device.

Just in root folder of the jar, via jar -uvf or where/what?
[Galaxy S I9000 Android Development] joserobleda:
If i want to put anything into /system adb says the partiton is full... Im using the voodoo lagfix.. what can i do?
[Galaxy S I9000 Android Development] thE_29:
What do you want?

adb push FOO /system/bla/FOO?

That will never work.. You have to push it into sdcard and then move it to the dir you want..
[Galaxy S I9000 Android Development] joserobleda:
While waiting for the answer i already try that, but i get a message saying theres no free space available on /system partition..
[Galaxy S I9000 Android Development] thE_29:
Ok, i made a little bat script which makes everything for you :)

All you need is java (with java and jar binary) and adb.exe.

You need to set the paths in the batch file in the top!

I tested it with my Galaxy S and JM5 (Eclair 2.1) and i have now the standard lockscreen (but i use widgetlocker).

http://rapidshare.com/files/420586328/install_lockscreen.zip

On any error, please post it here.

If you guys like it, i can write an Linux/Mac OS version of the bat file (for the windows version i put sed + needed dlls in the zip file - i tested it on Win7 Prof x64).

If Ateisti can provider more infos, how to change the code to anything, maybe we can invoke any lockscreen directly and get rid off the glass one ;)

BE SURE YOUR MOBILE IS NOT IN STANDBY!! IT WILL ASK YOU SEVERAL TIMES FOR ROOT-PERMISSIONS! ON STANDBY SCREEN YOU DONT ANY GET POPUP == PERMISSION DENIED ERROR!!!!!
[Galaxy S I9000 Android Development] joserobleda:
Now, the problem is i cat make my phone wake up :)

The /system/framework/android.policy.jar is corrupted and i cant use muy backup widthout root... (i am on recovery mode)

http://xdaforums.com/showthread.php?p=8266205#post8266205
[Galaxy S I9000 Android Development] thE_29:
The only possibility to repair this "failure" is to create an update.zip and put there your original jar file!

But i dont know exactly how it works..

Maybe i figure it out and will make an update.zip autocreation when running my script..

I found this:

http://www.londatiga.net/it/how-to-create-android-update-zip-package/

and this:

http://blog.coralic.nl/2010/01/25/how-to-create-update-zip-using-your-build-aka-system-img/

And for the error: did you use my script or did you made the "bug" by yourself? ;)
[Galaxy S I9000 Android Development] joserobleda:
Ok, thanks, but i think im going to reflash... and use your script, it should work on JM8?

Have you install voodoo lagfix?
[Galaxy S I9000 Android Development] thE_29:
I dont have the voodoo lagfix, i just have the ext2 lagfix from ryanzu (or sth like that).

Its one of the lagfix, which doesnt use the sd-card..

And i have to create an update.zip in my script, because if the sed (is for patching the .smali) doesnt work right, you cannot boot up (like you) and then you need an update.zip...

Well either i make today sth or i will take a look on update.zip creation tomorrow!

Give me a feedback if the script worked for you or not ;)
[Galaxy S I9000 Android Development] joserobleda:
I can make it works well. My phone cant boot again... i dont kwon what is wrong...
[Galaxy S I9000 Android Development] thE_29:
Can you upload or send me the smali file from jm8! So i can test if the sed is working correctly..

And i would try the lockscreen patch before lagfix or installing apps.. So you dont waste time on error ;)
[Galaxy S I9000 Android Development] GantengX:
I finally did it :D I look at the batch file content instead of just running it from there. I didn't execute the commands in recovery mode though, because I can't become a root if it's in recovery mode...

Anyway it works now :D
[Galaxy S I9000 Android Development] thE_29:
Great to hear that...

Which version do you have on your mobilephone? And do you have any lagfix in use?

Edit: And why did you want to try this in recovery mode? Just in normal mode, but not in standby (because otherwhise super user will not ask for root privilegs).
[Galaxy S I9000 Android Development] raiderep:
Just wanted to give thanks where thanks was due. I ported this over to my Epic quite easily! The jar file was de-odexed so it was very simple and worked right away. I am going to add this to a theme I am working on and will link back here for credit ;)
[Galaxy S I9000 Android Development] Electroz:
Worked perfectly on Bell's UGJH2. Thanks a lot man! This deserves it's own thread, rather than being tucked away in someone else's......
[Galaxy S I9000 Android Development] GXFX:
Hey ,

the fascinant lockscreen was ported !

here

can somebody port it to jm8 please ?

thank you .
[Galaxy S I9000 Android Development] NiXXeD:
Attempting to do this for the new JI6 Froyo build on the Captivate and getting some weird issues. Once the process is complete and rebooted, it appears that I have no lock screen, and it gets into a soft reboot loop.

Any suggestions?
[Galaxy S I9000 Android Development] b4l.kaido:
tried using the batch file but i don't seemed to get asked to allow root permissions by superuser at any point. seems to screw up at step 6 and 7. any clue as to what may be causing this problem? =\
[Galaxy S I9000 Android Development] Khoral:
Thank you so much :D

It works on a french Galaxy S phone (firmware : JM2) \o/

I love this lockscreen, much better than the GlassLock :D
[Galaxy S I9000 Android Development] Ladduro:
Hello,

Many thanks for this, it works like a charm. Unfortunately I am unable to disable menu key from unlocking. I dont have a bools.xml and also my LockScreen.smali looks like this:

.method private shouldEnableMenuKey()Z
.registers 8

.prologue
const/4 v6, 0x0

.line 164
invoke-virtual {p0}, Lcom/android/internal/policy/impl/LockScreen;->getResources()Landroid/content/res/Resources;

move-result-object v3

.line 165
.local v3, res:Landroid/content/res/Resources;
const v4, 0x10d0007

invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getBoolean(I)Z

move-result v0

.line 166
.local v0, configDisabled:Z
const-string v4, "ro.monkey"

invoke-static {v4, v6}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z

move-result v2

.line 167
.local v2, isMonkey:Z
new-instance v4, Ljava/io/File;

const-string v5, "/data/local/enable_menu_key"

invoke-direct {v4, v5}, Ljava/io/File;-><init>(Ljava/lang/String;)V

invoke-virtual {v4}, Ljava/io/File;->exists()Z

move-result v1

.line 168
.local v1, fileOverride:Z
if-eqz v0, :cond_23

if-nez v2, :cond_23

if-eqz v1, :cond_25

:cond_23
const/4 v4, 0x1

:goto_24
return v4

:cond_25
move v4, v6

goto :goto_24
.end method

It is not clear to me how to make it always return 0 ("return v4" -> "return v6")

Can you help please ?

Regards
[Galaxy S I9000 Android Development] g0c:
http://xdaforums.com/showthread.php?t=784992
[Galaxy S I9000 Android Development] Ladduro:
I am using untouched JM1 FW. I dont think those apply to me.
[Galaxy S I9000 Android Development] Ladduro:
BUMP - please, any suggestion ?
[Galaxy S I9000 Android Development] Phone_Guru:
If you don't want to mess around with the files on your phone you can use a program called lockbot pro. It allows you to choose between different lock screen including vanilla eclair, vanillan froyo, iphone(if you like that sort of thing), x10 and others. You can even use more than one in rotation.
[Galaxy S I9000 Android Development] juzz86:
This is a fantastic alternative, I've got the default Eclair lock screen working fine, even using my own wallpaper. The paid version is not necessary unless you want more fancy alternatives (Froyo, X10 etc). Good find Guru!
[Galaxy S I9000 Android Development] Galaxas:
How to ???
[Galaxy S I9000 Android Development] Galaxas:
Please

Please, port this for JM5
[Galaxy S I9000 Android Development] jjwa:
You open the .zip with for example 7zip. Then replace the classes.dex in there, with yours.
[Galaxy S I9000 Android Development] Galaxas:
jjwa, thanks

But when I push it back to the device with command > adb push android.policy.jar /system/framework this report permission denied:confused:

Who can lift out of this headache ?
[Galaxy S I9000 Android Development] taha_e:
can anybody explain how to do step 2? how to use smali and baksmali? it should be run on phone or pc? and to be run by adb or ..? sorry for asking such question im a begginer
[Galaxy S I9000 Android Development] Lyncexx:
this method don't work with ROM version I9000XFJP7