[APP][NST/G] Alternate Power Menu - Nook Touch Themes and Apps

6-22-23: Update to 1.2
--removed dependency on Screenshot Easy app (you can uninstall it)
--added small binary file, fb2png, to replace broken native screenshot binary
This app enables an alternate shutdown menu dialog which includes some typical items in an "extended" power menu: Power Off, Reboot, and Screenshot (see screenshots below). Functional in both Portrait and Landscape orientation.
Requirements
--Root
--fb2png binary
--As this is a Tasker-generated app (but does not require Tasker to run!) there is a dependency on two library files
1. Copy the two files found in the attached zip into the locations shown below:
/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar
Set permissions for both files to rw-r--r-- and reboot. Without these files resident, the app will not install.
2. Copy fb2png to /data/local. Permissions should be rwx-rx-rx.
3. Create the folders /sdcard/Pictures/Screenshots (if not already existing).
4. Install the Power Menu app.
---------------------------------
How to use
The alternate menu can be invoked either by tapping on the app icon or by assigning the app to a hardware button using Nook Touch ModManager (I use a long-press of the "n" button).
"Power Off" invokes the stock power-off dialog and requires root so expect a Superuser request on first run.
"Reboot" invokes a dialog similar in appearance to the stock power-off dialog and, if confirmed, executes a full reboot, starting from the "Read Forever" screen. This is executed via a shell command and also requires root.
"Screenshot" uses the fb2png to create an image file (in .png format) from the contents of the frame buffer. When a screenshot is taken, there is a brief pause, then a brief "flash" of a smaller image of the screen (see image attached), followed by a notification.
Ideally this might replace the hardware-button shutdown but Android zealously protects that one button from being hijacked. There is an app which appears able to do the trick, but it only runs on Jellybean or higher
Bug reports/comments are welcome.

Ideally this might replace the hardware-button shutdown but Android zealously protects that one button from being hijacked. There is an app which appears able to do the trick, but it only runs on Jellybean or higher
Click to expand...
Click to collapse
didn't someone already hijack it by adding the 'reboot' and 'recovery' buttons to this button ... can't your app too be assigned like that app ?

aiamuzz said:
didn't someone already hijack it by adding the 'reboot' and 'recovery' buttons to this button ... can't your app too be assigned like that app ?
Click to expand...
Click to collapse
I looked at the mod which requires altering jars and apks. I could not decipher the patches (on older FW, to boot) and the OP did not list them, so it's a no-go for me.

nmyshkin said:
I looked at the mod which requires altering jars and apks. I could not decipher the patches (on older FW, to boot) and the OP did not list them, so it's a no-go for me.
Click to expand...
Click to collapse
Oh ok ... could @Renate be of any help ... in helping you decipher it ?

I've never seen the patch.

Renate said:
I've never seen the patch.
Click to expand...
Click to collapse
Nor have it. All the patching is done on framework.jar but there's no documentation so you would have to do a diff and tease out the patches.
That's the "good" news. As for modifications, I would not know where to start. As you are well aware, I am no Java programmer nor at my age do I aspire to that exalted skill. This little app I cooked up (in this thread) suits my needs.

hmmmmmm ... tech talk ... i seldom understand beyond a point ...
I like the fact your @nmyshkin power button does not have 'Recovery' option given you brought it to my attention on the detriments of accidentally invoking booting into 'Recovery' ... if one has installed CWM recovery on to the device then there is no harm on accidentally ending up choosing recovery, in fact its a convenient option, BUT for people who choose to leave the stock recovery as is ... the accidental booting in to recovery will prove to be catastrophic for the fact that it resets the device to factory without any warning.
If only i knew who the author was of that app that was able to patch the device so the power button could trigger the power down menu ... would've been nice to know and attempt a modification of your app so as to bind it directly to the power button. Until then we can surely manage with your current implementation.
thanks for your invaluable contributions @nmyshkin ... to this small NST/G community.

Related

g1 button remap for global search?

