[MOD][DEV]Native Screenshot For OTA Based Roms - Droid Incredible Android Development

1.Decompile android.policy.jar
2.\android.policy.jar.out\smali\com\android\internal\policy\impl\Phonewindowsmanager.smali
3.Open up phonewindowsmanager.smali
4.look for "com.htc.action.SCREEN_CAPTURE_BG"
5.Change "com.htc.action.SCREEN_CAPTURE_BG" to "android.intent.action.SCREENSHOT"
6.Save and recompile
7. Open up your build.prop and add
# Properties for supporting framework features
ro.htc.framework.screencapture = true
8. save
9. Add these files to your rom http://www.multiupload.com/V3UUU5B9RD
10. Open up your updater-script and add
set_perm(0, 0, 06755, "/system/bin/screenshot");
11.save
DONE...
Credits
-SKYRAIDER
-Cyanogen
-HTC

Once you do this - how do you take a screenshot? Power+Home?
-xdadevelopers-user

xdadevelopers-user said:
Once you do this - how do you take a screenshot? Power+Home?
-xdadevelopers-user
Click to expand...
Click to collapse
yup
10chat

Doesn't work for me. Anyone else?
-xdadevelopers-user

xdadevelopers-user said:
Doesn't work for me. Anyone else?
-xdadevelopers-user
Click to expand...
Click to collapse
Anyone?
-xdadevelopers-user

xdadevelopers-user said:
Doesn't work for me. Anyone else?
-xdadevelopers-user
Click to expand...
Click to collapse
Hope I'm not necroposting too hard, but I just tried this. No luck.

what happens ?
10 char

When i try to take a screen shot i get a toast saying "error: /mnt/sdcard/tmpshot.bmp (no such file or directory)", and then another toast right after saying "screenshot is saved at null". I search my phones / directory with root explorer and find no .bmp files containing any screen shots. If i create a file named tmpshot.bmp on my sdcard then try to take a screen shot i get "error unable to save screenshot: java.language.nullpointer exception" and then "screenshot is saved at /mnt/sdcard/dcim/screenshots/******.bmp". Every time you create the tmpshot.bmp file and take a screen shot it also removes the file from the sdcard. So if you go to where it says it saved them the pic files are there but they have no thumb, and when you open it it is just a black screen with the little grey gallery error icon.

JoelZ9614 said:
what happens ?
10 char
Click to expand...
Click to collapse
Pwr+home brings up the power menu and takes me to the home screen. It is as if I haven't made the changes at all. I've double and triple checked and the changes are there.

I couldn't even find this line in the code:
com.htc.action.SCREEN_CAPTURE_BG

Working on Another Senseless ROM v2.0. For those having issues, you gave screenshot in /system/bin 06755 permissions correct? I did this using adb: adb shell - chmod 06755 /system/bin/screenshot.
Jermaine, which ROM are you looking for that in?

RMarkwald said:
Working on Another Senseless ROM v2.0. For those having issues, you gave screenshot in /system/bin 06755 permissions correct? I did this using adb: adb shell - chmod 06755 /system/bin/screenshot.
Jermaine, which ROM are you looking for that in?
Click to expand...
Click to collapse
I was looking in Insensitive.
***I'm mobile

jermaine151 said:
I was looking in Insensitive.
***I'm mobile
Click to expand...
Click to collapse
Found it in the method named: .method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;IIIIIII)Z
Found it @ line # 5349 (that's the line #'s in Notepad++). Here's what's around it:
.line 1743
.local v14, intent:Landroid/content/Intent;
const-string v22, "android.intent.action.SCREENSHOT"
Obviously this is the modified line, from Another Senseless ROM v2.0 that is.

RMarkwald said:
Found it in the method named: .method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;IIIIIII)Z
Found it @ line # 5349 (that's the line #'s in Notepad++). Here's what's around it:
.line 1743
.local v14, intent:Landroid/content/Intent;
const-string v22, "android.intent.action.SCREENSHOT"
Obviously this is the modified line, from Another Senseless ROM v2.0 that is.
Click to expand...
Click to collapse
Thanks Mark! I'll have to look at it again.

Hey Joel, just for grins I performed these instructions on my HTC Flyer's Honeycomb ROM named WestfireROM v2.0 (based off of the HC leak), works for that device too!
Is it okay to put up a post in the Flyer forums linking back to your OP? I suppose maybe wait until others can get this working maybe...?

RMarkwald said:
Found it in the method named: .method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;IIIIIII)Z
Found it @ line # 5349 (that's the line #'s in Notepad++). Here's what's around it:
.line 1743
.local v14, intent:Landroid/content/Intent;
const-string v22, "android.intent.action.SCREENSHOT"
Obviously this is the modified line, from Another Senseless ROM v2.0 that is.
Click to expand...
Click to collapse
It must've been late when I tried before. LOL.I definitely see the line now. Thanks again. I'm going to test it out.
EDIT: Works perfectly!!! Thanks Joelz and RMark!!!

xdadevelopers-user said:
Pwr+home brings up the power menu and takes me to the home screen. It is as if I haven't made the changes at all. I've double and triple checked and the changes are there.
Click to expand...
Click to collapse
+1. I can't get it to do anything, but the changes are definitely there. Does it matter where in the build.prop you put those additional lines?

Ok im an idiot. I was doing this late last night and i chmoded the screenshot file in /system/bin wrong. I gave it the correct permissions and now its working perfectly. I can finally ditch my screenshot app. Thanks guys.

godsmacked4653 said:
+1. I can't get it to do anything, but the changes are definitely there. Does it matter where in the build.prop you put those additional lines?
Click to expand...
Click to collapse
I put the changes at the very end, so it's the last two lines.

I just told xdadeveloper-user this same thing; if you want to post your android.policy.jar file and build.prop, I don't mind taking a look to make sure the changes were made right.

Related

[Tool] Drawable XML generator for CM7 theme chooser

