I am trying to change the directory in which AlReader saves a cover image for use by the "screensaver" routine. As is, the app silently places a cover image as /media/screensavers/currentbook/nook_cover.jpg when an epub is opened. There is no setting available for this choice. Clearly this version of the app knows that it is installed on an NST.
I've decompiled the app and done what I feel is an exhaustive search through all the xml and smali files, looking for things like "currentbook","nook_cover", "screensavers" and other unlikely strings. In my minimal understanding it seems like things of this sort should appear somewhere, but so far I have found nothing.
Suggestions?
nmyshkin said:
Suggestions?
Click to expand...
Click to collapse
Yes. Tell me where the apk is.
Renate NST said:
Yes. Tell me where the apk is.
Click to expand...
Click to collapse
You are too kind. I hope to be educated. Apk attached below.
Yes, it's right there.
Because it's a static final, you have to change the value everywhere it appears.
The compiler has already inserted the value where the member name was.
Code:
File com\neverland\formats\AlBook.smali:
.field private static final NOOK_COVER_NAME:Ljava/lang/String; = "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/"
const-string v33, "/media/screensavers/currentbook/nook_cover"
const-string v7, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
I always thought that this was the AI, as in artificial intelligence.
Renate NST said:
Yes, it's right there.
Because it's a static final, you have to change the value everywhere it appears.
The compiler has already inserted the value where the member name was.
Code:
File com\neverland\formats\AlBook.smali:
.field private static final NOOK_COVER_NAME:Ljava/lang/String; = "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/"
const-string v33, "/media/screensavers/currentbook/nook_cover"
const-string v7, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
const-string v4, "/media/screensavers/currentbook/nook_cover"
I always thought that this was the AI, as in artificial intelligence.
Click to expand...
Click to collapse
Wow! So I actually had the right idea but very poor searching techniques. Thank you so much!
Yes, the name of the app has often been garbled. I guess we can thank sans serif fonts for that. I wasn't really sure until I took it apart! Perhaps the Russian developer had "ALLReader" in mind.
Renate NST said:
Yes, it's right there.
Because it's a static final, you have to change the value everywhere it appears.
The compiler has already inserted the value where the member name was.
Click to expand...
Click to collapse
Erm...I replaced all 9 "/media/screensavers/" with "/storage/emulated/0/Screensavers/" and, alas, it does not work
I took that path from the stock file manager, although when something like Tasker looks at the directory it just sees /Screensavers/, while ES File Explorer sees it as /sdcard/Screensavers/
Added to that is it's KitKat with the issues surrounding writing to the sdcard and the entire ROM is on the sdcard, so....
I guess I need to try the alternate paths just to see if either works. I thought the most explicit would be the best, but apparently not.
Edit: it occurs to me now that this feature is apparently implemented for both Nook and Onyx readers. That means the app needs to determine whether the device is either of those. From where? The build.prop file or similar? Whatever the source, the expected path might now be different or the expected string might be different with this sdcard ROM. I guess I need to start looking for "NOOK" and try to find out where it tries to get that information. I see no error messages in logcat when a new book is opened so that makes me suspect the procedure is being ignored and the device not recognized as a "NOOK".
nmyshkin said:
I replaced all 9 "/media/screensavers/" with "/storage/emulated/0/Screensavers/"
Click to expand...
Click to collapse
Huh? Is this for the NST? There is no "/storage/emulated"
There is "/sdcard".
Code:
# set
...
EXTERNAL_STORAGE=/sdcard
...
Renate NST said:
Huh? Is this for the NST? There is no "/storage/emulated"
There is "/sdcard".
Code:
# set
...
EXTERNAL_STORAGE=/sdcard
...
Click to expand...
Click to collapse
I've been working for a few months on salvaging the abandoned CM 11 sd-based ROM (https://forum.xda-developers.com/nook-touch/development/rd-nst-future-cm11-twrp-t3075458). There is emulated storage there (or so it seems). I've made some progress working around things that are too granular for me to fix (or understand). A screensaver routine is one of my projects and it works OK, but I'd like it to be able to pick up the few readers that offer the book cover feature.
I found a few entries in build.prop identifying the device as a "nook" that were present in the stock ROM but absent in the CM 11 version. Adding these back, rebooting and reinstalling the modded AlReader had no effect. I should add that AlReader correctly identifies and uses the path /storage/emulated/0 for data and library storage.
nmyshkin said:
There is emulated storage there (or so it seems).
Click to expand...
Click to collapse
Well, what does EXTERNAL_STORAGE say?
Renate NST said:
Well, what does EXTERNAL_STORAGE say?
Click to expand...
Click to collapse
Interesting...
EXTERNAL_STORAGE=/storage/emulated/legacy
PHONE_STORAGE=/storage/sdcard0
SECONDARY_STORAGE=/storage/sdcard1
No manipulations of the storage path seem to have any effect. I am thinking that the app is not detecting the device as a "nook". The file com/neverland/alr/AlApp.smali includes a flurry of "nook" references (including a glaring typo) along with other hardware references, but I haven't found any others yet. It's not clear to me from scanning the file contents whether the device detection routine lives there.
nmyshkin said:
No manipulations of the storage path seem to have any effect.
Click to expand...
Click to collapse
Did you create the screensaver directory by hand?
The original code (in longhand):
Code:
mkdir /media/screensavers
mkdir /media/screensavers/currentbook
write /media/screensavers/currentbook/nook_cover.???
Renate NST said:
Did you create the screensaver directory by hand?
The original code (in longhand):
Code:
mkdir /media/screensavers
mkdir /media/screensavers/currentbook
write /media/screensavers/currentbook/nook_cover.???
Click to expand...
Click to collapse
If this is working right the app itself should create the directories. I have it working now but there are new issues. The modded and original app are both installing as if this was still Eclair. The menus are all funky looking. I'm guessing one of the build.prop entries I added/changed finally got across the info that this is a "nook". So the screensaver routine finally worked with the modified directories. I didn't think the app would say "oh, it's a Nook, must be Eclair." I'll have to undo my changes to build.prop and see if I can produce a change. Should have saved a backup...
nmyshkin said:
The modded and original app are both installing as if this was still Eclair.
Click to expand...
Click to collapse
The graphics of the menu is only determine by the Android version, see res/menu & res/menu-v11
I'm not sure what you want.
All 16 files are in both dirs, if you don't like one style under any circumstances, just delete that whole dir and leave the other as "menu".
Renate NST said:
The graphics of the menu is only determine by the Android version, see res/menu & res/menu-v11
Click to expand...
Click to collapse
This was my thought, but I didn't alter the SDK entry in build.prop. Before modding the app, and in previous unsuccessful attempts to change the screensaver image directory, the installation always gave a more modern menu system, not looking like a typical interface on a stock NST. Once I hit on the correct modification to build.prop, the screensaver image directory started to work and the GUI reverted to a sort of crippled version of what is used on the stock NST.
I think I may have located the smali file where device detection (and SDK version) is involved: com/neverland/alr/AlApp.smali
There are the various identifiers found in build.prop, with some redundency, so that model numbers and "barnesandnoble" seem to both be used. Not sure how all that sorts out. I am reluctant to further savage the app to get this one feature working again, but that may be the only way. I have extracted a copy of the original build.prop from the ROM zip so I can compare it with the changes I made. Some entry there triggered the screensaver to work and GUI to go phlooey. Whether there is a magic combination that will fix one without angering the other remains to be seen.
Edit: yes, replacing build.prop with the original version for this ROM breaks the screensaver image routine and restores the more modern menu system to the app (after clearing dalvik and reinstalling). It seems like the most elegant approach might be to let the app see the device as "other" (as soon as I find that...) since that gives the Kit
Kat GUI, and make the screensaver image routine work for "other". But there are probably better approaches. I just don't want to bend build.prop all out of whack to fix this one issue. Who knows what issues might crop up with other apps if I do that?
nmyshkin said:
where device detection (and SDK version) is involved: com/neverland/alr/AlApp.smali
Click to expand...
Click to collapse
Yes, that's it.
If (ro.product.manufacture == "BarnesAndNoble" || ro.product.device == "zoom2") then it's a Nook
It only knows about (BRNV300, BRNV350) & BRNV500.
So, what is your mod to build.prop?
Renate NST said:
Yes, that's it.
If (ro.product.manufacture == "BarnesAndNoble" || ro.product.device == "zoom2") then it's a Nook
It only knows about (BRNV300, BRNV350) & BRNV500.
So, what is your mod to build.prop?
Click to expand...
Click to collapse
I need to look at that file again and try to see what you saw. I did see "BarnesAndNoble" and "zoom2" and recognized them. In the CM11 ROM the manufacturer was reduced to "bn". This was one of the last things I changed before the screensaver routine started to work. Other entries I changed mentioned "nook" but there were case variations which probably didn't matter. There were a few entries in the stock ROM file that were perhaps redundant or obsolete. I added those originally as well.
I'm guessing the app does not check build.prop every time it runs. That would be inefficient. I just made the change to build.prop for the manufacturer and rebooted. The GUI on the existing install remains nice and modern, but no images are saved when a new book is open. I expect that if I uninstall and then reinstall the GUI will revert to Eclair standards but the screensaver will work. I need to try that before turning in. If that's what happens, your earlier suggestion about the menus is probably the next thing to look at.
Edit: Yes, that's what happens, and a little worse. The app seems to know that /media is the internal storage for the NST so the storage default and library default are set to this during installation. This makes it impossible for it to find the opening "Welcome" document since there is no "/media" so there is an error, but you can still access settings and clear that up. If it can't tell it's a Nook then it correctly identifies storage as /storage/emulated/0 but of course the screensaver routine does not work since that's only for the Nook and Onxy readers. So...need to look at the menu trick at the least today.
There's apparently some Nook specific EPD stuff in the app, so it is probably not a good idea to go for "other" as a device ID.
SOLVED
Ugh. This app just knows too much about the NST
I tried removing one of the menu folders from res at a time, always naming the remaining folder as "menu". The behavior and results are identical. When the app is first run it displays the more modern menus one might expect from KitKat (or CM 11). But once you have changed a few settings and exited the app, when you return you are in Eclair menu land, regardless of which menu folder you leave in res. Perhaps there is no way. At least the screensaver image routine is working. That's almost more than I had hoped for.
Edit: Omigosh...I am so blind. Buried in a section of the Settings that I never bothered with (Tuning) because when I had looked in the past it was all weird stuff I would never care about was an option to use "slide menu" instead of the traditional menu. And that was it. I was deceived by the weird menu behavior at start up vs. the behavior afterwards. Once this selection was made I had both the more modern menu system AND the screensaver mod working together.
Thanks again, @Renate NST for all your help.
Related
I have seen a modified Phone.apk floating around for a while but sadly it stated that it was NOT compatible with the HTC Hero.
Well my phone had a 'feature' that makes it vibrate when the outgoing call connects, and i wanted to remove it.
Note that i'm running DamageControl 2.09 and there is NO option to disable this 'feature'.
Being quite determined and having an OK background in reversing applications i decided to give it a go.
My phone now contains an option in Phone Settings that will enable/disable this vibrate on outgoing connect.
Below i have detailed what I did and why. (I'll spare you all the things i did that didn't work, and only show HOW to modify the APK and get the system to accept it!)
Requistes:
able to run adb from command prompt (SDK in PATH EnVar)
able to run apktool from command prompt (in SDK folder?)
able to run the testsigner from the command prompt as 'java testsign' (ClassPath EnVar)
First things first, anything we do the the Phone.apk is going to require us to resign it. this presents a few problems...
Phone.apk has the following in it's AndroidManifest.xml
android:sharedUserId="android.uid.phone"
Click to expand...
Click to collapse
This means that there is most likely more .apks that have this same UserId (7 to be exact on DC 2.09)
All APKs sharing the same UserID MUST be signed with the same certificate or the OS wont let 'em load.
The second problem is that it is a system application, and if we change it's Certificate it will no longer be granted certain SYSTEM permissions like DEVICE_POWER
The easiest solution was for me to resign every apk in /system/app and /system/framework
Here is a little batch script for windows that i used (you may have to execute the commands individually, sometimes it's tempermental)
Code:
echo off
adb shell stop
mkdir SystemApp
adb pull /system/app SystemApp
mkdir SystemFramework
adb pull /system/framework SystemFramework
for /R %%x in (*.apk) do java testsign "%%x"
adb remount
adb push SystemApp /system/app
adb push SystemFramework /system/framework
rmdir /S /Q SystemApp
rmdir /S /Q SystemFramework
adb reboot recovery
echo Wipe Dalvik-Cache and Perform Factory Reset
echo execute 'adb shell chmod -R 777 /system' from adb
echo reboot and enjoy!
echo on
This code will take care of resigning all system apps, effectively changing the system certificate. Now we are free to modify the Phone.apk all we want!
Please remember that anytime we push a system app like Phone.apk which is 'always' running we should either be in recovery or use the following script:
Code:
adb shell stop
adb remount
adb push Phone.apk /system/app/Phone.apk
adb shell start
del Phone.apk
pause
after a short while the phone will seem to do a soft reset and will be running the new Phone.apk
Now that we have certificate issues out of the way lets look into the actual application itself.
once decompiled with apktool you can run this script to rename all the files to .txt (this is for being able to search the file contents via Windows Search)
note: the command prompt must be CD'd into the output directory of apktool
Code:
for /R %%x in (*.smali) do REN "%%x" *.txt
having searched through all the code for various keyphrases, i'll only show the correct ones here. We need to find where shouldVibrateOut() is located.
after searching for that we should see that it's located in Ringer.smali and looks like this:
Code:
.method shouldVibrateOut()Z
.locals 1
.prologue
.line 430
const/4 v0, 0x1
return v0
.end method
the code above effectively says return true; clearly someone was taking an easy way out here ... but this does confirm that there is no option to disable the 'feature'.
To disable it we could simply change the 0x1 to a 0x0 and recompile/push/reboot and be done with it. But the goal here is to extend the features of the phone, and doing what the dev should have done (giving users the option).
So, next we need to find the Preferences Activity that lists the options, and modify it's XML file to add our own there
looking again in the AndroidManifest.xml we find this:
<activity android:theme="@android:style/Theme.NoTitleBar" android:name="PhonePreference" android:configChanges="keyboardHidden|orientation">
Click to expand...
Click to collapse
So we know the activity is named PhonePreference
now we navigate to the /res/xml folder of apktool's output and find phone_preference.xml
it seems the last Checkbox is:
<com.htc.preference.HtcCheckBoxPreference androidersistent="true" android:title="@string/preference_save_contact" android:key="pref_key_save_contact" android:summary="@string/preference_save_contact_statement" android:defaultValue="true" />
Click to expand...
Click to collapse
so we're going to take this line and copy paste it underneath and make it look like this (changes are bolded)
<com.htc.preference.HtcCheckBoxPreference androidersistent="true" android:title="@string/preference_vibrate_out" android:key="pref_key_vibrate_out" android:summary="@string/preference_vibrate_out_statement" android:defaultValue="false" />
Click to expand...
Click to collapse
now we need to edit the strings.xml file to add values for the above checkbox
add these 2 lines to the strings.xml file:
<string name="preference_vibrate_out">Outgoing Calls Vibrate</string>
<string name="preference_vibrate_out_statement">Phone will vibrate on connect for Outgoing calls</string>
Click to expand...
Click to collapse
If we were to compile it and push it to the phone now we would see a new menu option!
Sadly the Phone application is unaware of how to use this new setting to determine whether or not to vibrate. so we must teach it by editing the code.
I'm not going to go into great detail of what each line does they're pretty self explanatory. however i will go over the important pieces...
we need to change the shouldVibrateOut() routine to this:
.method shouldVibrateOut()Z
.locals 4
.prologue
const/4 v0, 0x0
#v0=(Null);
const-string v1, "pref_key_vibrate_out"
#v1=(Reference);
iget-object v2, p0, Lcom/android/phone/Ringer;->mContext:Landroid/content/Context;
.local v2, v2:Landroid/content/Context;
#v2=(Reference);
invoke-static {v2}, Lcom/htc/preference/HtcPreferenceManager;->getDefaultSharedPreferences(Landroid/content/ContextLandroid/content/SharedPreferences;
move-result-object v3
#v3=(Reference);
invoke-interface {v3, v1, v0}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result v0
#v0=(Boolean);
return v0
.end method
Click to expand...
Click to collapse
the string in v1 is the same string as the android:key="pref_key_vibrate_out" we used when making the new checkbox.
the rest of the code basically grabs a hold of the instance's Context variable and uses some built in APIs to read the setting of that checkbox and return it's value:
Checked == True
Unchecked == False
This will enable the shouldVibrateOut routine to detect whether or not it SHOULD rather than just saying yes.
Come to think of it, why make a routine whose name suggests there's an option and then not give one!! anywayz let's finish up...
next if you did rename all the files you'll need to put them back to .smali
for /R %%x in (*.txt) do REN "%%x" *.smali
Click to expand...
Click to collapse
and then recompile it using apktool, resign it, push it to the /system/app folder AFTER issuing the STOP command as shown above.
once it's pushed you should be able to simply use
adb shell start
Click to expand...
Click to collapse
to do a 'soft' reboot of the phone.
If the app crashes try going into recovery mode and wiping out the dalvik cache!
I hope those who have read this got something out of it, and that i wasn't too confusing or too vague. any questions or comments you may have are welcome.
Enjoy!
Thanks for the instructions, you rock. This will help immensely for adding an option for roam only. I got it working for Fresh, but there were problems with other ROMs. I'm thinking your info will help resolve the issues.
noob Q. is there a flashable file...
That's pretty pro
i can make one, but you still have to resign your entire /system/app and /system/framework...
i could include those in the update.zip for you if you are running DamageControl 2.09
Hmmm... I'm running Zen... so I believe it should work....
Sent from my HERO200 using XDA App
i dont think an update.zip full of DamageControl system apps would work on a different ROM... if u can resign the system itself as described above... i can make an update.zip for you with the Phone.apk in it
Ok....
Sent from my HERO200 using XDA App
Zip Format
please please please make a backup of your original phone FIRST!
adb pull /system/app/Phone.apk Phone.bak
if you flash this update.zip for the new phone and it keeps FCing on you you'll need to either A) flash the Original i've provided in a zip format or reboot into recovery and push your old one back.
you MUST resign all system files like i've described above for my mod to work...
place the below files on your sdcard and flash away...
I do not promise anything unless you are running on DamageControl ROM 2.09
ummmm.... ok so after 2 or so hours... looks like it only works with damage rom.... somewhere some how there is something that is not letting this work... i wounder what it could be,,,,,,, ..... any way great work thank you for your help....
maybe i'll see if i can't get a working one on the Zen rom... any version info i need to be aware of?
EDIT: I'm assuming you're running this ROM....http://forum.xda-developers.com/showthread.php?t=662113
EDIT2: Here you go, as long as you're running the above rom... it'll work, tested it myself
http://www.mediafire.com/?kiaqt264culyt96
vibrate is off by default
to re-enable the vibrate go into Settings->Call->Phone Settings and there's a checkbox for Vibrate on Outgoing
Nieylana said:
maybe i'll see if i can't get a working one on the Zen rom... any version info i need to be aware of?
EDIT: I'm assuming you're running this ROM....http://forum.xda-developers.com/showthread.php?t=662113
EDIT2: Here you go, as long as you're running the above rom... it'll work, tested it myself
http://www.mediafire.com/?kiaqt264culyt96
vibrate is off by default
to re-enable the vibrate go into Settings->Call->Phone Settings and there's a checkbox for Vibrate on Outgoing
Click to expand...
Click to collapse
Actually I'm running Zen Hero fx....
Sent from my HERO200 using XDA App
here: http://www.mediafire.com/?s1zkx93bcnmjfxc
for Zen Hero FX 2.1 Lite
flash this zip and wipe the cache...
Nieylana said:
here: http://www.mediafire.com/?s1zkx93bcnmjfxc
for Zen Hero FX 2.1 Lite
flash this zip and wipe the cache...
Click to expand...
Click to collapse
this is sweet...... again thank you for all your hard work.... it works like a charm....
Hey Q. Do you know anything about vibrating when you press the dial pad... I'm looking thru settings but can't fine it... do you know if its something like this.?.?.
Sent from my HERO200 using XDA App
I can mods that too for you if you would like. Let me know.and the best part is now that u've flashed that zip file, all u'll need is a diff phone app (smaller download )... will work on it tomorrow
Sent from my HERO200 using XDA App
Big-O-Devil said:
Hey Q. Do you know anything about vibrating when you press the dial pad... I'm looking thru settings but can't fine it... do you know if its something like this.?.?.
Sent from my HERO200 using XDA App
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=660506
check out this thread bout haptic dialer
Never mind believe he was talking bout adding the option of turning it on and off
I can mods that too for you if you would like. Let me know.and the best part is now that u've flashed that zip file, all u'll need is a diff phone app (smaller download )... will work on it tomorrow
If you can.... ... that would be sweeeeet..
Sent from my HERO200 using XDA App
Click to expand...
Click to collapse
Sent from my HERO200 using XDA App
a few problems... it doesn't seem to haveit's own settings page (cant use the Phone Settings page... different package), nor can i seem to add a button to the thing .. will try later
Nieylana said:
a few problems... it doesn't seem to haveit's own settings page (cant use the Phone Settings page... different package), nor can i seem to add a button to the thing .. will try later
Click to expand...
Click to collapse
sounds like a real head-buster.....
cleaner fix by sasovics HERE
fixes attached to post
so, its fairly easy to fix the 'buttons not lighting up when the screen is touched' thats present in i9000 firmwares ran on the captivate. the problem is in services.jar,-/com/android/server/PowerManagerService.smali.
Theres 2 ways to fix it-the hard way-what i did first, and how it fixed it on JPO(i started with jpo, just cause it was 2.2 and the files were relatively close to the captivates powermanagerservice.smali. Theres almost 11,000 lines of code in this smali file, and a bunch of them had to be swapped and modified. it was a pain in the ass, but it did work.
On the 2.2.1 JPU/X/Y powermanager, a bunch of stuff had changed, and i tried to import the captivate code into this to get it to work, but it kept bootlooping. so i checked out the 2.2 powermanagerservice.smali from jl1, and it was almost identical, all the extra stuff added to the 2.2.1 file was also added here, slight changes and the difference in the buttons, but just swapping that still wouldnt work-it boot looped, so i changed out every powermanagerservice.smali file, and it worked. after id been messing around with the other **** for 24 hours.
To be more clear here, with a 2.2.1 decompiled services.jar, and a JL1 services.jar- copy all PowerManagerService.smali files (there are 24 of these in /com/android/server) from JL1 into (and replacing) the same location of the 2.2.1 services.jar.
So all 24 smali files starting with PowerManager in 2.2.1 services.jar have been replaced with ones from JL1
to get the back lights to stay on for extended time, you need to replace the values in these following lines:
55- .field private static final LIGHT_SENSOR_DELAY:I = 0x7d0
65- .field private static final LONG_KEYLIGHT_DELAY:I = 0xbb8
67- .field private static final MEDIUM_KEYLIGHT_DELAY:I = 0xbb8
95- .field private static final MEDIUM_KEYLIGHT_DELAY:I = 0xbb8
327- const/16 v2, 0xbb8
4543- const/16 v3, 0xbb8
5500- const/16 v2, 0xbb8
change value to 0x2710 for buttons to stay on for 10 seconds
change value to 0x3a98 for buttons to stay on for 15 seconds
Code:
to decompile w/ smali/baksmali- do:
*decompile-* java -jar baksmali.jar -x services.jar -o services
*recompile-* java -jar smali.jar services -o classes.dex
(do not copy decompile and recompile-im sure most of you know this, but some might not)
So when you decompile services.jar, youll end up with a file called services in whatever folder you put the jar file in and opened a cmd window on.
Now make all your edits (i use pspad-works very well) and save them in the 'services' folder.
Recompile and youll end up with a classes.dex file.
just open up your original services.jar file with 7zip, and drop your newly created classes.dex into the archive, exit it and your done.
For all those that dont want to bother doing this yourselves, heres 3 already compiled. default is button lights on for 3 seconds after you touch the screen. 10 is 10sec and 15 is 15 sec obviously.
These will wipe you dalvik-cache, so the boot up will take a little bit. You may on first reboot have to cycle airplane mode or data network mode(in extended power menu) to get data to come up, but after that it will be fine.
this will work on 2.2.1 JPU/X/Y
If your on JS3 you /may/ have to replace your 3 libaudio files and phone.apk and phone.util with ones from jpu/x/y. basically you might have to get rid of the record option until i can come up with a fix. i had the record option on my phone, and when you end a call, the phone will soft reboot. THIS ONLY HAPPENS WITH THE PHONE.APK WITH THE RECORD OPTIONS ON IT.
this should be a relatively easy fix, i just replaced those files i mentioned, it works, and i havent looked into why the js3 ones cause the reboot on end call.?
And now that this is fixed, Mikey got sounds linked, bluetooth works- not much downside to i9000 roms anymore
the end/
I changed the values in the lines you posted, and all it did was make the backlight stay on longer?
EDIT: I copied the PowerManagerService.smali over, and the lights on the screen work, but getting soft reboots.
flashed 5.6 tonight...seriously, this is the greatest feature ever!! this is great
MikeyMike01 said:
I changed the values in the lines you posted, and all it did was make the backlight stay on longer?
EDIT: I copied the PowerManagerService.smali over, and the lights on the screen work, but getting soft reboots.
Click to expand...
Click to collapse
swap out all the powermanager smali files in /com/android/server, theres like 20?something of them, i probably should have made that a little clearer.
not just PowerManagerService.smali, but copy all that start with PowerManager.
edited OP a little, a little clearer now.
You can probably only copy the PowerManagerService.smali, if you changed the lines and references.
It's 12,000 lines long, should be fun.
MikeyMike01 said:
You can probably only copy the PowerManagerService.smali, if you changed the lines and references.
It's 12,000 lines long, should be fun.
Click to expand...
Click to collapse
Ya you can. You can get it working on i9000 2.2 just by swapping jpo powermanagerservice.smali with a captivate version. I tried doing that way at first using compare it. I was swapping lines for like 12 hours, had it working button lights everything, but it would soft reboot every few minutes and I just got tired of doing it that way.
Once you have the files all copied over, then you can adjust the light time.
What the hell is this doing on the second page????
This completes all i9000 ROMs
I was wondering the same thing, some even voting low *'s. WTH is wrong with people
Edit: and cezar- let me know how it works with js3 I didn't try it. Only problem could be libaudio's causing soft reboot when you press end call button, but was only tested with jpy with js3 libaudios and phone.apk and util.
Working great so far on the JS3 built Paragon RC 5.0 rom. Just took a phone call and ended it with no reboot. Running the default .zip file offered...
AWESOME WORK. I'll be making a video to display this awesome functionality! Now I think the next step is for someone to write an apk to allow for a little control on this and adjust the parameters. That would be super cool!
Edit: Tossed you some beer money!
connexion2005 said:
Working great so far on the JS3 built Paragon RC 5.0 rom. Just took a phone call and ended it with no reboot. Running the default .zip file offered...
AWESOME WORK. I'll be making a video to display this awesome functionality! Now I think the next step is for someone to write an apk to allow for a little control on this and adjust the parameters. That would be super cool!
Edit: Tossed you some beer money!
Click to expand...
Click to collapse
Guessing that his framework files are not JS3 if that is working. The logcat shows a call to a function that only exists in JS3 that is now missing because of swapping the files in the dex.
connexion2005 said:
Working great so far on the JS3 built Paragon RC 5.0 rom. Just took a phone call and ended it with no reboot. Running the default .zip file offered...
AWESOME WORK. I'll be making a video to display this awesome functionality! Now I think the next step is for someone to write an apk to allow for a little control on this and adjust the parameters. That would be super cool!
Edit: Tossed you some beer money!
Click to expand...
Click to collapse
I told you!
Does this still break phone call recording?
GGXtreme said:
Does this still break phone call recording?
Click to expand...
Click to collapse
On my jpy rom yes. I had to get rid off the libaudios that support call recording and put back the jpy libs that freeze the phone when you stop recording
Not tested on js3 (by me)- sounds like dg may know
di11igaf said:
fixes attached to post
95- .field private static final MEDIUM_KEYLIGHT_DELAY:I = 0xbb8
Code:
to decompile w/ smali/baksmali- do:
*decompile-* java -jar baksmali.jar -x services.jar -o services
*recompile-* java -jar smali.jar services -o classes.dex
(do not copy decompile and recompile-im sure most of you know this, but some might not)
F
Click to expand...
Click to collapse
I am using the Rogers file for our 9010 rom ( witch has the same issues as the i9000)
but I noticed something
line 67 didnt need to be corrected
I have not same layout as you described
me is line 93 and here is what ti says
93_ .field private static final SHORT_KEYLIGHT_DELAY_DEFAULT:I = 0xbb8
also these lines were nto the exact same either .. weird isnt it ?
325_ const/16 v2, 0xbb8
4538_ const/16 v5, 0xbb8
5643_ const/16 v2, 0xbb8
I also noticed the same value was in line 77
77_ .field private static final SAMSUNG_PHONECALL_KEYLIGHT_DELAY:I = 0xbb8
not worth changing but some ppl might want to ...
on a side note for th elife of me I didnt understand what youmeant by do not copy decompile recompile , took me a while to figure out you were walkin about what was pasted in the 'code'
Edit :
I dont know witch files I was using but they were clearly not jl1 I used yours inside your dex files and swap everything works perfect thx .
designgears said:
Guessing that his framework files are not JS3 if that is working. The logcat shows a call to a function that only exists in JS3 that is now missing because of swapping the files in the dex.
Click to expand...
Click to collapse
It's a very dirty mod. Think dropping a nuke on a sniper. But I haven't had a problem yet.
If there were problems I would not have posted it. There's only one other way to do it...
di11igaf said:
If there were problems I would not have posted it. There's only one other way to do it...
Click to expand...
Click to collapse
I know.
But the last time I did a mod that was quick + dirty, it dropped a call 3 weeks later. Just saying.
nevermind , it works now ...
MikeyMike01 said:
I know.
But the last time I did a mod that was quick + dirty, it dropped a call 3 weeks later. Just saying.
Click to expand...
Click to collapse
but i fixed it 22 days ago, its been in testing for 3 weeks and a day to make sure it doesnt get that 3 week dropped call bug
First off, this is my very FIRST publically posted Android mod, and my second one ever - I made the first one earlier today. In other words, I'm new and may make mistakes.
These steps work for me, though!
Exactly what this guide does:
When you enable "Blocking mode" in the Samsung JB ROMs, an "ongoing" (and thus unremovable) notification is shown AT ALL TIMES, even if Blocking mode is only active for a certain time period (at night in my case).
This mod will entirely remove that notification. It will not show up even when blocking mode IS in fact blocking calls etc.
IMO the ideal behavior would be to show it during the time it's active, but that would be a much harder mod to make, as you'd need to add new (byte)code.
Now, with that out of the way...
Requirements:
* DEODEXED AND ROOTED Samsung Jelly Bean ROM (I use WanamLite XXDLIH v3.9, google it - I can't post the link)
* 7-zip (google it)
* Galaxy S III - not sure if other models than the i9300 will work, my guess is that they will. I can't test on other phones than my own, though, so you're on your own in that case! Also no idea if Note models will work, I've never used one.
* A Windows computer - unless the tools are available for other platforms.
* Java -- if you can do Start -> Run -> "java" -> OK without an error, you should be fine.
* A bit of patience
As always, this is on your own risk!
Steps to hack:
0) BACK UP YOUR PHONE! My suggestion would be to take a nandroid backup before getting started.
1) Get an apktool that works with JB APKs.
Here's the one I use (assemble the link): mediafire . com / ?ufzdylekbkloffy
(Sorry for doing that, but surely posting guides constitutes making helpful contributions? )
The ZIP contains two apktool versions, one for decoding and one for building.
Thing is, I'm not 100% sure on where I got the apktool JARs. I think one of them is the unmodified 1.4.2 JAR, and one is modified to work with ICS (and newer) APKs.
I couldn't get EITHER of them to both decode AND build, so I made two separate batch scripts.
I do promise that the thing's safe, but if you don't trust me, you can find them elsewhere - I'm just not sure exactly where. I found them by trial and error.
2) Unpack the tools to a directory, e.g. "apktool" on your desktop. (If you want to follow this guide to the letter, you need to use that folder too.)
3) Start a command prompt - Start -> Run -> enter "cmd" -> click OK
4) Connect your phone via USB, and make sure USB debugging is enabled on it (under Settings -> Developer Options)
5) Enter the following commands, exactly as specified, in order of course:
Code:
cd Desktop\apktool
adb pull /system/framework/framework-res.apk
java -jar apktool-BUILD.jar if framework-res.apk
adb pull /system/app/SecSettings.apk
apktool-d SecSettings.apk SecSettings-mod
You should now have a "SecSettings-mod" directory (under Desktop\apktool) with the contents of the APK.
6) Browse to SecSettings-mod\smali\com\android\settings\dormantmode, right-click "DormantModeNotiReceiver.smali" and Open With... -> Notepad (or right-click and "Edit", if that choice exists)
7) Click the Edit menu -> Find..., and search for "notificationCreate" (no quotes). The first hit should be ".method public notificationCreate [... etc]"; click Find Next.
The next hit should be something like
Code:
invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/Context;)V
8) Comment that line out by adding a # as the very first character, so you end up with
Code:
# invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/Context;)V
9) A few lines down (10 or so), there's another invoke-virtual, for notificationClear. Comment this out as well, aagin by adding a # as the first character on the line.
When you're done, save and exit.
10) OK, we're getting there. Time to rebuild the modded APK.
Go back to the command prompt (or start a new one, see above).
Run this command:
Code:
apktool-b SecSettings-mod SecSettings-new.apk
This may take a LONG while, it takes a bit over 11 minutes for me (nearly all of it to build resources). Be patient!
When it's completed, open up both the ORIGINAL .apk and the modded one in separate 7-zip windows. Delete "AndroidManifest.xml" from the modified apk, then select and copy "META-INF" and "AndroidManifest.xml" from the original to the modified APK. Exit 7-zip.
11) Time to get the modded file over to your phone! Run these commands:
Code:
adb remount
adb push SecSettings-new.apk /system/app
adb shell
12) You should now have the file on your phone, and have an adb shell open. Almost there!
If you're not root (i.e. if the command line ends with $ rather than #), run "su".
Then:
Code:
cd /system/app
mv SecSettings.apk SecSettings.apk.OLD
mv SecSettings-new.apk SecSettings.apk
... and you're finally DONE, if all went well.
"exit" the adb shell, and reboot your phone. When it boots up, the notification should be gone, but blocking mode still works.
Let me know if you have problems, and we'll see if I'm qualified to help solve them.
Before
After
(I would show that blocking mode is active, but the toggle was offscreen in the "before" shot, and I don't want to revert to snap a new one!)
I've also modded away the brightness bar + rearranged the quick-setting icons via this guide - the steps are essentially the same as this guide, except you edit SystemUI.apk and change different files (two XML files instead of the .smali).
To get rid of the brightness bar, follow that guide but also look in values/bools.xml where you can change a brightness value and auto-brightness-button to false. (Change both!)
Great work, Does anyvbody have this as a flashable zip??
carrd said:
Great work, Does anyvbody have this as a flashable zip??
Click to expand...
Click to collapse
Hmm, I'm not sure whether simply using the finished SecSettings.apk is a good idea or not. If a ROM has changed it, those changes would be lost.
The alternative might be to have all this done by a script on the phone (in CWM), but I'm not sure whether that's possible or not. Anyone?
exscape said:
Hmm, I'm not sure whether simply using the finished SecSettings.apk is a good idea or not. If a ROM has changed it, those changes would be lost.
The alternative might be to have all this done by a script on the phone (in CWM), but I'm not sure whether that's possible or not. Anyone?
Click to expand...
Click to collapse
Here's a CW Zip. I've built this based on the XXDLIH build one.
The script will backup the original file to /system/app/SecSettings.apk.orig so worse case scenario you just need to rename it using a root explorer (any will do).
Let me know, however like anything you flash with CWM, make a backup FIRST and I'm not to be held responsible for your phone becoming Self Aware or owt.
Also, The guide at the top is basically right, however there's a lot of steps missing, I'll knock something up if anyone wants it to fill in the gaps (setting up the environment for a start etc).
However this 'should' work on all XXDLIH builds (but AFAICT should work on XXDLIB as well)
Here's the link to the file https://www.dropbox.com/s/kov1bdluu0pt8x8/Blocking_Mode_Icon_Remover.zip
i've intalled you mod by cwm in wannamlite 3.9 and every thing went like a charme. i have a few mods intalled and nothing was deleted. thanks a lote really nice job.
Sent from my GT-I9300 using Tapatalk 2
mocas said:
i've intalled you mod by cwm in wannamlite 3.9 and every thing went like a charme. i have a few mods intalled and nothing was deleted. thanks a lote really nice job.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
No probs, anything to help.
Thanks to exscape for the source.
the_ape said:
Also, The guide at the top is basically right, however there's a lot of steps missing, I'll knock something up if anyone wants it to fill in the gaps (setting up the environment for a start etc).
Click to expand...
Click to collapse
Hmm, which environment? All the files (adb, apktool + their dependencies) should be included.
Anyway, thanks for the zip
exscape said:
Hmm, which environment? All the files (adb, apktool + their dependencies) should be included.
Anyway, thanks for the zip
Click to expand...
Click to collapse
You need to pull the various frameworks from the device, and put them in the right place. This is all documented elsewhere on the site, but for quickness sake, here's a down and dirty.
Download the 7Z Below (latest versions of aapt etc from http://forum.xda-developers.com/showthread.php?t=1792937), unpack them somewhere. Make sure Jave JRE is installed.
To pull from device, plug the Phone in then
Goto unpack folder
Let's get the frameworks from the device, so plugin the device, and ADB Devices and make sure you get a deviceID back.
pull_framework.bat
pull_twframework.bat
Now get the frameworks installed
set_framework-res.bat
set_twframework.res.bat
Let's get the APK we want to work with, so....
adb pull /system/app/SecSettings.apk .\apk\SecSettings.apk
OK, file in the right place, so let's get it unpacked to work with.
apktool d apk\SecSettings.apk working\SecSettings
That will take a few minutes, as it's got to sort out the framework dependencies etc, so give it a second or two. It should then look a little like the following
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\YourUserName\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Now lets edit the smali for the fix (thanks to exscape for this, so click his thanks button)
notepad .\working\SecSettings\smali\com\android\settings\dormantmode\DormantModeNotiReceiver.smali
<CTRL>-F notificationCreate
Find Next one
change invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/ContextV
to
#invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationCreate(Landroid/content/ContextV
and a bit further down
change invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationClear(Landroid/content/ContextV
to
#invoke-virtual {p0, p1}, Lcom/android/settings/dormantmode/DormantModeNotiReceiver;->notificationClear(Landroid/content/ContextV
OK, edit done, save and back to the command prompt
start .\apk
Open the APK in 7-Zip/WinRar/Whatnot
Select the AndroidManifest.xml and the META-INF folder, and extract them to the working folder
We have all our bits, so let's put it back together in a usable APK
First we need to create an unsigned build (without the real manifest and META-INF)
apktool b working\SecSettings built\SecSettings-Unsigned.apk
This will take a while to run, as it's compiling everything it needs, should look a bit like this
: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Right, now we need a signed version, so copy the manifest XML and META-INF folders to \build\apk in the SecSettings folder.
move .\working\AndroidManifest.xml .\working\SecSettings\build\apk
move .\working\META-INF .\working\SecSettings\build\apk
Let's now compile the nice signed version, this will take moments, as it's just integrating the Manifest with the already compiled stuff.
apktool b working\SecSettings built\SecSettings.apk
And there we are, job done.
Copy to device in any way that you want, easiest is probably
adb push .\built\SecSettings.apk /system/app/SecSettings.apk
Remember that will overwrite the original (but you have a backup in the APK folder remember), just launch settings now on the device and you should be good to go.
Having said that, easier just to flash the zip
Ohh, I forgot the framework step. Sorry about that. I changed step #5 to include it now.
That's all I've done as far as frameworks go, and I've both used the guide myself (before I wrote it ) and tried it once after... So it should work now.
exscape said:
Ohh, I forgot the framework step. Sorry about that. I changed step #5 to include it now.
That's all I've done as far as frameworks go, and I've both used the guide myself (before I wrote it ) and tried it once after... So it should work now.
Click to expand...
Click to collapse
You will deffo need the TW Framework as well, else it wont be able to decompile. If you want to make sure, try
rd /s %userprofile%\apktool
Then try the process you have out, and you should get issues as the twframework is not available
the_ape said:
You will deffo need the TW Framework as well, else it wont be able to decompile.
Click to expand...
Click to collapse
I just deleted the entire \Users\x\apktool folder, re-added framework-res and decompiled the SecSettings APK with no errors. I'm sure I've never used the 'apktool if' command with anything else prior, too. Hmm.
mocas said:
i've intalled you mod by cwm in wannamlite 3.9 and every thing went like a charme. i have a few mods intalled and nothing was deleted. thanks a lote really nice job.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
exscape said:
I just deleted the entire \Users\x\apktool folder, re-added framework-res and decompiled the SecSettings APK with no errors. I'm sure I've never used the 'apktool if' command with anything else prior, too. Hmm.
Click to expand...
Click to collapse
Cool, just making sure, if it works then cracking.
However setting up the fw's that way is the 'correct way' to do them.
hi again, is it possible for u to make a flashable zip with remove blocking mode and smart rotation?
when i install smart rotation i lose blocking mode and vice versa. thanks a lote.
Sent from my GT-I9300 using Tapatalk 2
mocas said:
hi again, is it possible for u to make a flashable zip with remove blocking mode and smart rotation?
when i install smart rotation i lose blocking mode and vice versa. thanks a lote.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
I can certainly have a look, can you post a link to the rotation hack your using please?
Sorted, I'll compile and upload shortly, not a problem.
here is the link, thanks a lot again.
http://forum.xda-developers.com/showthread.php?t=1933519
Sent from my GT-I9300 using Tapatalk 2
mocas said:
here is the link, thanks a lot again.
http://forum.xda-developers.com/showthread.php?t=1933519
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Here we go, https://www.dropbox.com/s/mtycq38lfw3sl4z/Blocking_Mode_Icon_Remover_With_Smart_Rotate-DLIH.zip
Should work just fine, works Fine on mine anyhow.
Let me know if there's issue, and click thanks if you appreciate
thanks a lot, no issues what so ever... every thing went just fine.
Sent from my GT-I9300 using Tapatalk 2
mocas said:
thanks a lot, no issues what so ever... every thing went just fine.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Most welcome
Would this excellent mod work on a Note II, by any chance?
I spent all morning doing this mod for the temasek 5.0.1 rom. I successfully edited my framework.jar and i can immediately tell the difference "fast scrolling, no lag". This mod should work with both f2fs & ext4. It will work on any lollipop rom if you follow the instructions below. There seemed to be alot of interest so i wanted to make a guide on how i achieved this mod. Credits go to several devs on xda that i followed their guides, so thank you. Also a big thanks to temasek for one kickass rom!
1st: Pull you roms framework.jar located within system/framework. Use root explorer or just pull it from the roms zip.
2nd: Download and install the lollipop apktool. I attached it below. Make a folder in your C drive named apktool and extract the contents there.
3rd: Place the framework.jar you extracted along with your framework-res.apk in the apktools folder.
4th: Hit shift and right click your mouse to open a command prompt within the apktool folder.
5th: Install your framework-res apk. Enter command : "apktool if framework-res.apk". No quotes.
6th: Enter command to decompile : "apktool d framework.jar". No quotes.
You should see the output saying :
I: Baksmaling...
I: Copying assets and libs...
7th: Open smali/android/widget/AbsListView.smali and search with notepad+ for:
Code:
.method private createScrollingCache()V
.registers 3
and look for this:
Code:
.prologue
const/4 v1, 0x1
Change it to:
Code:
.prologue
const/4 v1, 0x0
Then search for:
Code:
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
And change to:
Code:
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
Now locate:
Code:
.method public setScrollingCacheEnabled(Z)V
below it find:
Code:
.parameter "enabled"
Change to:
Code:
.parameter "no"
Save changes and close notepad+.
8th: Recompile the .jar file: "apktool b framework.jar.out" No quotes.
Should see:
I: Checking whether sources has changed...
I: Smaling...
W: Could not find resources
I: Building apk file...
Don't worry about the warning about not finding resources, it's expected. And that's about it. Go ahead and push you new framework.jar file to system/framework and reboot. First reboot might take awhile.
*ALWAYS DO A NANDROID BEFOREHAND. Im not responsible if your Oneplus implodes.
Reserved in case.
fix-this! said:
Reserved in case.
Click to expand...
Click to collapse
Looks like you beat me to it lol
sent from my amazingly awesome OnePlus One
Don't forget to hit thanks!
Sorry for being a smali noob, but exactly where will I find the NEW framework.jar? The original files that were placed in the tool folder or is it the entire framework.jar.out folder? I'm not certain as the original file seems to show "last modified" when it was first moved into the folder and before any of the decompiling started.
erad1 said:
Sorry for being a smali noob, but exactly where will I find the NEW framework.jar? The original files that were placed in the tool folder or is it the entire framework.jar.out folder? I'm not certain as the original file seems to show "last modified" when it was first moved into the folder and before any of the decompiling started.
Click to expand...
Click to collapse
Should be located in framework.jar.out/dist/framework.jar
@fix-this!
You might want to actually tag the devs who's work you used to put this guide together, it's the right thing to do.
Transmitted via Bacon
timmaaa said:
@fix-this!
You might want to actually tag the devs who's work you used to put this guide together, it's the right thing to do.
Transmitted via Bacon
Click to expand...
Click to collapse
this mod has been around for years so im not sure who first came up with it. after work i can link and credit the threads i used. as i said i dont take full credit at all. i just made this thread for the oneplus users.
Added to OnePlus One index thread:
[INDEX] OnePlus One Resources Compilation Roll-Up
Transmitted via Bacon
I never really ever saw the difference between Smooth Scrolling and sans. It's already really smooth on the OPO, and if it were to stutter, say scrolling REALLY fast through Facebook, it would still lag with the mod. Am I missing something?
dylanraga said:
I never really ever saw the difference between Smooth Scrolling and sans. It's already really smooth on the OPO, and if it were to stutter, say scrolling REALLY fast through Facebook, it would still lag with the mod. Am I missing something?
Click to expand...
Click to collapse
No, some apps are so badly coded they will still stutter because of dalvik.
If youre more interested in the technical way, here's an explanation.
In android, apps do not control memory management. Its all controlled by java. So that means, even if an app is done with a block of memory, it has to wait for the Java's garbage collector to reclaim it. The problem with this is the GC pauses the entire app until its finished. The more often an app overloads the frame buffer, the more times the GC is called, and the more lag you have. LP's ART has a greatly improved GC and most apps are as smooth as IOS in terms of scrolling fluidity.
sent from my amazingly awesome OnePlus One
Don't forget to hit thanks!
Thanks for the tut @fix-this! Everything went as planned and although the OpO is very smooth this helps. I see the difference when using G+, I read where people said to try scrolling that app and you'll see plenty of stutter and it's true. It can be alleviated some with the right governor but at the cost of precious battery, with this mod I can stay with a battery friendly governor and G+ scrolls by very nicely. Thanks also for helping me to de-compile an apk for the first time!
What battery friendly governor do you use? And what I/O schedular?
Good
I shared mod for build 13 from K900 here
http://forum.xda-developers.com/oneplus-one/themes-apps/mod-smooth-scrolling-mod-mahdi-rom-t2840934
Hi everyone,
I have a Nook GlowLight 3. I don't like the default screensavers, so I'd like to delete them and (optionally) put in some new ones. Is this possible?
Maybe it's just a matter of getting into the Nook's file system and replacing their image files with my own (with the same filenames)?
This Nook is new. I don't mind voiding the warranty, but I'd rather not unless I know it will be worthwhile. Otherwise, I would try it myself. So I'm hoping some kind soul who has a NGL3 that they have already broken into would be willing to take a look at it for me.
Please let me know if I can help! Thank you!!
Robert
I've got too many Nooks and I'm far removed from stock.
Do you have a directory /data/sleep/
That used to have PNGs for some standby images.
Do you currently have the old, creepy authors?
I have not rooted it or anything yet, just plugged it into my Mac and looked at the default directories it comes with. There is basically nothing there– I even had to research online and experiment how to just create a directory where I could sideload a PDF. So, no, I haven't seen any directory like you mentioned. And I'm not sure what you mean about the old authors(?). The screensavers I have are Symbols and Quotes. In any case, this is my first Nook, and it's less than a week old.
So, do you think there is a good chance I could make changes to the stock screensavers?
The "old, creepy authors" were the screensavers that made the Brontë sisters look like the witches out of Macbeth.
These images are all packed away in /system/priv-app/partner.apk in res/drawable-mdpi-v4/
Code:
artboard_1.png
artboard_2.png
artboard_3.png
artboard_4.png
artboard_5.png
artboard_6.png
artboard_7.png
artboard_8.png
alexander_pope.png
chinese_proverb_00.png
cicero.png
jane_austen.png
john_wilson.png
lady_mary_montagu.png
louisa_alcott.png
robert_southey.png
thomas_jefferson.png
thomas_kempis.png
The list of images is in res/values/arrays.xml in quotes_imgs and symbols_imgs
The actual screensaver mechanism is com.nook.partner.screensaver.ScreenSaver (in partner.apk).
If you repack that all it won't have a B&N signature
I'm not sure how much that will break things.
In worst case you could resign everything.
I think that I'd just rewrite ScreenSaver to fetch PNGs from a directory like /data/sleep
That way, changing the collection would be easier.
Oh, and another thing...
As always, the sloppiness of B&N gets to me.
Those "quote" image files are ten times the size of the "symbol" image files.
Why? Because they have a very subtle dithering to the backgrounds.
It's nothing that you can see even on a regular LCD monitor, let alone on a black & white eInk panel with 16 shades.
So the file is basically trying to compress random noise. That doesn't work out well.
Below is what you get when you use the fill tool (red) in MS Paint on the image.
It leaves holes because the adjacent pixels aren't exactly the same value.
Oh, yes: I remember those goofy portraits.
OK, thank you– I really appreciate your help! I am excited to try this out when I can snag some free time. I will try to post what happened, too.
OK, I was able to pull that partner.apk file to my Mac, and unzip it. The images are there. Awesome!
So, I'm temped to create my own B&W/greyscale pngs, with the same dimensions, and give them the same file names. Then put them in the same locations, rezip (with an apk extension), and push it into place. I know it will have a different file size, etc, but do you think that will be a problem? Normally I'd just try it, but I'm trying to err on the side of caution.
Thanks!
Newtham said:
rezip (with an apk extension), and push it into place.
Click to expand...
Click to collapse
Yes, it should work.
There doesn't seem to be any problem with signatures.
I modified all my images for fun and it didn't break anything.
(Although, I've hacked so much stuff on this that the screensaver never activate. This is not my primary reading device.)
It must have some signature (the originals will do) or it won't be acknowledged as an APK.
Make sure that you keep the original file as a backup.
I'm still new to this, so basic question: what is a signature (in this case) and how do I create or modify it?
Thanks!
Newtham said:
What is a signature...
Click to expand...
Click to collapse
Signatures are the three (or more) files in the META-INF directory in the zip (apk).
If they are there, that's fine.
To learn about apk signing Google it.
@Newtham
Oh! I figured something out. I looked through the code.
If you just want to have one screensaver of your own (which you could manually change).
All you have to do is change some undocumented settings.
File: /data/data/com.nook.partner/shared_prefs/screen_saver_preference.xml
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
[color=red]<boolean name="pref_key_screen_saver_from_sdcard" value="true" />
<string name="pref_key_screen_saver_from_path">/sdcard/sleep.png</string>[/color]
<boolean name="pref_key_screen_saver_low_power" value="false" />
<int name="key_screensaver_img_index" value="8" />
</map>
OK, awesome, thanks!
About a week ago, I tried just modifying the image files, rezipping & renaming to apk, and pushing into place, but I didn't modify the signatures. So now I'm stuck on the boot screen. (I forced it off in the meantime, but since it's e-ink, its still showing the boot screen.)
I can still see it on the command line via adb, but I no longer have write permission so I can't push the original apk back into place. So that's my next task. I haven't had time to play with it since then. It's fun playing with this, I just wish I had more time.
Newtham said:
I no longer have write permission...
Click to expand...
Click to collapse
Well, you did it once, it's just a question of making /system rw:
Code:
# mount -o rw,remount /system
One of the silly things that B&N did was making the "screensaver" and the "wallpaper" the same thing.
I'll have to write some code to make them separate things.
Lol! As I dived into this I realized that I had been all over this ground before.
The stuff I wrote in https://forum.xda-developers.com/showpost.php?p=79994025&postcount=11 about using settings to disable the B&N wallpaper is true but not necessary.
You can disable all that silliness with:
Code:
# pm disable com.nook.partner/.daydream.DayDream
You can set a simple white wallpaper using my Wallpaper.apk app available in the signature
The wallpaper only appears as a background to a launcher (or any app that has no background).
The Glow3 4.7 & Glow4 5.0 both broke the Wallpaper, you need a separate patch for that, see below.
I had previously made a patch to cycle through user supplied PNGs as a lock screen.
That patch is available in the signature as nook45patch.zip
Code:
C:\> adb pull /system/framework/android.policy.jar
C:\> apktool d android.policy.jar -o AP
C:\> mergesmali /v \AP\smali Screen.smali
C:\> apktool b AP -o android.policy.jar
Then replace android.policy.jar and delete/backup/rename/whatever android.policy.odex
Then stuff your PNGs in /data/sleep
Erm, I think this mostly applies to Glow2 4.5
I'll look more closely at Glow3 4.7
glow45patch.zip works fine on the Glow3 4.7 & Glow4 5.0
So, the nook45patch.zip works fine on the Glow3 4.7
I kind of confused myself, strange things happen if you have no images in data/sleep.
I'll look into that too.
The Glow3 & Glow4 have this problem where B&N stole the functionality of wallpaper for sleep screen.
The background on launchers appears black even though the Wallpaper API changes /data/system/users/0/wallpaper correctly.
I should be able to solve this one too.
There was a minor bug in the old patch.
It would barf if you didn't have any user images.
The new glow45patch.zip is in the signature under mergesmali.
The aforementioned glow45patch.zip is a valid patch for Glow3 4.7 too.
There is also the issue of the black Wallpaper on Glow3 4.7 when using a stock Launcher.
Does anybody else have this/notice it/care?
With 4.7 B&N got rid of /system/priv-app/SystemUI.apk and put it all into /system/priv-app/partner.apk
This necessitated a change in the WallpaperManager since it's all a different package.
The actual ImageWallpaper.DrawableEngine.drawFrame() is a bit complicated.
I couldn't (be bothered to) figure out how it was supposed to work and where it was failing.
To my taste, anything other than solid white wallpaper on an eInk device is just distracting.
I wrote a small patch to make drawFrame() just drawColor() instead of scaling and rotating Wallpapers.
Is there any interest in that?
I have been working on this, but I can't get write access via adb anymore. I have tried everything I can think of, including your suggestion above. I can log in to the adb shell and run as root and make changes there. But anytime I try to push anything with adb, it tells me it is read-only. When I run rootnook.sh, it tells me I'm already rooted, but no superSU found (and then roots again, with no different results). adb root doesn't work, either.
The only major thing that's changed recently is that I installed the latest nook update, which I thought would be a good idea before I start hacking. Maybe that messed it up.
I'm stumped (which is not difficult to do...). Any suggestion on how to get back in there?
Thanks!
You probably de-rooted yourself.
Does adb shell give a # prompt?
Does the shell command "id" tell that you are root?
Does the shell command "mount" tell you that /system is rw?
Does the shell command "getprop ro.secure" say 0 (security is off)?
When in doubt, push to sdcard and then copy (cp) to where it should be.
Thanks! Moving it to sdcard did the trick.
I unpacked the apk with apktool, edited the images directly (didn't change the file names), repacked it with apktool, and then (finally, by using the sdcard directory) got it back to the Nook. And then copied it into place. But I still get the same results: the GUI gets stuck on the boot screen.
So, do you think this has to do with signing the apk file? I did a lot of research on it, but mostly what I found was how to sign your own file, not someone else's. Do you have any tips on how I can do this (if that's what's needed)? Thanks!!
(P.S. Thanks for the info on the glow45patch. I haven't had a chance to look at it too closely yet, but it looks interesting. I'd still like to mod the actual pics, though, if I can.)