With the latest release of cyanogens update I started using the global search which I really love but unfortunately htc didn't give us a search button like the mytouch 3g has, I also find that I don't use the camera button at all so is it possible to remap the camera button to function as a quick launch for the global search like we can remap the end key?
I was wondering the same thing.
I have been looking at the filesystem & the /system/usr folder contains the folders "keylayout" and "keychars".
Inside the keylayout folder are several .kl (presumably .kl stands for key layout) files. If you edit them you should be able to change what ANY key on the device does, in theory anyway.
The qwerty.kl & trout-keypad.kl files appear to be the same unless I am missing something. They seem to be the layout files for normal US Dream devices. There is also trout-qwertz.kl which seems to be for the French QWERTZ key layout. I don't know how the trout-keypad-v2.kl & the trout-keypad-v3.kl are different from the traditional trout-keypad files, however you can look at that yourself.
I am looking at the trout-keypad.kl file for my ADP1 and am kinda struggling with a few of the keys. Obviously all I believe you have to do is change the line:
"key 212 CAMERA" to "key 212 SEARCH"
The SEARCH label is typically mapped to key 127.
However, I am at a loss as to what key 211 could possibly be, it is labeled as FOCUS, could it be when you press the camera key halfway down to focus in the camera app & key 212 be fully pressed?
I will do a little exploring & I will post back with my test results when I push the file to /system/usr/keylayout on my device later. Since they are just files I don't believe that you need to resign an update that contains them, you should be able to just push them to the device.
If it works I will upload the modded file here.
EDIT 1: You should also be able to add the tag WAKE in the next column over (where the other WAKE or WAKE_DROPPED tags are) if you want that key to wake the device.
Yeah I saw those files but can't do anything with them atm since I'm out and about but I assumed that they pertained to the slideout keyboard only so Ill look at them when I'm home.
They appear to be for ALL keys on the device, there are also some for BT headsets.
I updated all of the files with the camera & focus keys mapped to search, however it accomplished nothing. It still launches camera. I am running the JACxROM, but I am gunna try it with my old CM 3.6.8.1 build (which I preferred over JACxROM anyway). I'll post back later.
Geniusdog254 said:
They appear to be for ALL keys on the device, there are also some for BT headsets.
I updated all of the files with the camera & focus keys mapped to search, however it accomplished nothing. It still launches camera. I am running the JACxROM, but I am gunna try it with my old CM 3.6.8.1 build (which I preferred over JACxROM anyway). I'll post back later.
Click to expand...
Click to collapse
I was wondering if u edited the zip file then flashed it. Maybe that might help. I was thinking of doing something like this for myself but wasnt sure where to start
All I did as of yet was change the files, push them, and reboot. I am in the process of making an update and flashing it. Also, it didn't work with the first method on the CM build. The update I am signing will be based on the CM build.
One thing I also don't understand, is the *.kcm.bin files in the keychars folder. When I open them in a hex editor I cant understand them, are they encrypted, do they need unpacked, am I just an idiot??
EDIT: I'm an idiot. Just pushing the files doesn't work. For whatever the odd reason, it seems you have to package them in an update.zip file & sign them. It works great now. You can either push the button halfway down (FOCUS) and it will pop up, or push it all the way down (CAMERA) and it will pop up.
I can't upload the whole CM update (don't have the bandwith) but I will try to make an update.zip that contains just the new files (kinda like a theme update.zip file) and upload it.
Ok. I can't figure out how to make a plain update.zip with the files needed.
I put them in an update.zip file containing two directory trees:
META-INF/com/google/android/ which contains update-script (my custom one for this)
and
system/usr/ which contains all of the .kl files that needed modified.
My update-script file is as follows:
copy_dir PACKAGE:system SYSTEM:
What am I doing wrong? Whenever I try to flash the update I get an error that says "Syntax error in update script". I'm using the same convention used in theme update-script files. What should I do?
PS: The update is being signed, I'm not that stupid
Geniusdog254 said:
Ok. I can't figure out how to make a plain update.zip with the files needed.
I put them in an update.zip file containing two directory trees:
META-INF/com/google/android/ which contains update-script (my custom one for this)
and
system/usr/ which contains all of the .kl files that needed modified.
My update-script file is as follows:
copy_dir PACKAGE:system SYSTEM:
What am I doing wrong? Whenever I try to flash the update I get an error that says "Syntax error in update script". I'm using the same convention used in theme update-script files. What should I do?
PS: The update is being signed, I'm not that stupid
Click to expand...
Click to collapse
Cool I can't wait for this. If all goes well I can remove the search widget to free up space and memory. U should drop this by cyanogen so he can include it in the next update. I'm sure this would go great with the global search once the bugs r worked out of it.
Well since I can't figure out the stand-alone update.zip here are the plain files so that you can just add them to /system/usr in your update.zip of choice and re-sign it. I have PMd Cyanogen about this and will see what he says.
Glad I could help guys!
EDIT: Words of caution. I am not responsible if you screw up with this. Also, if you just press the camera button it will bring up the search box, but if you hold the camera button it brings up Voice SEARCH (not voice dial)
EDIT 2: I've added two new versions. The "keyboard_mod_cam-norm_focus-search.zip" file makes it so if you press camera completely down then it still opens camera, but if you just press it halfway down (to focus mode) it brings up search. Holding it at halfway still brings up voice search *see edit three*.
The "keyboard_mod_cam-search_focus-norm.zip" file makes it the opposite. Pressing all the way down opens search, pressing halfway down still focuses if you are in the camera app. Holding it all the way down still brings up voice search *see edit three*.
And of course the original file stays the same. Either position brings up search and holding still brings up voice search *see edit three* from any position.
EDIT 3: OK, it seems that voice search is only activated on a long press on CM 3.6.8.1! If you are using the latest (CM 3.9.11.2) it does NOT activate voice search anymore.
Can't you just use the original update and replace what you need in there?
Ok whoa you work fast but thanks for it! Hopefully cyanogen considers adding a setting for it, thanks so much!
thelamacmdr said:
Can't you just use the original update and replace what you need in there?
Ok whoa you work fast but thanks for it! Hopefully cyanogen considers adding a setting for it, thanks so much!
Click to expand...
Click to collapse
Yea thats exactly what I had to do to make it work, just replace the files in the original update and re-sign it then flash it. You can use any of the versions I posted to replace the files and it will work for you too.
And no problem. I haven't gotten a reply from Cyan yet but I did PM him.
Thanks for the compliment btw lol.
Ha ha well great job! Can't wait to get home and flash with this in it =D.
worked great thanx! i used ADB File Explorer v0.3 by makethetick makes pushing and pulling apk's a brezze no need to remember commands! if anyone would like to try it head over here, its the the op a few headers down
http://forum.xda-developers.com/showthread.php?t=532719
Hmm. It worked for you by pushing? I couldnt make it work that way, I had to flash a custom update that I put the files in. Did you do anything extra? Change permissions? Did you reboot? Check if it still works after a reboot, because mine didnt.
its still working after at least 4 reboots. did u pull out the stock files b4 u pushed it? in the abd file explorer i deleted the stock then just pushed from there. as of now this is my 5th reboot (once i find a setting i like i get update my nandroid). if u need to drop my a line faster than the forum check my signature for my gmail
Using the JacHero 2.1 which has camera key remapped to search. Don't seem to be able to reassign to camera - what's the keycode for the G1's camera button? Thought it was 211 (focus) 212 (take piccy).
Oh I should probably say hi - first post lol. I'm a bit n00bish but I have successfully reflashed this G1 5 or 6 times with different roms and haven't asked loads of questions without reading instructions - but can't figure this camera issue out. Cheers
Sorry about this post! All info was supplied earlier in thread! Mustve been a long day at work that day!