Hi guys, if you've tried making your own theme for the theme chooser from scratch, you'll know how ridiculously annoying it is to add every image to the concerned xml file. Well I got fed up with it and wrote a command line tool to generate the xml for you.
To use it, you put all the images that you want to add in a folder, and then run the following command (you need the Java runtime environment for your operating system) (note that your images can begin with "frameworks_res_" or other package names - the program will automatically detect most of the common package names and you can specify your own as shown below)
Code:
$java -jar XMLGenerator.jar [package_name_1] [package_name_2] [package_name_3] [etc] [/path/to/input/folder] [outputfile]
For a more detailed guide about how to set up java and use this program, see this.
Suppose you have a folder "myDir" with 3 images: com_nhnt11_image1.png, com_nhnt22_image2.png, and frameworks_res_image3.png.
Then run
Code:
$java -jar XMLGenerator.jar com_nhnt11 com_nhnt22 myDir output.xml
The output of the program would be a file "output.xml" containing this:
Code:
<item name="drawable/image1">@drawable/com_nhnt11_image1</item>
<item name="drawable/image2">@drawable/com_nhnt22_image2</item>
<item name="drawable/image3">@drawable/frameworks_res_image3</item>
Then you can copy and paste this to whichever XML you need.
Enjoy!
Here is a list of package names that are automatically detected
This is very helpful !!
Sent from my Optimus 2X
Much much love for this! Thanks man!
This will save me a lot of time..Thank you
Awesome, thanks.
thanks man!
I've been searching and I have the java sdk installed but is there a web page someone can point me to that can help me in what I need to run that command on windows?
tia
MrDSL said:
I've been searching and I have the java sdk installed but is there a web page someone can point me to that can help me in what I need to run that command on windows?
tia
Click to expand...
Click to collapse
Command prompt...
Sent from my Blade using XDA App
hehe i did actually figure that..i must have something wrong cause even after installing java sdk when i enter that command it errors out..ill look some more..
MrDSL said:
hehe i did actually figure that..i must have something wrong cause even after installing java sdk when i enter that command it errors out..ill look some more..
Click to expand...
Click to collapse
You probably havent set your path properly, look up stuff about putting Java in your path (environment variables)
Sent from my Blade using XDA App
This fixed me up, Might want to add to OP in case someone else has the issue! http://www.java.com/en/download/help/path.xml
I got it to work but had to change the command to:
java -jar XMLGenerator.jar drawable-hdpi/ Browser.xml
Click to expand...
Click to collapse
What it created:
<item name="drawable/com_android_browser_app_web_browser_sm">@drawable/com_android_browser_app_web_browser_sm</item>
<item name="drawable/com_android_browser_arcs">@drawable/com_android_browser_arcs</item>
<item name="drawable/com_android_browser_browser_thumbnail">@drawable/com_android_browser_browser_thumbnail</item>
<item name="drawable/com_android_browser_btn_close_window">@drawable/com_android_browser_btn_close_window</item>
<item name="drawable/com_android_browser_dialog_divider_horizontal_light">@drawable/com_android_browser_dialog_divider_horizontal_light</item>
<item name="drawable/com_android_browser_fav_icn_background">@drawable/com_android_browser_fav_icn_background</item>
Click to expand...
Click to collapse
I'm runnign Windows 7
You can use .txt for the output file too! Your choice!!!!
This is great Thanks again!!!!
djdarkknight96 said:
I got it to work but had to change the command to:
What it created:
I'm runnign Windows 7
You can use .txt for the output file too! Your choice!!!!
This is great Thanks again!!!!
Click to expand...
Click to collapse
Hmm, I should really add a feature to omit the com_android_browser part in the item name... I'll think about how best to implement it and update.
Sent from my Blade using XDA App
nhnt11 said:
Hmm, I should really add a feature to omit the com_android_browser part in the item name... I'll think about how best to implement it and update.
Sent from my Blade using XDA App
Click to expand...
Click to collapse
AH, I didn't even notice that:
Template:
<item name="drawable/btn_default_pressed">@drawable/frameworks_res_btn_default_pressed</item>
Click to expand...
Click to collapse
Script:
<item name="drawable/frameworks_res_btn_default_pressed">@drawable/frameworks_res_btn_default_pressed</item>
Click to expand...
Click to collapse
I guess it won't work till you fix it? well I rather hit Find "frameworks_res_" and press delete then type and copy paste!!!! Still better!!! Thanks for making life easier!!!
I have an Idea, can you have it use the original folder from the app before we rename it on the
<item name="drawable/frameworks_res_btn_check_on_disable_focused">
Click to expand...
Click to collapse
area anad then the folder with the files renamed for the
@drawable/frameworks_res_btn_default_pressed</item>
Click to expand...
Click to collapse
???
I had the same idea, but that has some other complications... Right now I have 3 possible ways to implement this, and will update soon when I figure out which is best.
nhnt11 said:
I had the same idea, but that has some other complications... Right now I have 3 possible ways to implement this, and will update soon when I figure out which is best.
Click to expand...
Click to collapse
Saweet! I'll wait cause I'm lazy that way! Hehe
DarkGingered CM7 G2x sent this with the DarkXDA app!
OK, here's how I've done it - the program will automatically do it for common package names (it does it for all the ones that Androidian uses). However, you can specify additional package names for it to replace. Here's the new syntax -
$java -jar <packagename1> <packagename2> <etc> <input dir> <output file>
Example:
$java -jar com_upwardspiral_wallpapers com_nhnt11_dummyapp myDir output.xml
Here's the list of the package names it automatically does:
Code:
"frameworks_res_",
"com_android_systemui_",
"com_android_browser_",
"com_android_calculator2_",
"com_android_calendar_",
"com_android_camera_",
"com_android_contacts_",
"com_android_deskclock_",
"com_android_email_",
"com_android_fm_",
"com_android_inputmethod_latin_",
"com_android_launcher_",
"com_android_mms_",
"com_android_music_",
"com_android_phone_",
"com_android_providers_calendar_",
"com_android_providers_downloads_ui_",
"com_android_quicksearchbox_",
"com_android_settings_",
"com_android_wallpaper_",
"com_cooliris_media_",
"com_google_android_apps_genie_geniewidget_",
"com_google_android_carhome_",
"com_google_android_gm_",
"com_google_android_googlequicksearchbox_",
"com_google_android_talk_",
"net_cactii_flash2_"
Let me know if I'm missing anything.
nhnt11 said:
OK, here's how I've done it - the program will automatically do it for common package names (it does it for all the ones that Androidian uses). However, you can specify additional package names for it to replace. Here's the new syntax -
$java -jar <packagename1> <packagename2> <etc> <input dir> <output file>
Example:
$java -jar com_upwardspiral_wallpapers com_nhnt11_dummyapp myDir output.xml
Here's the list of the package names it automatically does:
Code:
"android_",
"frameworks_res_",
"com_android_systemui_",
"com_android_browser_",
"com_android_calendar_",
"com_android_camera_",
"com_android_contacts_",
"com_android_deskclock_",
"com_android_email_",
"com_android_inputmethod_latin_",
"com_android_launcher_",
"com_android_mms_",
"com_android_music_",
"com_android_phone_",
"com_android_providers_calendar_",
"com_android_providers_downloads_ui_",
"com_android_quicksearchbox_",
"com_android_settings_",
"com_android_wallpaper_",
"com_cooliris_media_",
"com_google_android_apps_genie_geniewidget_",
"com_google_android_carhome_",
"com_google_android_gm_",
"com_google_android_googlequicksearchbox_",
"com_google_android_talk_",
"net_cactii_flash2_"
Let me know if I'm missing anything.
Click to expand...
Click to collapse
Damn, that was fast! I'm diving in to try it out! Your awesome!
DarkGingered CM7 G2x sent this with the DarkXDA app!
djdarkknight96 said:
Damn, that was fast! I'm diving in to try it out! Your awesome!
DarkGingered CM7 G2x sent this with the DarkXDA app!
Click to expand...
Click to collapse
Test this please, I would myself but I have nothing to test it on

[DEV][HOW-TO] Enable CRT-OFF and CRT-ON in S3 Stock ROMs