[Q] VolUp + Home + Power doesn't work? And backing up framework-res.apk

Brand new phone, unlocked and unbranded. Came on the 'new' JM1. I've rooted it using the One Click Root.
Firstly, I am now trying to install the update.zip for the battery circle mod but for some reason the VolUp + Home + Power combo doesn't work. I press it all together then let go once the first boot screen pops up. What have I done wrong?
Secondly, I am also trying to backup my framework-res.apk. I understand this is in /system/framework/framework-res.apk, but my 'My Files' application can't seem to access this, even with hidden files shown. What am I missing?
Thanks.
Hello, you seem to be missing alot, and to be totally honest if i was you i would research ALOT more before attempting this mod, im dubious about this to say the least because of the many variants.
1. the combo will work, your just letting go too early, hold them all down until your in the Recovery Mode. I read somewhere, when the SGS logo pops up to release the power button for a split second and then hold it again. Dont know if theres any method in this but whereas before i had a few fails i get in everytime now.
2. even though you have rooted your device, 'My Files' has its root set to /sdcard/ so you wont be able to see the root using this app anyway. download Root Explorer from the market.
Again you must read more into what your doing before installing a random update that you dont know what it contains, if i was you id make it myself using your own framework-res.
To do this you can use APK Manager to decompile the package, then copy the original graphics and xml into the correct drawable folders, recompile it, open in winrar and copy the META folder, then you should be good
Alternately for backing up your framework-res you can open CMD and type
adb pull /system/framework/framework-res.apk
a yea you need the android SDK installed for the above ^
hope this helped
sensi_ said:
1. the combo will work
Click to expand...
Click to collapse
not necessarily
http://forum.xda-developers.com/showthread.php?t=754673
i only said this because im 90% sure that he is doing it wrong
he is letting go when the galaxy s logo appears, this isnt long enough
sensi_ said:
I read somewhere, when the SGS logo pops up to release the power button for a split second and then hold it again. Dont know if theres any method in this but whereas before i had a few fails i get in everytime now.
Click to expand...
Click to collapse
This worked, thanks!
The update.zip I was installing was only for the battery circle mod and nothing else.
Thanks a lot for your advice too, I usually ask a lot of questions on IRC if I'm unsure about what I'm doing.

[MOD/HOW-TO] Remove hard key vibes via android.policy.jar

I thought I'd offer my solution to disabling the hard key vibrations on the Atrix since other people might find this useful. This method differs from the other solutions in that it doesn't tamper with your Silent Mode vibrations (like StreakVibrations does) and it's code based, so it shouldn't tamper with any themes you have installed (like the framework-res.apk method). It is firmware dependent though since it's a code modification.
You'll need an android.policy.jar modified for your firmware.
What I'm doing is I'm modifying the method called performHapticFeedbackLw, and telling it to skip triggering the vibrate pattern for all effects (there are 5) except for keyboard taps. Long press vibe, virtual key vibe, safe mode disabled vibe, and safe mode enabled vibe will no longer trigger... Incidentally, does anyone know what safe mode on this phone refers to?
To use the file, you need to be on Bell, Telstra, GingerBlur, Gladiatrix or stock ATT 1.8.3 firmware, and be deodexed. Can you copy the file to your phone without being deodexed? I don't know. I'm a programmer, but an Android newbie so just to be safe it's best if you're deodexed.
Before you try anything, obviously make sure you are backed up. At least copy your existing android.policy.jar so that you can restore it if necessary.
All you need to do is either:
a) Run the novibes.bat script packaged in the zip. There are a couple prerequisites:
1. Make sure to set your USB connection to "None" on your phone.
2. On your phone, go to Settings > Applications > Development and make sure USB debugging is turned on.
3. Plug your phone into your PC and let it install any necessary drivers.
4. Then you can run novibes.bat.
or
b) Follow the steps outlined below to do it manually:
1. Replace /system/framework/android.policy.jar with the one that I've attached.
2. Make sure the permissions of the file are set to rw-r--r-- (thanks for reminding me, Meloy and for correcting, natboy!). The easiest way is to use Root Explorer, long press the file, choose permissions, and set owner: read/write, group:read, others:read. Otherwise, use Terminal and type "chmod 644 /system/framework/android.policy.jar" without the quotations.
3. Reboot.
For those not on stock Bell, I'd be willing to modify your android.policy.jar and post it here if you provide somewhere for me to download it, and specify what firmware it comes from. It's quite quick to do once you're set up so I don't mind. Alternatively, make the change yourself:
1. Download baksmali and smali (both .jars and scripts, total 4 files).
2. Copy /system/framework/ from your phone to your computer.
3. Copy all the files from step 1 to the framework directory from step 2 on your computer.
4. Unzip android.policy.jar and copy its classes.dex file to the framework directory on your computer.
5. From the command line, navigate to the framework directory and run "./baksmali classes.dex". It will create a directory named "out".
6. Open "out/com/android/internal/policy/impl/PhoneWindowManager.smali" in a text editor.
7. Search for a method called "performHapticFeedbackLw". Go to near the bottom of that method, and you will see the Dalvik bytecode representation of a switch statement:
Code:
.sparse-switch
0x0 -> :sswitch_27 #This is for long press vibe
0x1 -> :sswitch_35 #This is for virtual key vibe
0x3 -> :sswitch_38 #This is for keyboard tap vibe
0x2710 -> :sswitch_3b #This is for safemode disabled vibe
0x2711 -> :sswitch_3e #This is for safemode enabled vibe
.end sparse-switch
8. Here's an example of how you might want it to change. Basically you want to replace the original goto labels with one that causes the method to step out without triggering a vibe, and that notifies the calling method there was no vibe by returning false. The label to use is called ":cond_1d":
Code:
.sparse-switch
0x0 -> :cond_1d #This is for long press vibe
0x1 -> :cond_1d #This is for virtual key vibe
0x3 -> :sswitch_38 #This is for keyboard tap vibe
0x2710 -> :cond_1d #This is for safemode disabled vibe
0x2711 -> :cond_1d #This is for safemode enabled vibe
.end sparse-switch
9. From the command line in the framework directory, run "./smali -o classes.dex out". You now have a new classes.dex that has your modification.
10. Zip up the classes.dex with the META-INF directory from your original android.policy.jar. Rename the zip to android.policy.jar.
11. Copy the new file to your phone and reboot.
12. At this point you should be done.
Will this be possible on the AT&T atrix? I currently use the streak vibe method but I'd like this much better.
Sent from my MB860 using XDA App
n1ckr0th said:
Will this be possible on the AT&T atrix? I currently use the streak vibe method but I'd like this much better.
Sent from my MB860 using XDA App
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1079873&page=3
Check out that thread over in general. The info for how to edit framework.res is there, but there is a flashable .zip that will disable the vibrations in either stock/rooted 1.83 or Gingerblur 3.5 for you.
bearsfan172 said:
http://forum.xda-developers.com/showthread.php?t=1079873&page=3
Check out that thread over in general. The info for how to edit framework.res is there, but there is a flashable .zip that will disable the vibrations in either stock/rooted 1.83 or Gingerblur 3.5 for you.
Click to expand...
Click to collapse
thank you, but i wonder if this specific method is possible on the atrix as to retain themes and such.
interesting that its in general, development may be a better home for it.
n1ckr0th said:
thank you, but i wonder if this specific method is possible on the atrix as to retain themes and such.
interesting that its in general, development may be a better home for it.
Click to expand...
Click to collapse
Yes, this would work perfectly fine on ATT. You can either follow the instructions I provided, or if you like you can post /system/framework/android.policy.jar from your phone somewhere and pm me the link so I can download it and I'll do it for you. Also mention what firmware you're on. I just don't want to download hundreds of MB of firmwares which is why I didn't set one up for all the ATT firmwares.
That other method requires editing a file that is guaranteed to change with any theme you install. That means anytime you change themes you'll need to edit that .apk yourself, or wait for someone to bring the change over. android.policy.jar is unlikely to change for themes.
Ok, I've posted a version for ATT 1.8.3 that was given to me by n1ckr0th.
n1ckr0th, let me know whether it works fine or not. There should be no problem, it looked just like the other 2 versions I modified.
Incidentally, he's using GingerBlur 3.5 so anyone on stock be careful (ie. copy your original file to somewhere else on your phone). It shouldn't matter at all because from what I see, there aren't any resources to modify in android.policy.jar so GingerBlur's should be the same as stock. At any rate, it won't brick your phone if you put the wrong one on. I put Telstra's on my phone by accident and it just messed up the the graphics on screen (maybe because the addresses were all wrong for my phone). You can still use adb, or sshdroid to copy and replace with your original android.policy.jar.
please delete
meloy said:
Don't use this on AT&T 1.83!
After the replace and reboot my phone was really laggy and some applications doesn't start anymore (camera, contacs for example). After i have replaced it with the original file i have still the same problem.
My phone config:
- SBF 1.83
- rooted (GingerBreak 1.20)
- sideloading enabled (GladEnabler)
- GladiAtrix 3 b0.2 ROM
- LauncherPRO
- GingerBread Theme only
Click to expand...
Click to collapse
What? That can't be right, if you still have the same problem after copying the original file, that means that you must have done something wrong. It's a single file change, provided you returned the file to the original, it will be back to the way it was. How did you copy the file? And also, are you deodexed? As mentioned in the original post, you have to be deodexed, because I don't know the results of using it on a non-deodexed system. Your posted config makes it sound like you might not be.
Sorry, my mistake. It is deodexed, I have just forgot to set the permissions to rw-r-r, you should maybe mention this in your start post. It's all working fine now. Thanks for the good work.
By the way, your mod (android.policy.att_1.8.3.zip) has added an "reboot" function to my phone, it is working well too.
meloy said:
Sorry, my mistake. It is deodexed, I have just forgot to set the permissions to rw-r-r, you should maybe mention this in your start post. It's all working fine now. Thanks for the good work.
By the way, your mod (android.policy.att_1.8.3.zip) has added an "reboot" function to my phone, it is working well too.
Click to expand...
Click to collapse
Haha, that's good. Had me scared for a moment, I didn't want to break anyone's phone!
Thanks for the tip, I'll mention that in the original post. Oh, and what do you mean by the reboot function...? Where did you access that? I certainly didn't add it, so it might be a mod added to GingerBlur?
maledyris said:
Oh, and what do you mean by the reboot function...? Where did you access that? I certainly didn't add it, so it might be a mod added to GingerBlur?
Click to expand...
Click to collapse
When i go to the phone options i have now these selection:
- Silent Mode
- Airplane Mode
- Power off
- Reboot
Yes, i think it is a GingerBlur mod. But it doesn't bother me, it is a good feature.
meloy said:
When i go to the phone options i have now these selection:
- Silent Mode
- Airplane Mode
- Power off
- Reboot
Yes, i think it is a GingerBlur mod. But it doesn't bother me, it is a good feature.
Click to expand...
Click to collapse
Interesting, that never occurred to me. I usually go into terminal and type in reboot to reboot my phone. I think I'll add that to my phone too...
maledyris said:
Haha, that's good. Had me scared for a moment, I didn't want to break anyone's phone!
Thanks for the tip, I'll mention that in the original post. Oh, and what do you mean by the reboot function...? Where did you access that? I certainly didn't add it, so it might be a mod added to GingerBlur?
Click to expand...
Click to collapse
the reboot function is cooked into GingerBlur. for some reason my phone wouldnt boot after i replaced the file? i used root explorer and set the permissions to whats specified.
n1ckr0th said:
the reboot function is cooked into GingerBlur. for some reason my phone wouldnt boot after i replaced the file? i used root explorer and set the permissions to whats specified.
Click to expand...
Click to collapse
Hmm, how far does it get? Do you at least get to the boot animation? I notice that it may sit at the boot animation for a really long time after changing a file sometimes. Probably updating the cache or something. It's odd that it wouldn't work for you considering it's your file and it worked for meloy. How did you copy the file over?
If you try again, delete the original file, so you can be sure it's no longer there, then try the copy again.
I'm on AT&T 1.8.3. I followed instructions just as in OP (yes, including the proper setting of permissions), but I soon found a significant problem. Everytime I held down my power button in order to invoke the power options menu, instead of the menu popping up, my phone just freaked out (the screen quickly FADED to black and the phone rebooted). I did this about four times, and each time it happened exactly the same. So I brought back the original framework file, and now everything works fine.
Any ideas?
I have no problems with this mod. It works all fine.
Been waiting on this mod. Streakvibrations has me missing my notification vibes. Thank you
It gave me a red light on boot, stuck at Motorola logo for infinity. I booted into recovery and reflashed gb 3.5 to fix it. Ill try your idea of deleting it then moving the new one.
Sent from my MB860 using XDA App
EDIT: still didnt boot, had to flash again..
I'm getting the flashing red light and rebooting as well. I can't get into CWM though, going to have to flash a SBF. Only think I can think of is maybe the Dalvik cache needs to be wiped before rebooting?
Edit: I'm on an AT&T phone and used GB to deodex as well.. maybe it's not catching all the files..
lurchbyrep said:
I'm on AT&T 1.8.3. I followed instructions just as in OP (yes, including the proper setting of permissions), but I soon found a significant problem. Everytime I held down my power button in order to invoke the power options menu, instead of the menu popping up, my phone just freaked out (the screen quickly FADED to black and the phone rebooted). I did this about four times, and each time it happened exactly the same. So I brought back the original framework file, and now everything works fine.
Any ideas?
Click to expand...
Click to collapse
Are you on stock 1.83? Now that we know that android.policy.jar has some mods built into it for Gingerblur pseudo rom, the att 1.83 file I posted probably isn't ideal for stock users.
If you're on stock, maybe you could post your android.policy.jar somewhere and pm me the link to download. Then I could put together a pure stock att one when I get home.
Sent from my MB860 using XDA App