Use everything here on your own risk and hit THANKS BUTTON if you like my work!
General Information:
As you propably know, till now there is no CRT-off MOD out for the S3. This is because only changing the value of config_animateScreenLights from true to false in framework-res.apk is not working anymore!
Together with Tungstwenty and rovo89 we faced out, that the problem are some missing commands in the /system/framework/services.jar
After comparing files from S2 and S3 Tungstwenty could help me to find the right position to edit files and with a litte bit of testing we found the right commands to enable the CRT-off-effect!
Click to expand...
Click to collapse
Tungstwenty said:
Let me clarify what is required in order to have the CRT effects working:
A patched library that properly (i.e. no flicker, etc.) provides the effects --> see attached flashable zip's or use Tweakbox
Code changes on the ROM in order to properly trigger the effect(s), which the library will then respond to those triggers --> look at the how-to or use Tweakbox
Item no. 1 is the one that I worked on and for which a fully working library was now provided.
The 2nd part can be done in 2 different ways - either patching the S3's ROM to properly enable the CRT-On and/or CRT-Off effects, OR do some hooking on the existing methods in the ROM and without changing that code, override the flags (i.e., the way Tweakbox does it).
It's this 2nd aspect that you guys need to address somehow. I worked with rovo89 on Tweakbox and not only does it bundle with the library, it also does the code changes in memory to make it work (topic no. 2).
But sphinx02 had already provided that, initially, after some discussion on what needed to be patched on the S3 ROM.
So, in order to have it working you have 2 ways:
Either use Tweakbox and make use of its configuration options to enable only CRT-Off, only CRT-On, or whatever you fancy.
Ask for someone (such as sphinx02) that has an S3, to keep up with existing ROMs (it will need to be changed separately for every one), and provide patched apk's on top of the existing ones so that it enables the effect triggers I mentioned. This will also need to take into account whether you prefer both effects on, only CRT-Off, etc.
I hope this is a bit more clear now, if not just let me know.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
HOW-TO make the Code Changes:
This is what have to be done:
First of all decompile classes of services.jar (I won't provide any information to this, there are many tutorials out there how to use the smali tools!)
Than in com/android/server/PowerManagerService.smali we have to make the method nativeStartSurfaceFlingerAnimation(I)V callable from inner classes. To do that, we have to add the following after the last access$XXXX method:
Code:
.method static synthetic access$9000(Lcom/android/server/PowerManagerService;I)V
.registers 2
.parameter "x0"
.parameter "x1"
.prologue
.line 110
invoke-direct {p0, p1}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)V
return-void
.end method
Than we have to add some commands to the file com/android/server/PowerManagerService$BrightnessState.smali to trigger the CRT-off-effect. For that add the red part between :cond_38 and iget-object v4, p0, Lcom/a.... like this (its around line 400 in code):
Code:
.line 2679
.restart local v3 #turningOff:Z
:cond_38
[COLOR="Red"] iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
const/16 v3, 0x11 # CRT-On and CRT-Off
#calls: Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)
invoke-static {v4, v3}, Lcom/android/server/PowerManagerService;->access$9000(Lcom/android/server/PowerManagerService;I)V[/COLOR]
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightness:Lcom/android/server/PowerManagerService$BrightnessState;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$6000(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;
move-result-object v4
If you want to have only CRT-OFF, you can replace
Code:
const/16 v3, 0x11 # CRT-On and CRT-Off
with this:
Code:
const/16 v3, 0x10 # CRT-Off only
Finally recompile the file, put it on your phone and you can see the CRT-Off effect on your S3!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Avoid flickers, enable CRT-ON in lib-file:
Tungstwenty said:
Hi,
I worked on the porting of the patch to S3 and despite not having one myself, I'm pretty confident that the binary rovo89 and myself included in the latest Tweakbox should work on an S3.
Could any of you guys try it out?
What to do:
Install the newest Xposed framework from here. Open the Installer app, press Install/Update and reboot.
Install the Tweakbox mod from here. Open it and enable the CRT effects in the appropriate section. You can also enable any other tweaks you like, to check if they also work for the S3 (most of them should)
Go back to the Xposed Installer app, activate the Tweakbox mod (2nd tab), then in the libraries section select "libsurfaceflinger.so" and use the I9300 version. Tick the "Replace in test-mode only" option and back in the 1st tab do a soft / test reboot.
If everything goes well and the effects work as expected, you can go back to the installer app and untick "test-mode only" so the lib is overridden on every boot.
Note that except for the app_process system file which is installed by the framework (creating a backup file, and which should have no practical effects until any mods are enabled later), all other replacements such as the surfaceflinger lib do not change anything in /system but are rather performed by loading the files from an alternate path.
I'd appreciate your feed back especially for the CRT effect, but also the other existing Tweakbox options.
Thanks!
Click to expand...
Click to collapse
Or use in addition to the changes in services.jar the attached flashable zip's to overwrite libsurfaceflinger.so with the corrected one by Tungstwenty or me, XXAL for (XXALE8,XXALF2,XXALF6) and XXBL for (XXBLFB,XXBLG1,...)
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Notes:
- This is a development thread so please discuss only things that interest for further development
- First part of the development has been discussed in this Thread of S2-forums
- As on the S2 after the CRT-off-effect sometimes the screen flickers --> fixed by Tungstwenty
- For some reason, it works without setting config_animateScreenLights from true to false in framework-res.apk
- I hope Tungstwenty and rovo89 can help us again to edit the libsurfaceflinger.so to avoid that it flickers after the CRT-off-effect
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Testing the effect:
I have made the changes for ODEXED and DEODEXED XXALF2 ROM, if you want to test it have a look at my thread in the themeing/modding forums:
[MOD][ALF2/ALF6/BLFB][ODEX/DEODEX] 1% BatMod + ExtPowMen + CRT-OFF-ON or CRT-OFF-ONLY
Please post development-unrelated stuff there!!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Credits:
Credits are going out to Tungstwenty and rovo89 for their excellent work on the S2 and for their help/advice on the S3! Excellent developers!
I hope you guys will help us again to fix the libs and perhaps enabling CRT-on-effect aswell!!!
Thank you for helping us again!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
reserved for future use, just in case..
Nice one!
Sent from my GT-I9300 using xda premium
sphinx02 said:
- I hope Tungstwenty and rovo89 can help us again to edit the libsurfaceflinger.so to avoid that it flickers after the CRT-off-effect
Click to expand...
Click to collapse
The flicker issue and the lack of CRT-On effect are *exactly* the same issues that are present on the S2 lib as well.
It has been fixed there, but changing ARM code without the sources is a very tedious process and that requires a fair amount of testing till it eventually works.
Without having access to an S3 it's very hard to do this or even explain what needs to be done
On top of that, I have other pending stuff I need to work on so you shouldn't expect a fix very soon, sorry.
Tungstwenty said:
The flicker issue and the lack of CRT-On effect are *exactly* the same issues that are present on the S2 lib as well.
It has been fixed there, but changing ARM code without the sources is a very tedious process and that requires a fair amount of testing till it eventually works.
Without having access to an S3 it's very hard to do this or even explain what needs to be done
On top of that, I have other pending stuff I need to work on so you shouldn't expect a fix very soon, sorry.
Click to expand...
Click to collapse
Ok, I see the problematic.. But perhaps you can give me the original and the modified files from the s2 so I can compare the 2 files and perhaps see by myself what is changed! And as I never changed anything in .so files perhaps you can tell me additionally how you have edited them!
I'm willing to try around again and to play with bytecode or so on, but I think I need a little input from you!
You mentioned the tool objdump, so I think I have to become familiar with this tool, am I right?
sphinx02 said:
Ok, I see the problematic.. But perhaps you can give me the original and the modified files from the s2 so I can compare the 2 files and perhaps see by myself what is changed! And as I never changed anything in .so files perhaps you can tell me additionally how you have edited them!
I'm willing to try around again and to play with bytecode or so on, but I think I need a little input from you!
Click to expand...
Click to collapse
Ok then, I'll give you the starting pointers so you can have a look at what lies ahead
The S2 patched file with ON and OFF both working correctly, with no flickers, is in this post.
The S2 original file is attached here.
Do a binary compare to see the changed bytes and their offsets.
To have a look at the code, you need to have the NDK installed.
Run "objdump -x libsurfaceflinger.so" to see the decompiled ARM code.
And have fun trying to understand that
Tungstwenty said:
Ok then, I'll give you the starting pointers so you can have a look at what lies ahead
The S2 patched file with ON and OFF both working correctly, with no flickers, is in this post.
The S2 original file is attached here.
Do a binary compare to see the changed bytes and their offsets.
To have a look at the code, you need to have the NDK installed.
Run "objdump -x libsurfaceflinger.so" to see the decompiled ARM code.
And have fun trying to understand that
Click to expand...
Click to collapse
Ok, thank you for that.. I dont know at this point if I ever will have success with it but I will give it a try as I have the time to! Thank you very much again Tungstwenty for your tips/advice!
While trying around a little bit and thinking about the problem, I had the following idea:
Is it not possible to build an own, additional library file with the crt-off functions? Sources for that are out there! Just copy together and build an .so file. Than in the Java-Code we are including this new native code and simply calling the function from this new / additional lib-file? What do you think about that?
Looks like someone needs to do this again...
http://forum.xda-developers.com/showthread.php?t=1676378
The flicker bug is just a bit annoying
Edits
Lol sorry just seen the post a couple above mine. Hope you guys can fix it. Good luck.
Sent from my GT-I9300 using XDA Premium HD app
sphinx02 said:
While trying around a little bit and thinking about the problem, I had the following idea:
Is it not possible to build an own, additional library file with the crt-off functions? Sources for that are out there! Just copy together and build an .so file. Than in the Java-Code we are including this new native code and simply calling the function from this new / additional lib-file? What do you think about that?
Click to expand...
Click to collapse
I don't think that's a viable option. rovo already tried that with existing sources, I think, and the resulting library did not work on sammy's rom.
As for creating a separate library with only those functions, I also don't think that's possible as everything related with screen rendering (state, buffers, etc.) is on this lib and therefore a separate one would not have any of that info.
Hi,
I worked on the porting of the patch to S3 and despite not having one myself, I'm pretty confident that the binary rovo89 and myself included in the latest Tweakbox should work on an S3.
Could any of you guys try it out?
What to do:
Install the newest Xposed framework from here. Open the Installer app, press Install/Update and reboot.
Install the Tweakbox mod from here. Open it and enable the CRT effects in the appropriate section. You can also enable any other tweaks you like, to check if they also work for the S3 (most of them should)
Go back to the Xposed Installer app, activate the Tweakbox mod (2nd tab), then in the libraries section select "libsurfaceflinger.so" and use the I9300 version. Tick the "Replace in test-mode only" option and back in the 1st tab do a soft / test reboot.
If everything goes well and the effects work as expected, you can go back to the installer app and untick "test-mode only" so the lib is overridden on every boot.
Note that except for the app_process system file which is installed by the framework (creating a backup file, and which should have no practical effects until any mods are enabled later), all other replacements such as the surfaceflinger lib do not change anything in /system but are rather performed by loading the files from an alternate path.
I'd appreciate your feed back especially for the CRT effect, but also the other existing Tweakbox options.
Thanks!
Now I try, thank you..
And CRT on is possible?
failax said:
Now I try, thank you..
And CRT on is possible?
Click to expand...
Click to collapse
Yes. If everything is working as I expect, the new things vs your current situation are:
- No more flickering issues when CRT-Off
- Now also includes CRT-On
- Can detect device orientation and do a "vertical" CRT effect instead of horizontal
All these are optional and can be turned on/off in the Tweakbox preferences.
I tried.
CRT OFF has the same problem, CRT On is not visible, but I had to place also a jar file?
---------- Post added at 12:01 PM ---------- Previous post was at 11:50 AM ----------
I must add that I'm on checkromevo hd and I've already inserted a mod to see crt off, I don't know if this can help.
Other mods in tweakbox work.
failax said:
CRT OFF has the same problem, CRT On is not visible, but I had to place also a jar file?
Click to expand...
Click to collapse
Mmm, did you follow the steps I mentioned before, i.e. enabling the lib replacement in test mode and doing a soft reboot?
You should end up with a library on /vendor/lib (ramfs) and it should get loaded on startup instead of the one in /system/lib. Can you check with a file browser if the file under /vendor/lib does exist?
Also, could you open a terminal, run "set" and check if LD_LIBRARY_PATH is "/vendor/lib:/system/lib", as in S2?
Tungstwenty said:
Mmm, did you follow the steps I mentioned before, i.e. enabling the lib replacement in test mode and doing a soft reboot?
You should end up with a library on /vendor/lib (ramfs) and it should get loaded on startup instead of the one in /system/lib. Can you check with a file browser if the file under /vendor/lib does exist?
Also, could you open a terminal, run "set" and check if LD_LIBRARY_PATH is "/vendor/lib:/system/lib", as in S2?
Click to expand...
Click to collapse
I've rebooted totally, what do you mean for soft reboot?
Now I try to see those files..
EDIT:
under vendor/lib I see 2 things, I see a folder called DRM and inside libdrmwvplugin.so, and single file called libwvm.so.
Also, could you open a terminal, run "set" and check if LD_LIBRARY_PATH ?
Yes it's there.
failax said:
I've rebooted totally, what do you mean for soft reboot?
Now I try to see those files..
EDIT:
under vendor/lib I see 2 things, I see a folder called DRM and inside libdrmwvplugin.so, and single file called libwvm.so.
Click to expand...
Click to collapse
Can you open the Xposed Installer app and post a screenshot of each of the 3 tabs? "Framework", "Modules" and "Libraries" (in this last one, scroll to the bottom to display the "libsurfaceflinger.so" entry so it's visible in the picture)
Can you send me the modded libsurfaceflinger.so so I can test it directly?
Maybe a downloadlink via pm...
I have sphinx mod for CRT, so If I deselect CRT off on tweakbox, it is shown the same.
sphinx02 said:
Can you send me the modded libsurfaceflinger.so so I can test it directly?
Maybe a downloadlink via pm...
Click to expand...
Click to collapse
Would you mind just taking it from the Tweakbox package, and in the process also checking if the on-the-fly replacement is working for you?
---------- Post added at 12:03 PM ---------- Previous post was at 12:01 PM ----------
failax said:
I have sphinx mod for CRT, so If I deselect CRT off on tweakbox, it is shown the same.
Click to expand...
Click to collapse
Your lib settings are ok, so if you do a soft reboot (pressing the button on the app), it should come back with a libsurfaceflinger.so file in /vendor/lib. It's won't happen, though, if you do a "normal" reboot.
It isn't happening to you? Could it be that the soft reboot tries to load the new lib, fails, and immediately does a hard/normal reboot - did you notice anything that could point to this?

[MOD][SMALI] Enable Native AT&T / Tmobile WiFi Hotspot[MOD][SMALI]

Guide: Howto enable Native AT&T / Tmobile WiFi Hotspot​
Locate stock/unmoddified TetheringProvision.apk
This apk is located in /system/app folder from almost any Stock Samsung ROM
Or pull from your device.
connect your device to your PC
Make sure you have the appropriate USB drivers installed
make sure Android SDK Tools are installed
cd to the platform-tools folder in the SDK location
start a command prompt in the Platform-Tools folder
adb pull /system/app/TetheringProvision.apk
Using available tools to decompile and recompile the apk
I recommend either Virtuous Ten Studio or APK-Multi-Tool for this task as
either provide an easy to use interface for working with apk edits.
I'm not placing download links here for either just do a google search and
you will easily find either one.
Decompile the TetheringProvision.apk
Once you have the apk decompiled browse to the folder containing
all of the decompiled code (You will need to be in the smali folder).
locate and edit "TetheringProvisionActivity$TetheringPlanCheckTask.smali" (com/sec/tetheringprovision)
For AT&T WiFi Hotspot
search for "entitlement.mobile.att.net" and replace with "stacra.byethost7.com"
search for all instances of "http://entitlement.mobile.att.net/mhs1" and replace with "http://stacra.byethost7.com/tether/"
search for all instances of "http://entitlement.mobile.att.net/teth" and replace with "http://stacra.byethost7.com/tether/"
For Tmobile WiFi Hotspot
search for all instances of "http://selfhelp.geo.t-mobile.com/myaccountservice/selfhelp/hastetheringoption"
and replace with "http://stacra.byethost7.com/tether/"
See code snippet below for example (not complete code)
The lines you will be looking for are highlighted in blue.
Code:
.prologue
.line 1116
iput-object p1, p0, Lcom/sec/tetheringprovision/TetheringProvisionActivity$TetheringPlanCheckTask;->this$0:Lcom/sec/tetheringprovision/TetheringProvisionActivity;
invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V
.line 1117
const-string v0, [COLOR="Blue"]"http://selfhelp.geo.t-mobile.com/myaccountservice/selfhelp/hastetheringoption"[/COLOR]
iput-object v0, p0, Lcom/sec/tetheringprovision/TetheringProvisionActivity$TetheringPlanCheckTask;->TMobileTetheringPlanCheckURL:Ljava/lang/String;
.line 1118
const-string v0,[COLOR="Blue"] "http://entitlement.mobile.att.net/teth"[/COLOR]
iput-object v0, p0, Lcom/sec/tetheringprovision/TetheringProvisionActivity$TetheringPlanCheckTask;->ATTTetheringPlanCheckURL:Ljava/lang/String;
.line 1119
const-string v0,[COLOR="Blue"] "http://entitlement.mobile.att.net/mhs1"[/COLOR]
iput-object v0, p0, Lcom/sec/tetheringprovision/TetheringProvisionActivity$TetheringPlanCheckTask;->ATTMHSPlanCheckURL:Ljava
/lang/String;
...
...
...
Once you have located and replaced all the required lines in the smali save the file and recompile your apk following the instructions provided by whatever method you choose to work with
DO NOT SIGN THE APK LEAVE THE EXISTING SIGNATURE IN PLACE
Push the apk back to your device and reboot, test to verify working Hotspot.
Thanks
Thanks to @scrosler over at the LG forums for the original code of this patch
it has been changed and revised a few times since the original port by me over
in the HTC Forums.
reserved
Another Great Work Sir.... Awesome. Added Q16 on FAQ Thread. Thanks to my Favorite Dev @cstayton :good:
[SIZE=+1]Q16: How to Enable Native AT&T / T-Mobile WiFi Hotspot?[/SIZE]
Thanks to @cstayton [MOD][SMALI] Enable Native AT&T / Tmobile WiFi Hotspot[MOD][SMALI]​
☆Swyped From SFive SS Edition☆
Thank you for this!!!! Sweet. Great work man
Can u upload the modded tetherprovision.apk for the att version AND3 please
Im.askimg cause i dont have a pc to do modding anymore
Sent from my SAMSUNG-SM-G900A using XDA Premium 4 mobile app
carlospr21 said:
Can u upload the modded tetherprovision.apk for the att version AND3 please
Im.askimg cause i dont have a pc to do modding anymore
Sent from my SAMSUNG-SM-G900A using XDA Premium 4 mobile app
Click to expand...
Click to collapse
check post #2 Here
Look, I think you should improve the guide only works for at&t and tmobile.
I modified "TetheringProvision" in this guide and nothing, the same error: "Mobile data is not avaible or invalid SIM". Does not work with another carrier other than att or tmobile.
The only way that works for me is to replace the apk dirty "TetheringProvision" method Galaxy S4.
Corroborate if someone worked with different operator, for example, movistar latin america or other provider other country.
jm2k7 said:
Look, I think you should improve the guide only works for at&t and tmobile.
I modified "TetheringProvision" in this guide and nothing, the same error: "Mobile data is not avaible or invalid SIM". Does not work with another carrier other than att or tmobile.
The only way that works for me is to replace the apk dirty "TetheringProvision" method Galaxy S4.
Corroborate if someone worked with different operator, for example, movistar latin america or other provider other country.
Click to expand...
Click to collapse
obviously your carrier uses different methods to provision tethering, if you can tell me what methods they use i might be able to adjust for it
and P.S. if you can read you would see it says AT&T or Tmobile, i only offered as a hope that maybe other carriers used the same methods, so if you want me to look into it might try asking nicely.
cstayton said:
obviously your carrier uses different methods to provision tethering, if you can tell me what methods they use i might be able to adjust for it
and P.S. if you can read you would see it says AT&T or Tmobile, i only offered as a hope that maybe other carriers used the same methods, so if you want me to look into it might try asking nicely.
Click to expand...
Click to collapse
no problem, however the effort is appreciated.
do not know how could fix the code so that it works for another operator.
It should be something generic to accept any carrier.
Well for now the problem is solved just replace the apk: http://forum.xda-developers.com/att-galaxy-s5/themes-apps/mobile-hotsoit-carrier-t2801876
hello again. :fingers-crossed:
jm2k7 said:
no problem, however the effort is appreciated.
do not know how could fix the code so that it works for another operator.
It should be something generic to accept any carrier.
Well for now the problem is solved just replace the apk: http://forum.xda-developers.com/att-galaxy-s5/themes-apps/mobile-hotsoit-carrier-t2801876
hello again. :fingers-crossed:
Click to expand...
Click to collapse
i compared that apk to ours and it is not even close in code, not sure what kind of effect this will have in our devices as far as att and tmobile go
there where to many differences to sort through to determine what was needed. sorry
jm2k7 said:
no problem, however the effort is appreciated.
do not know how could fix the code so that it works for another operator.
It should be something generic to accept any carrier.
Well for now the problem is solved just replace the apk: http://forum.xda-developers.com/att-galaxy-s5/themes-apps/mobile-hotsoit-carrier-t2801876
hello again. :fingers-crossed:
Click to expand...
Click to collapse
I PM'd you a test patch let me know if it works please
Modified successful solution
THIS THREAD:
-----------------------------------------------------------------------
http://forum.xda-developers.com/att...t/mod-enable-native-att-tmobile-wifi-t2801442
MY PHONE:
-----------------------------------------------------------------------
Samsung Galaxy S5 from AT&T
Model number: SAMSUNG-SM-G900A
Android version: 4.4.2
Using Grand Fathered unlimited data plan
PREREQUISITES:
-----------------------------------------------------------------------
* Root Samsung Galaxy S5 using Towelroot.
- see MY PHONE above
* Download/Install "Virtuous Ten Studio" (VTS): a free tool used to decompile, edit, and recompile apk files.
* Use adb to pull TetheringProvision.apk from phone to PC
* Patch TetheringProvision.apk pulled from the phone using using the VTS tool
-- edited apk files per instructions in THIS THREAD.
-- for VTS settings use advanced, use original signature of apk, ...
* USING Root Explorer create /sdcard/myPatch1/
INSTALLATION PROCEDURE:
-----------------------------------------------------------------------
adb push myPatch1/TetheringProvision.apk /sdcard/myPatch1/
adb shell
su
mount -o rw,remount /system
cd /system/app
mv TetheringProvision.apk TetheringProvision.apk.bk20140719_stock_442
mv TetheringProvision.odex TetheringProvision.odex.bk20140719_stock_442
cd /sdcard/myPatch1
cp TetheringProvision.apk /system/app/TetheringProvision.apk
cd /system/app
cp TetheringProvision.apk TetheringProvision.apk.bk20140719_myPatch1
chmod 644 TetheringProvision*
ls -la | grep TetheringProvision.apk
mount -o ro,remount /system
reboot
NOTES:
-----------------------------------------------------------------------
* To make the above work, I added line
"mv TetheringProvision.odex TetheringProvision.odex.bk20140719_stock_442"
* The above procedure also worked using using a ALTERNATE PRE BUILT TetheringProvision.apk
downloaded from "TetheringProvision_Patch_V2.zip" link found at
http://forum.xda-developers.com/showthread.php?t=2795885
FYI: 7 zip was used to extract TetheringProvision.apk from downloaded zip - see *myPatch2 below
* Size of patched APK is almost 2x size of original; however, 7 Zip shows same contents are the same
ARTIFACTS(adb shell):
-----------------------------------------------------------------------
[email protected]:/system/app # ls -la | grep TetheringProvision
ls -la | grep TetheringProvision
-rw-r--r-- root root 475499 2014-07-19 02:26 TetheringProvision.apk
-rw-r--r-- root root 475499 2014-07-19 02:34 TetheringProvision.apk.bk20140719_myPatch1
-rw-r--r-- root root 432539 2014-07-19 01:50 TetheringProvision.apk.bk20140719_myPatch2
-rw-r--r-- root root 253215 2014-07-19 02:32 TetheringProvision.apk.bk20140719_stock_442
-rw-r--r-- root root 79528 2014-07-06 23:41 TetheringProvision.odex.bk20140719_stock_442
NOTES(artifact suffix):
-----------------------------------------------------------------------
* Original artifact backups suffixed with stock_442
* TetheringProvision.apk.bk20140719_myPatch1 - patched using VTS tool
* TetheringProvision.apk.bk20140719_myPatch2 - ALTERNATE PRE BUILT download
Why can't you just post the modified .apk for att and T-Mobile?
No modifications to my code without roper recognition
I'm normally a pretty easy going kind of guy, but sometimes I get a little testy when certain things happen, so I'm only going to say this once.
IF YOU USE MY WORK OR MODIFY IT IN ANY FASHION YOU MUST ASK MY PERMISSION FIRST, AND IN NO WAY OR FASHION ARE YOU ALLOWED TO REPOST YOUR MODIFICATIONS IN MY THREAD.
This includes creating patches for other systems, patches for same systems at request of other members etc.
If this happens again I will give proper warning and then I will close and delete the thread and that will be that.
This is an awesome community way beyond expectations however, I am a stickler for protocol, if you ask I'll will give permission 100% of the time as long as it is mine to give.
What is the vts tool? Thanks
Sent from my SM-G900T using XDA Free mobile app
xda23 said:
What is the vts tool? Thanks
Sent from my SM-G900T using XDA Free mobile app
Click to expand...
Click to collapse
Virtuous Ten Studio you can find it HERE
WhiteWidows said:
Why can't you just post the modified .apk for att and T-Mobile?
Click to expand...
Click to collapse
lol i learned how to build roms before decompiling apks as i find it easier.. i guess youre suppose to be smart enough to pull the apk, decompile the apk, edit the apk, recompile the apk and possibly sign it afterwards in order to use this MOD! Good Luck! Without a pre modded apk I will hafta wait until the weekend to ask for permission to include in my ATT ROM
Sent from my SM-G900V using XDA Premium HD app
elliwigy said:
lol i learned how to build roms before decompiling apks as i find it easier.. i guess youre suppose to be smart enough to pull the apk, decompile the apk, edit the apk, recompile the apk and possibly sign it afterwards in order to use this MOD! Good Luck! Without a pre modded apk I will hafta wait until the weekend to ask for permission to include in my ATT ROM
Sent from my SM-G900V using XDA Premium HD app
Click to expand...
Click to collapse
really? Seriously? This is probably one of the easiest mods EVER, and since this mod can be adopted accross carriers posting a "premodded apk" would be time consuming as i would have to have the specific apk from every carrier.
THIS IS a thread on HowTo not a thread on Here you go have it...
P.S. if your building a ROM to post in the forums might be a good idea not to ruffle the feathers of the DEVS whose work you want to include.
cstayton said:
really? Seriously? This is probably one of the easiest mods EVER, and since this mod can be adopted accross carriers posting a "premodded apk" would be time consuming as i would have to have the specific apk from every carrier.
THIS IS a thread on HowTo not a thread on Here you go have it...
P.S. if your building a ROM to post in the forums might be a good idea not to ruffle the feathers of the DEVS whose work you want to include.
Click to expand...
Click to collapse
I do not own an ATT s5.. I have a vzw s5.. searching online you can find similar MOD for tethering that has been around for some time with the same exact edits as your MOD. Either way I am sorry if I offended you. I just feel it would be easier for ATT owners to have a modded apk that they can use for their ATT roms considering this is the ATT thread.. What youre implying is no one can take your mod edit (most likely found from someone else) and make an apk for others to use who do not have the ability to do it themselves. Android is about being open source and sharing with the community not providing a mod that is easily found throughout these forums and saying no one else can use it or post an apk without your permission or knowledge of how to make the edits in the first place.
Again, i am glad for what you do but a mod that has been around for some time isnt something one can claim as theres just because theyre first to post in a certain thread.
And all i was saying is why not post a modded apk or let someone else just with the att apk for att users in this thread? Not to go and make one for every device.. but hey, i will not add your mod to any rom I work on.. I will find one of the other devs MOD and give them the cred.
edit: here is the same mod from over a year ago:
http://forum.xda-developers.com/showthread.php?t=2278259
Of course you used a different server address but the mod is the same. You only need to direct the mod to a server that enables the hotspot to be turned on.
Sent from my SM-G900V using XDA Premium HD app
elliwigy said:
I do not own an ATT s5.. I have a vzw s5.. searching online you can find similar MOD for tethering that has been around for some time with the same exact edits as your MOD. Either way I am sorry if I offended you. I just feel it would be easier for ATT owners to have a modded apk that they can use for their ATT roms considering this is the ATT thread.. What youre implying is no one can take your mod edit (most likely found from someone else) and make an apk for others to use who do not have the ability to do it themselves. Android is about being open source and sharing with the community not providing a mod that is easily found throughout these forums and saying no one else can use it or post an apk without your permission or knowledge of how to make the edits in the first place.
Again, i am glad for what you do but a mod that has been around for some time isnt something one can claim as theres just because theyre first to post in a certain thread.
And all i was saying is why not post a modded apk or let someone else just with the att apk for att users in this thread? Not to go and make one for every device.. but hey, i will not add your mod to any rom I work on.. I will find one of the other devs MOD and give them the cred.
edit: here is the same mod from over a year ago:
http://forum.xda-developers.com/showthread.php?t=2278259
Of course you used a different server address but the mod is the same. You only need to direct the mod to a server that enables the hotspot to be turned on.
Sent from my SM-G900V using XDA Premium HD app
Click to expand...
Click to collapse
read the OP, it says where the mod came from scrossler over in the LG forums,(which by the way is the original mod this is based on) the design of this mod is different than his and has more edits. so yes this is based on his mod but is my work. i highly doubt you found lots of mods with the exact same edits as the edits in my mod point to my specific servers and are handled differently than others.
I am not posting a modded apk nor will I this thread is a guide on how to do it yourself.
nuff said thread closed.
AND P.S. THIS MOD IS ONLY FOR AT&T AND TMOBILE, NOT FOR VERIZON.

[DEVS][Safestrap][How-To] Reboot To Safestrap Recovery Via Power Menu

So First; we must thank @Hashcode for hos wonderful Safestrap Recovery That allows us to flash custom ROMs even though we have a locked Bootloader
In this Guide I will show you how to edit your power menu to change the reboot recovery from going to the recovery partition to going to Safestrap
This is independent of the safestrap app, IF AND ONLY IF the safestrap image is on the phone already
This is only for devs who want to incorporate this into their rom and I will not be answering questions on how to do this as even a beginner dev can manage this
I only ask that credit be given to @Hashcode, @Goldie @RErick and AllianceROM and that the supplied script not be changed or modified in anyway,
This is being shared freeley and a little thanks goes a long way
First thing is first
You will need to Decompile android,policy,jar
Look for globalactions$99$1.smali
Inside this smali file you will need to find
.method public onClick(Landroid/content/DialogInterface;I)V
and then look for this set of lines its at the very top
Code:
const/4 v2, 0x1
const/4 v3, 0x0
sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I
const/4 v1, -0x1
if-le v0, v1, :cond_0
sget v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootMode:I
Directly underneath that last line above add these lines
Code:
const/4 v1, 0x3
if-eq v0, v1, :cond_4
Now, at the very bottom of the same method, directly above the line that says
Code:
goto :goto_1
You will add these lines
Code:
goto :goto_1
:cond_4
const-string v1, "su -c /system/bin/recrbt.sh"
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process;
Thats it for the jar file. Save and recompile and then I have attached a zip with the needed script inside that needs to be placed in
/system/bin and permissions set to 0755
Or if on a clean flash, dont worry about permissions.
:good:
RErick said:
So First; we must thank @Hashcode for hos wonderful Safestrap Recovery That allows us to flash custom ROMs even though we have a locked Bootloader
In this Guide I will show you how to edit your power menu to change the reboot recovery from going to the recovery partition to going to Safestrap
This is independent of the safestrap app, IF AND ONLY IF the safestrap image is on the phone already
This is only for devs who want to incorporate this into their rom and I will not be answering questions on how to do this as even a beginner dev can manage this
I only ask that credit be given to @Hashcode, @Goldie @RErick and AllianceROM and that the supplied script not be changed or modified in anyway,
This is being shared freeley and a little thanks goes a long way
First thing is first
You will need to Decompile android,policy,jar
Look for globalactions$99$1.smali
Inside this smali file you will need to find
.method public onClick(Landroid/content/DialogInterface;I)V
Thats it for the jar file. Save and recompile and then I have attached a zip with the needed script inside that needs to be placed in
/system/bin and permissions set to 0755
Or if on a clean flash, dont worry about permissions.
:good:
Click to expand...
Click to collapse
Ha, Freakin awesome you just made the day of nearly every dev here in the S5 forums. Great job and thank you very much.
Good job
@RErick
Great job Sir....this is what I called development.
☆ Swyped From SFour Flying Color CCC Theme ☆
Is there gonna be a zip to flash
Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
ozz200127 said:
Is there gonna be a zip to flash
Sent from my SAMSUNG-SGH-I337 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Doubtful, you need to ask your Rom dev to incorporate into their rom. With proper credit of course. [emoji5]
@bri315317 go to this thread and read post 2415 http://forum.xda-developers.com/showthread.php?t=2616221 make sure you have power menu options turned of in wanam and gravity box. It is for s4.
M&M AND Kitkat
parkerj7uc said:
@bri315317 go to this thread and read post 2415 http://forum.xda-developers.com/showthread.php?t=2616221 make sure you have power menu options turned of in wanam and gravity box. It is for s4.
M&M AND Kitkat
Click to expand...
Click to collapse
I believe you mistaken me for the other person, but that's OK. Thanks for supplying it to those that need it. [emoji482]
Edit: disregard. Took me 5-6 hours of hunting around to decide to look in ext.jar.

[GUIDE] UPDATED!!! [MOD] How to make Call Log Limit practically Unlimited

Well this Guide with all its spelling mistakes somehow made it to portal
Click to expand...
Click to collapse
For Developers: If you are planning to compile your ROM, and want to use this mod, then read This Post
Background Story:
I was missing the CyberShot Camera too much and found Google Camera has been ported to JB And I also wanted to try the Moded LifeLog app, which somehow was not working on my Pacman Rom.
These were the reasons I Decided to come back to JB Stock Base. I had a previous Nandroid Backup of Lovin's Z2 ROM for XV. I took all my Call-Log and SMS Backups and also took backup of some apps that I used. Then I restored the NAND Backup today.
after that I started restoring the apps+data. Everything was fine.
After few hours of using, As I always do, I took the periodic backup of my Call Logs again. That's when I noticed, the previous Logs were 700+ and now after making some calls, it came down to 500. after Some test, I found out, this is not problem of Backup software.
A little Google search revealed Android has a default call log limit set to 500 Calls.
I searched for Xposed Mod for this, found TrimNot. But it showed error. Most probably, it is only for KK. Then I thought why not MOD it myself?
That's how it all started...
The research & work procedure:
I first thought, OK, I need to find where the Calls are stored. After passing some time with Google, I found, the Logs are stored in a SQlite3 Database, in
Code:
/data/data/com.android.providers.contacts/databases/contacts2.db
There is no limit in this database storage. So, the limit must be in the code.
After another couple of hours, I found that Android checks if the contacts has reached 500 then removes the older. Searching with
Call Log Android
Click to expand...
Click to collapse
in android API reference, where I found some leads on my research.
"public class CallLog" which is under "android.provider.CallLog"
Something told me, to look for this class, in the actual source code. But that's almost 30 GB and I don't have time. from some prior Java knowledge I knew, all class have their own source file, with the same name, So the name would be "CallLog.java"
Now I searched Google, with it and found exactly what I was looking for. The search took me to a Git page android/platform_frameworks_base
And here I found this code.
Java:
private static void removeExpiredEntries(Context context) {
final ContentResolver resolver = context.getContentResolver();
resolver.delete(CONTENT_URI, "_id IN " +
"(SELECT _id FROM calls ORDER BY " + DEFAULT_SORT_ORDER
+ " LIMIT -1 OFFSET 500)", null);
}
The file is located in
Code:
platform_frameworks_base/core/java/android/provider/CallLog.java
and from the name I guessed, this should be inside framework files. Then I went into action. I first tried to de-compile the framework-res.apk file. I used Advanced APKTool by BDFreak
Using the windows search tool, I searched for "call log". I found nothing. Then I tried to de-compile "framework.jar". For this, I followed guide by Rizal Lovins - [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar
after the de-compiling was Done, I found there is a "android/provider" folder. Yes, it look similar to "platform_frameworks_base/core/java/android/provider/CallLog.java"
So, here should be the files. And I found Two files
Code:
CallLog$Calls.smali
CallLog.smali
I opened both with Notepad++,
CallLog.smali gave me noting.
But after a careful search, I found the exact query inside the ]CallLog$Calls.smali file.
I found this line -
Code:
const-string v2, "_id IN (SELECT _id FROM calls ORDER BY date DESC LIMIT -1 OFFSET 500)"
I just changed 500 to 100000 and I knew my task was done.
I then recompiled the framework.jar and took backup of my original framework.jar (took Nandroid backup ), replaced the original with my modified JAR file. Set the permission rw-r-r or 644. Then rebooted my phone.
Testing:
After the phone started, I made a call, then took backup of the Call Log with Call Log Backup Restore it showed 501.
This means my task is done.
Then I thought, why not share the whole experience today in XDA. So I started Writing this Guide.
F.A.Q.
Why I need more than 500 Call Log ?
- Well I work in Billing Department of a GSM Phone Exchange/Gateway. I periodically cross check my phone Call Logs with the Exchange SoftSwitch Data. Except for that, It's just fun to try something new.
Why this guide has no steps or required steps?
- Because, if anything I missed, those will be added later in the FAQ, from the comments.
Is this tested on any device?
-Yes,
My # Xperia V with LOVINS X™ Z2 ROM 9.2.A.2.5
# Xperia V NeoWave™ ROM
# Xperia TX OmniRom
# Xperia TX (unknown ROM )
# Xperia Z2 (unknown ROM )
# Xperia P Stock ROM
#Xperia P JB based Enigma v7.2 ROM
#CyanogenMod 11 M11 and M12
Can this work on my T/TX/TL/Z/Z1 etc. etc.
- Theoretically it should work on any Device and any ROM. But, practically, I don't know, why don't you try yourself and let me know
I'm newbie, can you provide me more simple guide?
- Well I'm a Newbie myself Just take a Nandroid Backup and start the process. What can go wrong? At most you'll have to restore the backup.
Go to every link and read those too. And Don't forget to Thank those people who provided the Tools and Guides.
Still If you don't understand my guide, read it twice, if it doesn't work read again.
Ha Ha Ha kidding. Here you go A Simple guide
Update:
If you are planning to compile your ROM, and want to use this mod, then read This Post
I switched to NeoWave™ ROM and just as usual applied my MOD. Restored 800+ Call Log from Backup. Now I find another limitation. It's in the Dialer. In the KitKat Call History, there is a Statistics option. Here it always shows
TOTAL: 500 Calls,....
Click to expand...
Click to collapse
So Now I'm digging the sources again to make the stats go higher.
Update: The issue was caused because, after sometimes (any call), the call history automatically turned to 500. Because the framework.jar was odexed and i guess, odex file had the old value set again. And for the NeoWave I used android MultiTool, it showed one error while compiling, Unsigned Short value exceeds, I didn't notice that. My bad. Now I have done the Mod again with Apktool (Lovins shared one) and removed the odex file and then Everything seems fine. Even the Statistics Shows, TOATAL: 1203 Calls, ....
Tested on OmniRom and works as expected. I've used an Xposed module before which does the same thing, but it's always nice to find new ways to implement things without having to use Xposed.
Antiga Prime said:
Tested on OmniRom and works as expected. I've used an Xposed module before which does the same thing, but it's always nice to find new ways to implement things without having to use Xposed.
Click to expand...
Click to collapse
Thanks for the Confirmation. I am updating the Tested Device & ROM. Your device is TX, Right? I guessed from the signeture
Antiga Prime said:
Tested on OmniRom and works as expected. I've used an Xposed module before which does the same thing, but it's always nice to find new ways to implement things without having to use Xposed.
Click to expand...
Click to collapse
Would you like to share the Xposed module you used before?
pollob666 said:
Thanks for the Confirmation. I am updating the Tasted Device & ROM. Your device is TX, Right? I guessed from the signeture
Click to expand...
Click to collapse
Yes, I have a TX.
tianzhisun said:
Would you like to share the Xposed module you used before?
Click to expand...
Click to collapse
It's the same one linked in the OP, except it's named TrimNot, not TimNot. I thought it might be a different one given that the one linked above didn't work for @pollob666, but I guess it's because I'm on a 4.4 ROM.
It's the same one linked in the OP, except it's named TrimNot, not TimNot. I thought it might be a different one given that the one linked above didn't work for @pollob666, but I guess it's because I'm on a 4.4 ROM.
Click to expand...
Click to collapse
Oops.. It was a Typo Yes, TrimNot works on KK but not on JB. that is why I needed to modify my Android Framework.
This is great and I will try it out.
But there is also another ridiculous limitation, that is the maximum of 20 alarms you can have in the clock
acb123 said:
This is great and I will try it out.
But there is also another ridiculous limitation, that is the maximum of 20 alarms you can have in the clock
Click to expand...
Click to collapse
for the clock there is this guide http://forum.xda-developers.com/showpost.php?p=53591001&postcount=6 give it a look
acb123 said:
This is great and I will try it out.
Click to expand...
Click to collapse
After trying, give us the update.
But there is also another ridiculous limitation, that is the maximum of 20 alarms you can have in the clock
Click to expand...
Click to collapse
I didn't notice that. Let's see what we can do about that
pollob666 said:
I didn't notice that. Let's see what we can do about that
Click to expand...
Click to collapse
give a look at the link in the post above yours... it's for z2 but it could work also for other version
Works fine on Xperia P running JB based Enigma v7.2
It works on stock based Xperia P. pollob666 small typo. How about renaming "tasted" to "tested"
usb2 said:
give a look at the link in the post above yours... it's for z2 but it could work also for other version
Click to expand...
Click to collapse
Yeah, saw that, going to try it tomorrow. Hopefully, here I can find some DB sources too.
prasadkumar013 said:
It works on stock based Xperia P. pollob666 small typo. How about renaming "tasted" to "tested"
Click to expand...
Click to collapse
Sorry about that, I guess I'll have to check the whole OP
Please make the steps simple for a newbie
Well, I was looking for this feature since Google invented Android!:good:
I was using MIUI because of they're giving unlimited Call log. Then some one invented TrimNot on Aug 15, 201, I came again to OzcanRom (My Fav). Trim not doesn't work at all.
My question is, Can you make this step more simple. I'm a new bie. :fingers-crossed:
pollob666 said:
Background Story:
I was missing the CyberShot Camera too much and found Google Camera has been ported to JB And I also wanted to try the Moded LifeLog app, which somehow was not working on my Pacman Rom.
These were the reasons I Decided to come back to JB Stock Base. I had a previous Nandroid Backup of Lovin's Z2 ROM for XV. I took all my Call-Log and SMS Backups and also took backup of some apps that I used. Then I restored the NAND Backup today.
after that I started restoring the apps+data. Everything was fine.
After few hours of using, As I always do, I took the periodic backup of my Call Logs again. That's when I noticed, the previous Logs were 700+ and now after making some calls, it came down to 500. after Some test, I found out, this is not problem of Backup software.
A little Google search revealed Android has a default call log limit set to 500 Calls.
I searched for Xposed Mod for this, found TrimNot. But it showed error. Most probably, it is only for KK. Then I thought why not MOD it myself?
That's how it all started...
The research :
I first thought, OK, I need to find where the Calls are stored. After passing some time with Google, I found, the Logs are stored in a SQlite3 Database, in
Code:
/data/data/com.android.providers.contacts/databases/contacts2.db
There is no limit in this database storage. So, the limit must be in the code.
After another couple of hours, I found that Android checks if the contacts has reached 500 then removes the older. Searching with
in android API reference, where I found some leads on my research.
"public class CallLog" which is under "android.provider.CallLog"
Something told me, to look for this class, in the actual source code. But that's almost 30 GB and I don't have time. from some prior Java knowledge I knew, all class have their own source file, with the same name, So the name would be "CallLog.java"
Now I searched Google, with it and found exactly what I was looking for. The search took me to a Git page android/platform_frameworks_base
And here I found this code.
Java:
private static void removeExpiredEntries(Context context) {
final ContentResolver resolver = context.getContentResolver();
resolver.delete(CONTENT_URI, "_id IN " +
"(SELECT _id FROM calls ORDER BY " + DEFAULT_SORT_ORDER
+ " LIMIT -1 OFFSET 500)", null);
}
The file is located in
Code:
platform_frameworks_base/core/java/android/provider/CallLog.java
and from the name I guessed, this should be inside framework files. Then I went into action. I first tried to de-compile the framework-res.apk file. I used Advanced APKTool by BDFreak
Using the windows search tool, I searched for "call log". I found nothing. Then I tried to de-compile "framework.jar". For this, I followed guide by Rizal Lovins - [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar
after the de-compiling was Done, I found there is a "android/provider" folder. Yes, it look similar to "platform_frameworks_base/core/java/android/provider/CallLog.java"
So, here should be the files. And I found Two files
Code:
CallLog$Calls.smali
CallLog.smali
I opened both with Notepad++,
CallLog.smali gave me noting.
But after a careful search, I found the exact query inside the ]CallLog$Calls.smali file.
I found this line -
Code:
const-string v2, "_id IN (SELECT _id FROM calls ORDER BY date DESC LIMIT -1 OFFSET 500)"
I just changed 500 to 100000 and I knew my task was done.
I then recompiled the framework.jar and took backup of my original framework.jar (took Nandroid backup ), replaced the original with my modified JAR file. Set the permission rw-r-r or 644. Then rebooted my phone.
Testing:
After the phone started, I made a call, then took backup of the Call Log with Call Log Backup Restore it showed 501.
This means my task is done.
Then I thought, why not share the whole experience today in XDA. So I started Writing this Guide.
F.A.Q.
Why I need more than 500 Call Log ?
- Well I work in Billing Department of a GSM Phone Exchange/Gateway. I periodically cross check my phone Call Logs with the Exchange SoftSwitch Data. Except for that, It's just fun to try something new.
Why this guide has no steps or required steps?
- Because, if anything I missed, those will be added later in the FAQ, from the comments.
Is this tested on any device?
-Yes,
My # Xperia V with LOVINS X™ Z2 ROM 9.2.A.2.5
# Xperia TX OmniRom
# Xperia TX (unknown ROM )
# Xperia Z2 (unknown ROM )
# Xperia P Stock ROM
Can this work on my T/TX/TL/Z/Z1 etc. etc.
- Theoretically it should work on any Device and any ROM. But, practically, I don't know, why don't you try yourself and let me know
Click to expand...
Click to collapse
---------- Post added at 11:08 AM ---------- Previous post was at 10:10 AM ----------
Can you please share the framework.jar file that edited and recompiled by you? If you can make a edited framework.jar for OzcanRom 4.2, I will be very thankful. I spent almost two nights on this and failed. Please help. :silly::fingers-crossed:
Antiga Prime said:
Tested on OmniRom and works as expected. I've used an Xposed module before which does the same thing, but
it's always nice to find new ways to implement things without having to use Xposed.
Click to expand...
Click to collapse
A Simpler guide
jamoen said:
My question is, Can you make this step more simple. I'm a new bie. :fingers-crossed:
Can you please share the framework.jar file that edited and recompiled by you? If you can make a edited framework.jar for OzcanRom 4.2, I will be very thankful. I spent almost two nights on this and failed. Please help. :silly::fingers-crossed:
Click to expand...
Click to collapse
No need to Quote the whole OP
My framework.jar won't work for you. We need to modify your ROM's framework.jar if you can provide me that file, I can MOD it for you.
But, I am giving the Simple steps. I would be very happy if you can do it yourself.
I am assuming you already have Notepad++ or Similar text editing tool and know how to pull files from /system
Step 1: Download APKTool of your choice. I used Advanced APKTool by BDFreak
Step 2: Decompile your framework.jar. For this, I followed guide by Rizal Lovins - [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar
Step 3: Open the CallLog.smali file and any other files that starts with CallLog ( like in my case CallLog$Calls.smali ) in Notepad++ or any other Text Editor.
Step 4: search for "SELECT _id FROM calls ORDER BY" or similar lines. You will find LIMIT -1 OFFSET 500 change 500 with any number you want.
Step 5: Save the modified file smali, and recompile the jar file.
Step 6: Just to be safe, take a NANDROID backup.
Step 7: Take a backup of the original framework.jar, delete it from system and push the modified framework.jar to System and change permission to rw-r-r or 644. Reboot.
Step 8: test
I couldn't find Provider folder. Please help.
I couldn't find Provider folder. Please help.
Failed! Please help
pollob666 said:
No need to Quote the whole OP
Click to expand...
Click to collapse
Thank you for the reply.
I could not find any folder called Provider. Searched all folders and failed to find a call entry.
I took the framework.jar from system folder. Any wrong?
Attached my framework.jar file. Please help me.
Found the string in framework2.jar and edited. Success!!
Please help me to push it again...
Can I use esfile explorer?
---------- Post added at 02:31 PM ---------- Previous post was at 02:09 PM ----------
jamoen said:
Found the string in framework2.jar and edited. Success!!
Please help me to push it again...
Can I use esfile explorer?
Click to expand...
Click to collapse
Unfortunately.. The method failed. Going back to MIUI in tears..
jamoen said:
Found the string in framework2.jar and edited. Success!!
Please help me to push it again...
Can I use esfile explorer?
---------- Post added at 02:31 PM ---------- Previous post was at 02:09 PM ----------
Unfortunately.. The method failed. Going back to MIUI in tears..
Click to expand...
Click to collapse
WOW, you really did it. Sorry I was in training my juniors at office, didn't reply earlier.
You can use es explorer, or if you have adb, then you can use some shell commands. I can give you the commands, if you haven't done it already.
It should work. Let me check and mod a it for you.
Edit: Sorry, I don't have the framework2.jar. ant the ROM is too big for downloading now at office. But for Samsung device, I guess the re-compile process needs a bit working. you need to recompile the file, then open it in 7zip or WinRAR replace the AndroidManifest file with the file of the original, (then sign it then zipalign it not sure for jar file though). Then push it to the system.
pollob666 said:
WOW, you really did it. Sorry I was in training my juniors at office, didn't reply earlier.
You can use es explorer, or if you have adb, then you can use some shell commands. I can give you the commands, if you haven't done it already.
It should work. Let me check and mod a it for you.
Edit: Sorry, I don't have the framework2.jar. ant the ROM is too big for downloading now at office. But for Samsung device, I guess the re-compile process needs a bit working. you need to recompile the file, then open it in 7zip or WinRAR replace the AndroidManifest file with the file of the original, (then sign it then zipalign it not sure for jar file though). Then push it to the system.
Click to expand...
Click to collapse
I double checked it. Again extracted the framework.jar and decompliled it.The string of 100000 is there. But this thing is not working. I don't know why.
Can I share you the framework2.jar with you?
jamoen said:
I double checked it. Again extracted the framework.jar and decompliled it.The string of 100000 is there. But this thing is not working. I don't know why.
Can I share you the framework2.jar with you?
Click to expand...
Click to collapse
I will modify it and upload it for you. But I guess I will need the framework-res.apk with it. if there is any. But, I'm going home now, I'll update you by 11pm.

Categories

Resources