[R&D] QuickSwitch Between Recent Applications (Updated with instructions)

** Edited: Instructions at the bottom **
I have the Nexus S, and when I upgraded to ICS I found that opening the recent app dialog could take a while.
I wanted the ability to quickly switch to recent apps, so I thought the power and volume up/down buttons combination could be used to do this.
Quickly tapping on the power and volume up/down buttons together brings the previous/next recent app to the front
I prepared a short video to demonstrate (sorry for the lack of interesting audio in the video):
http://youtube.com/watch?v=ndGd2y9ro14
I created this and tested it for about a week.
It works fine, but still needs a bit tweaking and maybe some configuration through the settings screen (enable/disable completely, tapping time, cycle/don't cycle apps).
One major issue is that I believe it is only comfortable when the power and volume keys are located on opposite sides, like on the Nexus S.
This is a small modification to CM9, so I have a few questions maybe you could help:
Is there a way to include features per devices? I saw that the code checks for devices with or without the search button. Is there a way to know which device has the power button on the right? Or do I need to map it before-hand? Which brings me to..
Do you think this is this something worth uploading to CMGerrit for review to be included in CM, maybe enabled as an advanced feature in the settings section?
Do you know any ROM maintainer that would want this feature?
Any suggestions to improve (or drop) this are appreciated, maybe adding an indication of the app switching.
** INSTRUCTION **
Please follow one of the next instructions to get it (whatever suits you):
Install using a flashable zip
Download the attached flashable zip file (quick-switch-0.01-signed.zip), and flash it from recovery.
This is compiled from CM9 RC1. While it may work with later nightlies or other similar ROMs, I cannot guarantee that it does.
To revert, flash your ROM over it.
Install the jar file manually
I've also attached the JAR file so that you could install it manually.
The JAR should replace /system/framework/android.policy.jar
Backup the current one, copy the one from this post over it, clear the dalvik cache, and reboot.
You'll probably need to remount the /system folder so you could write over it (adb remount).
Note: You cannot do this from recovery because recovery doesn't mount /system automatically. To mount /system from recovery just type "mount /system" from "adb shell".
To revert, just copy the JAR from the backup and clear the dalvik cache.
Get the source (Advanced)
I forked the relevant project (android_frameworks_base) on github.
The commit is: https://github.com/lightpriest/andr...mmit/28e2caa1459d9be287d5e0b68b6ca04fee45970d, and it is present both on ics and ics-release branches.
An important note
While this is a nice thing to play around with, I've noticed that the power button started to wear on my device. I'm not 100% sure it's related, but I'll take a "wild" guess that it does. Not to say that the power button doesn't work at all, but I noticed that now sometimes it's enough to just slide a finger on it to actually press it. So, you've been warned
I'll probably make another build for JB, once it gets stable.
Attached files checksum:
quick-switch-0.01-signed.zip - 474e5d53cff57a163f9c24ec8301b2a7
android.policy.jar - eba03024571866fc0161e19484dc200a
youtube.com/watch?v=ndGd2y9ro14
That feature actually looks quite interesting, and usable. Would love it, myself.
I'm not sure whether or not it'd be accepted in CM, since they want their builds to be much more streamlined and easy to understand than GB builds. Who knows though, as I said, it's an interesting feature. There's also the problem with power- and volume keys that wear out. And this mod would no doubt accelerate that.
With that said, I would absolutely love a smali-version guide for this.
Edit: evilisto created a guide on how to map the multitasking button the the search key, which helps a lot. I recommend you check that out.
It is also possible to map the GB taskswitcher to search button. The gb is imo faster than the ics one
yeah its a cooool feature.. but the thing is...jelly bean has got super speedy task switchin even on our nexus s...
I'm not sure on what's the best way.
I can generate a diff of the smali files, and then maybe create a guide out of it.
I also created a signed update zip file, with the JAR that needs to be replaced.
The flashable zip was created from CM9 RC1, do you prefer the zip or the smali?
I'm not yet sure on how to provide this kind of guide smali, because the diff looks quite large.
Updated the post with instructions and notes (at the end).
Amazing work . Though they removed the lag in displaying recent applications in Jelly Bean. Its very snappy now.
Thanks!
I thought it was just a matter of time until the recent app overlay would work faster. From the beginning I considered this as an experiment.
This was just a nice thing to work with (and create), experimenting with the Android building environment and creating a flashable zip..
Learned a lot actually.
Actually, it is a great mod! I like it very much, makes simple two-task switching a breeze (like chatting on GTalk and writing an email simultaneously). Would you consider porting this to JB releases? AdamG's JB-Oxygen will be for sure a popular, stable release. I also think that AOKP team would love to implement your idea in their releases, since they offer feature rich roms.
Here's link to Adam's JB Oxygen : AdamG's JB Oxygen release
Great job lightpriest!

[APP] Nook Touch Mod Manager

Nook Touch Mod Manager
This app+patched jars allows you to customize the behavior of your Nook. All customizations are opt-in and can be enabled/disabled through the use of the NTMM app. If you install the patched jars and do not configure them with using the app, your Nook's behavior will not change in any way.
Features:
Re-map the n button, quicknav buttons (including the glowlight button), and top statusbar buttons to run installed programs or trigger defined actions (toggle glowlight, home, back, etc)
Option to disable slide to unlock screensaver (avoid battery drain from constantly looping animation)
Option to always show the back and menu buttons on the statusbar.
Option to restore the Glowlight state after waking from screensaver.
Option to disable or customize the "press the n button to unlock" text on the screensaver (1.2+ only)
Option to remap side buttons (1.2+ only)
Completely open source, including both the application and the patches to the jars
.
Requires patched jars.
Patches are available for software revisions 1.1.5, 1.2.0, and 1.2.1 (1.2.0 and 1.2.1 use the same patches). You can upgrade to 1.2.1 using the directions on the B&N support page.
Instructions for building the patched jars are available here: https://github.com/doozan/NookTouchPatches
Download NTMM 0.4.0
EDIT: @jeff_kz has fixed this.
--------------------------------------------------------------------------
I would like to try this. I get an error:
C:\nooksmods>java -jar baksmali-1.4.0.jar -o android.policy android.policy.orig.jar
C:\nooksmods>patch -p1 < android.policy.patch
patching file android.policy/com/android/internal/policy/impl/LockScreen.smali
missing header for unified diff at line 20 of patch
can't find file to patch at input line 20
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|8,7 @@
|
| .field private mSelector:Lcom/android/internal/widget/LeftSlidingTab;
|
|+.field private mNotFirstResume:Z
|
| # direct methods
| .method static constructor <clinit>()V
--------------------------
File to patch:
Click to expand...
Click to collapse
I think git is messing with the line-endings. Patch.exe expects them to be Windows \r\n and I think they're getting converted to Unix \n somewhere in the process. You can use a text editor like Notepad2 to open and re-save the patches with Windows line endings.
EDIT: @jeff_kz has fixed this.
--------------------------------------------------------------------------
This is line 14 to 23. I am not sure exactly what line endings to change?
.field private mSelector:Lcom/android/internal/widget/LeftSlidingTab;
+.field private mNotFirstResume:Z
# direct methods
.method static constructor <clinit>()V
@@ -950,6 +951,47 @@
.line 693
.end local v0 #r:Landroid/graphics/Rect;
:cond_17
[\QUOTE]
Click to expand...
Click to collapse
Open the patch file using notepad2, go to File | Line Endings and choose "Windows (CR+LF)" and save.
Excuse me, so I can just update my NST to 1.1.5/1.2.0, and it will work?
NookSimpleTouch/Tapatalk 2
EDIT: @jeff_kz has fixed this.
--------------------------------------------------------------------------
I like that this can set the quicknav Glowlight button!
The status bar back and menu buttons work at times, but not consistently.
The side buttons work in some apps, but not in the Reader.apk or Library.apk.
domi.nos said:
Excuse me, so I can just update my NST to 1.1.5/1.2.0, and it will work?
Click to expand...
Click to collapse
Yes, you can update your non-glowtouch nook to 1.1.5 and it will work with this tool. 1.2.0 is not yet supported. The 1.1.5 factory zip is in the "Nook ST Glowlight - ready to root" thread, see my post on the "uk nst vs us nst" thread for directions on flashing new software (sorry, can't post links yet).
@jeff_kz, where are you storing the images for the quicknav buttons. Previously I had changed these in the framework-res.apk. with your nooktouchmod it is using other images, is it possible for me to put in my own images?
ladykayaker said:
@jeff_kz, where are you storing the images for the quicknav buttons. Previously I had changed these in the
framework-res.apk. with your nooktouchmod it is using other images, is it possible for me to put in my own images?
Click to expand...
Click to collapse
The action icons (back/home/glow) are loaded from system resources, by resource id. The application icons are read from the application's package. You can customize the icons by pulling settings.db and adjusting the mod.<button>.icon value. An integer value will load a system icon by id, a package name will load the package's icon. Currently, there's no way to read an icon from an external file.
I've fixed the problem with the git line endings, so anyone else trying this will not need to bother with manual conversions.
Nice work!
LastSilmaril and I were working on a NookTouchTools for Glowlight here, but we hadn't yet finished so thanks for saving us the trouble!
Have you not posted patched jars so as to avoid copyright issues? I can respect that, but I understand that B&N have already made statements that their source is available on request (in the USA at least), so you'd save folks much trouble if you could post patched jars. I'll for sure go the long, 'clean' way around if I have to, but would prefer not to if there's no need!
Thanks again for providing this fundamental Nook tool for the 1.1.5 firmware,
Ian
EDIT: @jeff_kz has fixed this.
--------------------------------------------------------------------------
Is anyone else having problems with the side buttons in the Reader? The sidebuttons work in other apps, just not the Reader.
I previously had NookTouchTools installed, but with this app I uninstalled NTT - so I wasn't sure if that is what caused this problem, or is it possible that it happened with this mod?
ladykayaker said:
I previously had NookTouchTools installed, but with this app I uninstalled NTT
Click to expand...
Click to collapse
I'll admit I've not yet installed this, but here's one thought; what jar files did you start from when doing the patching for Nook Touch Mod Manager? Were they vanilla 1.1.5 jars or the ones you'd already installed for NookTouchTools?
ladykayaker said:
Is anyone else having problems with the side buttons
Click to expand...
Click to collapse
This app does not alter or affect the side buttons in any way. The side buttons are just hardware buttons that send a specific hardware key as defined in system/usr/keylayout/qwerty.kl. I believe NTT had a function that allowed you to change the button definitions within that file. I don't know if NTT re-alters that file when it is uninstalled. For reference, the last four lines of that file should be:
Code:
key 250 LEFT_NEXTPAGE
key 251 LEFT_PREVPAGE
key 252 RIGHT_NEXTPAGE
key 253 RIGHT_PREVPAGE
I've just taken a look in that file and it is just as you've quoted it even though I have used NTT to remap a couple of those buttons, so I guess NTT achieves it in some other way.
Patches are now available for 1.2.0 for those with nooks on the other side of the pond.
dr_diem said:
I'll admit I've not yet installed this, but here's one thought; what jar files did you start from when doing the patching for Nook Touch Mod Manager? Were they vanilla 1.1.5 jars or the ones you'd already installed for NookTouchTools?
Click to expand...
Click to collapse
I used vanilla 1.1.5 jars - the same ones that I made a backup of before installing NTT.
ladykayaker said:
I used vanilla 1.1.5 jars - the same ones that I made a backup of before installing NTT.
Click to expand...
Click to collapse
Gotcha - okay well today some time I hope to have this installed and will report back on how the side buttons behave for me.
EDIT: @jeff_kz has fixed this. NookTouchMods is now working 100% and I no longer have a need for NTT or Button Savior!
--------------------------------------------------------------------------
dr_diem said:
Gotcha - okay well today some time I hope to have this installed and will report back on how the side buttons behave for me.
Click to expand...
Click to collapse
I'd be insterested to know. For now i have gone back to NTT. With NTT I modified the quicknav icons in framework-res.apk.
With nooktouchmods the icons for quicknav are not pretty at all and the font is too large.
With NookTouchMods I like being able to toggle the glowlight instead of having to first pull up the glowlight settings window.
and with nooktouchmods the longpress takes me to android home without glowlight turning on, which is great.

Categories

Resources