Hi,
I'm trying to get the caller ID issue resolved on my i9502, as described in this thread:
http://forum.xda-developers.com/showthread.php?t=2268120
My i9502 has been flashed with this ROM:
http://pan.baidu.com/share/link?shareid=2302611&uk=3760742413
Everything is working fine with this ROM, except that CallerID doesn't correctly lookup contacts. It tries to find a contact name based on 11 matching digits.
When i try to follow the steps, as described in the thread above, to change the MIN_MATCH value
Check for and fix MIN_MATCH constant in telephony framework
1) Decompile framework.jar
2) Open smali/android/telephony/PhoneNumberUtils.smali
3) Search for MIN_MATCH constant and set it to 0x7
When running baksmali command i get the following errors:
C:\apktool\system\framework>java -jar baksmali.jar -x framework.odex
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int
erface Landroid/widget/AdapterView$OnItemClickListener;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte
rfaces(ClassPath.java:867)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
692)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:282
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(Cla
ssPath.java:110)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:104)
at org.jf.baksmali.main.main(main.java:297)
Error while loading class Landroid/accounts/ChooseAccountActivity$1; from file f
ramework.odex
Error while loading ClassPath class Landroid/accounts/ChooseAccountActivity$1;
And when running baksmali command against the framework.jar file:
C:\apktool\system\framework>java -jar baksmali.jar -x framework.jar
UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.DexFile$NoClassesDexException: zip file framework.jar does not con
tain a classes.dex file
at org.jf.dexlib.DexFile.<init>(DexFile.java:298)
at org.jf.baksmali.main.main(main.java:269)
Anyone managed to deodex framework.jar of this ROM, and change the "smali/android/telephony/PhoneNumberUtils.smali" file to fix caller ID issue?
Did backsmali!
Hello,
I managed to backsmali framework.jar, what I did follows:
* Downloaded Backsmali-Manager_v1.5: http://forum.xda-developers.com/showthread.php?t=2311766
* Copied Phone's /system/framework folder to backsmali-manager folder.
* Run: java -jar tools\baksmali.jar -x -d framework put-file-here\framework.odex -o project\framework-jar
And that did the trick, but I think we need to follow the instructions from here: http://forum.xda-developers.com/showthread.php?t=1756953
luizfeliperj said:
Hello,
I managed to backsmali framework.jar, what I did follows:
* Downloaded Backsmali-Manager_v1.5: http://forum.xda-developers.com/showthread.php?t=2311766
* Copied Phone's /system/framework folder to backsmali-manager folder.
* Run: java -jar tools\baksmali.jar -x -d framework put-file-here\framework.odex -o project\framework-jar
And that did the trick, but I think we need to follow the instructions from here: http://forum.xda-developers.com/showthread.php?t=1756953
Click to expand...
Click to collapse
Hi,
Getting closer, but my phone was hanging after i put back the re-compiled framework.odex file.
I did the following:
1) de-compiled framework.odex:
C:\Baksmali-Manager_v1.5\system>java -jar ..\tools\baksmali.jar -x -d framework ..\put-file-here\framework.odex -o project\framework-jar
2) Edited the file: "smali/android/telephony/PhoneNumberUtils.smali ":
.field static final MIN_MATCH:I = 0x7
.field static final MIN_MATCH_CHINA:I = 0x7
.field static final MIN_MATCH_HK:I = 0x7
.field static final MIN_MATCH_TW:I = 0x7
3) Re-compiled again:
C:\Baksmali-Manager_v1.5\system>java -Xmx512M -jar ..\tools\smali.jar .\project\framework-jar -o new-framework.odex
4) re-named the file to "framework.odex"
And then put it back on my phone. I noticed that the re-compiled file is 6.98Mb vs. 7.41Mb the original framework.odex file.
Tried it anyway, but my phone was hanging at the Samsung logo on re-boot.
5) Re-flashed my phone with the rooted ROM. Now it starts up fine again
Did i miss something when de-compiling & compiling?
A look into the code
jompie said:
Hi,
3) Re-compiled again:
C:\Baksmali-Manager_v1.5\system>java -Xmx512M -jar ..\tools\smali.jar .\project\framework-jar -o new-framework.odex
4) re-named the file to "framework.odex"
And then put it back on my phone. I noticed that the re-compiled file is 6.98Mb vs. 7.41Mb the original framework.odex file.
Tried it anyway, but my phone was hanging at the Samsung logo on re-boot.
Did i miss something when de-compiling & compiling?
Click to expand...
Click to collapse
What you get back from smali is a regular jar, not an odexed one. When you run backsmali with '-x' argument, you tell backsmali to deodex the source file. So, Maybe, that was the problem.
But there are other points in the code we should pay attention. For your need, I don't think that you need to change anything in the original framework. You need that the MIN_MATCH variable set to 0x7. As far as I could understand from the smali code, if you change the sales code, you can accomplish that. And, as far as I know, sales code is a configuration directive, from one or more of the many xmls available in the /system directory.
I will substantiate what I said this some code snippets.
The MIN_MATCH* variables are defined as:
.field static final MIN_MATCH:I = 0x7
.field static final MIN_MATCH_CHINA:I = 0xb
.field static final MIN_MATCH_HK:I = 0x8
.field static final MIN_MATCH_TW:I = 0x9
In CompareLoosely method, there is a check for the sales_code "CHN" "CHU" "CHM" "CTC" "CHC"
.method public static compareLoosely(Ljava/lang/String;Ljava/lang/StringZ
(...)
const-string v11, "ro.csc.sales_code"
(...)
.local v9, "salesCode":Ljava/lang/String;
const-string v11, "CHN"
(...)
const-string v11, "CHU"
(...)
const-string v11, "CHM"
(...)
const-string v11, "CTC"
(...)
const-string v11, "CHC"
So, here is what I think. If CSC is defined as CHN (the default for this firmware), the MIN_MATCH_CHINA (0xb (11)) will be used, and that is really what is happening.
So we need test those others sales codes to check which one trigger which MIN_MATCH* variable. My guest is if you select any CSC not listed in the above list, the default case of 0x7 will be used. To change the CSC (I mean change the 'ro.csc.sales_code' property), we can use the method described by: http://www.geekzone.co.nz/forums.asp?forumid=97&topicid=109787.
UPDATE:
I misunderstood the smali code, the corresponding java code from the smali code follows:
String s2 = SystemProperties.get("ro.csc.sales_code");
if (!"CHN".equals(s2) && !"CHU".equals(s2) && !"CHM".equals(s2) && !"CTC".equals(s2) && !"CHC".equals(s2))
{
if (!"FET".equals(s2) && !"TWM".equals(s2) && !"CWT".equals(s2) && !"BRI".equals(s2))
{
if ("TGY".equals(s2))
{
So, if your sales code is not listed in any of the if's, you will use the the getMinMatch method, the corresponding java code follows.
public static int getMinMatch()
{
if (CscFeature.getInstance().getInteger("CscFeature_RIL_CallerIdMatchingDigit") == -1)
return 7;
else
return CscFeature.getInstance().getInteger("CscFeature_RIL_CallerIdMatchingDigit");
}
This CscFeature_RIL_CallerIdMatchingDigit is know and is located in the /system/csc/others.xml. What we need is a way to change the sales_code. I suppose that, if we change the /system/csc/sales_code.dat with any other unlisted code, like XEU, we would be fine.
UPDATE 2:
Changing the sales_code.dat did the trick, but now I have problems in dialer, I can't dial anyone, there is no button to press, they dissapeared.
Here what I did.
Edited the sales_code.dat, now it is XEU.
Reboot
Opened Config->Manage Apps->Contacts Stores->Cleaned everything (this will wipe all your contacts, back it up)
Reboot
Resynced my contacts with google, All my sms senders are now recognized!!! But I can't dial anyone...
UPDATE 3:
Modified the the smali code, recompiled, odexed using these instructions: http://forum.xda-developers.com/showthread.php?t=1208320
Result, no luck, will try again later.
UPDATE 4:
Did it!!! Works for me!
* Updated framework.odex [ Attached to this post ]
* Opened Config->Manage Apps->Contacts Store->Cleaned everything (this will wipe all your contacts, back it up)
* Reboot
Senders are now recognized !!
UPDATE 5:
To use this patched framework.odex you need to:
* Change the /system/framework/framework.odex with the one provided in the zip file
* Change the <CscFeature_RIL_CallerIdMatchingDigit> parameter inside the /system/csc/others.xml, remove the default value (11) and insert the desired one(ex. 8).
* Clean Contacts Store by opening Config->Manage Apps->Contacts Store and press the buttons destinated to clean everything.
* Reboot
* Resync contacts or restore Contacts from TitaniumBackup.
PS: There is no need to change sales_code.dat file, keep it intact.
SMS senders should now be recognized.
luizfeliperj said:
What you get back from smali is a regular jar, not an odexed one. When you run backsmali with '-x' argument, you tell backsmali to deodex the source file. So, Maybe, that was the problem.
UPDATE 4:
Did it!!! Works for me!
* Updated framework.odex [ Attached to this post ]
* Opened Config->Manage Apps->Contacts Stores->Cleaned everything (this will wipe all your contacts, back it up)
* Reboot
Senders are now recognized !!
Click to expand...
Click to collapse
anyone tried this? does it work?
luizfeliperj said:
What you get back from smali is a regular jar, not an odexed one. When you run backsmali with '-x' argument, you tell backsmali to deodex the source file. So, Maybe, that was the problem.
But there are other points in the code we should pay attention. For your need, I don't think that you need to change anything in the original framework. You need that the MIN_MATCH variable set to 0x7. As far as I could understand from the smali code, if you change the sales code, you can accomplish that. And, as far as I know, sales code is a configuration directive, from one or more of the many xmls available in the /system directory.
I will substantiate what I said this some code snippets.
The MIN_MATCH* variables are defined as:
.field static final MIN_MATCH:I = 0x7
.field static final MIN_MATCH_CHINA:I = 0xb
.field static final MIN_MATCH_HK:I = 0x8
.field static final MIN_MATCH_TW:I = 0x9
In CompareLoosely method, there is a check for the sales_code "CHN" "CHU" "CHM" "CTC" "CHC"
.method public static compareLoosely(Ljava/lang/String;Ljava/lang/StringZ
(...)
const-string v11, "ro.csc.sales_code"
(...)
.local v9, "salesCode":Ljava/lang/String;
const-string v11, "CHN"
(...)
const-string v11, "CHU"
(...)
const-string v11, "CHM"
(...)
const-string v11, "CTC"
(...)
const-string v11, "CHC"
So, here is what I think. If CSC is defined as CHN (the default for this firmware), the MIN_MATCH_CHINA (0xb (11)) will be used, and that is really what is happening.
So we need test those others sales codes to check which one trigger which MIN_MATCH* variable. My guest is if you select any CSC not listed in the above list, the default case of 0x7 will be used.
UPDATE:
I misunderstood the smali code, the corresponding java code from the smali code follows:
String s2 = SystemProperties.get("ro.csc.sales_code");
if (!"CHN".equals(s2) && !"CHU".equals(s2) && !"CHM".equals(s2) && !"CTC".equals(s2) && !"CHC".equals(s2))
{
if (!"FET".equals(s2) && !"TWM".equals(s2) && !"CWT".equals(s2) && !"BRI".equals(s2))
{
if ("TGY".equals(s2))
{
So, if your sales code is not listed in any of the if's, you will use the the getMinMatch method, the corresponding java code follows.
public static int getMinMatch()
{
if (CscFeature.getInstance().getInteger("CscFeature_RIL_CallerIdMatchingDigit") == -1)
return 7;
else
return CscFeature.getInstance().getInteger("CscFeature_RIL_CallerIdMatchingDigit");
}
This CscFeature_RIL_CallerIdMatchingDigit is know and is located in the /system/csc/others.xml. What we need is a way to change the sales_code. I suppose that, if we change the /system/csc/sales_code.dat with any other unlisted code, like XEU, we would be fine.
UPDATE 2:
Changing the sales_code.dat did the trick, but now I have problems in dialer, I can't dial anyone, there is no button to press, they dissapeared.
Here what I did.
Edited the sales_code.dat, now it is XEU.
Reboot
Opened Config->Manage Apps->Contacts Stores->Cleaned everything (this will wipe all your contacts, back it up)
Reboot
Resynced my contacts with google, All my sms senders are now recognized!!! But I can't dial anyone...
UPDATE 3:
Modified the the smali code, recompiled, odexed using this instructions: http://forum.xda-developers.com/showthread.php?t=1208320
Result, no luck, will try again later.
UPDATE 4:
Did it!!! Works for me!
* Updated framework.odex [ Attached to this post ]
* Opened Config->Manage Apps->Contacts Stores->Cleaned everything (this will wipe all your contacts, back it up)
* Reboot
Senders are now recognized !!
Click to expand...
Click to collapse
Thanks a lot for your work!!
I followed your steps, now it's working, i can now see who calls me. And also SMS still shows the right contact.
BTW, i didn't change sales_code.dat and even then it works. My region code should be SEA, but apparently it doesn't matter.
Now i can remove the Prefixer & Touchpal apps, that i used as a workaround.
Thanks again!
You are right, there is only framework.jar and framework2.jar, so i guess it wont work. but i have a hard time downloading the rooted chinese rom so i can try it, after downloading around 400+mb it stops as if finished and the speed starts very fast then slows down, would really appreaciate it if somebody could help...thank you...[/QUOTE]
If you use linux, you can use wget -c to continue the download from where it stopped. I had the very dame problem when the downloaded file hit 98%. I use wget to complete it
luizfeliperj said:
jimmyl19 said:
If you use linux, you can use wget -c to continue the download from where it stopped. I had the very dame problem when the downloaded file hit 98%. I use wget to complete it
Click to expand...
Click to collapse
i use a pc win7, any remedy? thanks...
PS. found a solution, i think, downloading now using a download manager, speed is to the max... thanks
Click to expand...
Click to collapse
Installing the chinese ROM
jimmyl19 said:
Hi, how did you install the chinese rom? do i have to flash samsung official firmware first? .. thanks...
Click to expand...
Click to collapse
I had CWM recovery, it was not an option to loose it. So here is what I did.
* Did a factory reset and a /system wipe using CWM.
* Got the chinese ROM tar file, extracted it, removed the recovery.img (rm recovery.img), repacked the tar file ( tar -cf fw.rar boot.img system.img csc.img sboot.bin... all the remaining files)
* Flashed the modified tar (fw.tar) using ODIN
With it, I had the chinese ROM installed and did not lose the CWM recovery.
Using Linux or OSX it is pretty straightforward, for windows, you need to download tar for windows, google for tar win32. It should point you to gnu tar project website. There they have a port of tar to the win32 OS.
luizfeliperj said:
I had CWM recovery, it was not an option to loose it. So here is what I did.
* Did a factory reset and a /system wipe using CWM.
* Got the chinese ROM tar file, extracted it, removed the recovery.img (rm recovery.img), repacked the tar file ( tar -cf fw.rar boot.img system.img csc.img sboot.bin... all the remaining files)
* Flashed the modified tar (fw.tar) using ODIN
With it, I had the chinese ROM installed and did not lose the CWM recovery.
Using Linux or OSX it is pretty straightforward, for windows, you need to download tar for windows, google for tar win32. It should point you to gnu tar project website. There they have a port of tar to the win32 OS.
Click to expand...
Click to collapse
Hi, your method is a little complicated. Can i just flash the chinese rom tar file using odin then flash CWM (w/c one do you use philz or cofface v3.0?) again using odin? thanks...
jimmyl19 said:
Hi, your method is a little complicated. Can i just flash the chinese rom tar file using odin then flash CWM (w/c one do you use philz or cofface v3.0?) again using odin? thanks...
Click to expand...
Click to collapse
For sure! You method is simpler. It's because I try to keep my flashing count at minimum, and reflashing the recovery is always scary. For recovery, I use philz, because of its exfat support.
luizfeliperj said:
For sure! You method is simpler. It's because I try to keep my flashing count at minimum, and reflashing the recovery is always scary. For recovery, I use philz, because of its exfat support.
Click to expand...
Click to collapse
Hi, finished flashing chinese rom, cleared cache, partition, reset. then install CWM cofface, then put the framework.odex in system/framework,and replace file, phone restart then change permission to rw,r,r. then sync google contact, call my phone from a 7 digit number, still does not match with caller id, so change 11 digit matching to 7 in csc/others.xml, clear data in contact storage, resync google contact, still not showing name of contact. Did i miss or done something wrong? thanks...
Hi, sorry... its working already. Thank you for the help, much appreciate it!!:good:
jimmyl19 said:
luizfeliperj said:
i use a pc win7, any remedy? thanks...
PS. found a solution, i think, downloading now using a download manager, speed is to the max... thanks
Click to expand...
Click to collapse
Uploaded the ROM here, if still needed:
http://www.fileconvoy.com/dfl.php?id=g3ac935230235665599932394609c1e80292419119
Click to expand...
Click to collapse
jompie said:
jimmyl19 said:
Uploaded the ROM here, if still needed:
http://www.fileconvoy.com/dfl.php?id=g3ac935230235665599932394609c1e80292419119
Click to expand...
Click to collapse
Hi Jompie, thank you very much for the upload. i also fixed mine already, caller id matching now working, thank you also for this fix, you started it.:good:
Click to expand...
Click to collapse
jompie said:
jimmyl19 said:
Uploaded the ROM here, if still needed:
http://www.fileconvoy.com/dfl.php?id=g3ac935230235665599932394609c1e80292419119
Click to expand...
Click to collapse
SO this Rom is caller ID fixed? or is it able to be fixed?
i downloaded the latest "rooted" chinese rom: I9502ZNUAME4_Rooted_JUFENG_4
is this the same? is there a simple way to fix the Caller ID problem?
Click to expand...
Click to collapse
jompie said:
Thanks a lot for your work!!
I followed your steps, now it's working, i can now see who calls me. And also SMS still shows the right contact.
BTW, i didn't change sales_code.dat and even then it works. My region code should be SEA, but apparently it doesn't matter.
Now i can remove the Prefixer & Touchpal apps, that i used as a workaround.
Thanks again!
Click to expand...
Click to collapse
"Opened Config->Manage Apps->Contacts Stores->Cleaned everything (this will wipe all your contacts, back it up)"
where do i find this? sorry for the dumb question but i cant really find "config" thanks!
Update:
found it. thanks anyway!
ronnylaborada said:
"Opened Config->Manage Apps->Contacts Stores->Cleaned everything (this will wipe all your contacts, back it up)"
where do i find this? sorry for the dumb question but i cant really find "config" thanks!
Update:
found it. thanks anyway!
Click to expand...
Click to collapse
late reply (better than never)
just go to settings> more> application manager> ALL
PS: it looks like you already got it. but hey it might help someone else...
omid_freesky said:
late reply (better than never)
just go to settings> more> application manager> ALL
PS: it looks like you already got it. but hey it might help someone else...
Click to expand...
Click to collapse
Hi, updated the ROM to MG2 at pan.baidu.com/share/link?shareid=3761575987&uk=3509615084
however seems like this caller id modification doesn't work anymore...
@jompie @luizfeliperj Thank you very much! Worked like a charm!
*Update: Celebrated too early. Phone is now stuck on Samsung logo. I'm on stock I9502ZNUCMF2 firmware. Is this the reason why it didn't work?
bryan_mmx said:
@jompie @luizfeliperj Thank you very much! Worked like a charm!
*Update: Celebrated too early. Phone is now stuck on Samsung logo. I'm on stock I9502ZNUCMF2 firmware. Is this the reason why it didn't work?
Click to expand...
Click to collapse
Was made for this rom: I9502ZNUAME4_Rooted_JUFENG.rar
Download from:
http://pan.baidu.com/share/link?shareid=2302611&uk=3760742413#dir/path=/rom/飓风行动/三星/I9502联通版
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.....
For the first time, I today attempted to extract a rom.zip from a shipped rom release (.exe) on Linux.
The process is problematic as, after launching the executable using wine, the application crashes, deleting all its files. You therefore have to be *very* quick looking inside the ~/.wine/users/username/Temp folder for the rom.zip.
Anyway, I have knocked up a quick python script that will monitor this directory for rom.zip and copy it to your home folder.
The only modification you need to make before running is to change the username field to your own username. I would have used getpass to obtain this but, for some reason, on certain systems you need to use sudo which messes this up.
Usage:
1.) Change username in script
2.) Run script
3.) Run RUU_xxxxxx.exe
4.) Get rom.zip from home folder
Anyway, I hope this is helpful and look forward to hearing feedback.
Best,
Martin
Code:
#!/usr/bin/python
'''
ROM Extractor Copyright (c) 2010 Martin Paul Eve
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
import os
import pyinotify
import io
# USERNAME IS REQUIRED (you may have to run as root using sudo)
username = "martin"
# Modify these if using a different wine location or rom name; HTC seem to use rom.zip
filename = "rom.zip"
monitor_path = "~/.wine/drive_c/users/%s/Temp/" % username
wm = pyinotify.WatchManager()
mask = pyinotify.IN_CREATE | pyinotify.IN_MODIFY | pyinotify.IN_DELETE | pyinotify.IN_MOVED_TO
bd = None
class RExtract(pyinotify.ProcessEvent):
def process_IN_MOVED_TO(self, event):
# this seems to be the event fired; IN_CREATE is included just in case, though
if event.name.endswith(filename):
print "Found ROM. Awaiting completion of modification."
self.f = open(os.path.join(event.path, event.name), "r")
self.bd = self.f.read()
def process_IN_CREATE(self, event):
if event.name.endswith(filename):
print "Found ROM. Awaiting completion of modification."
self.f = open(os.path.join(event.path, event.name), "r")
def process_IN_MODIFY(self, event):
# on modify, append to the file
if event.name.endswith(filename):
if hasattr(self, "bd"):
self.bd = self.bd + self.f.read()
else:
self.bd = self.f.read()
def process_IN_DELETE(self, event):
if event.name.endswith(filename):
self.f.close()
self.f = open(os.path.join("/home/%s/" % username, "rom.zip"), "w")
self.f.write(self.bd)
self.f.close()
print "ROM Copied to /home/%s/rom.zip" % username
raise KeyboardInterrupt
notifier = pyinotify.Notifier(wm, RExtract())
print "ROM Extractor Copyright (c) 2010 Martin Paul Eve"
print "This program comes with ABSOLUTELY NO WARRANTY."
print "This is free software, and you are welcome to redistribute it under certain conditions; see the included licence statement"
print ""
print "Monitoring: %(path)s for %(filename)s" % {"path": os.path.expanduser(monitor_path), "filename": filename}
print "Press CTRL+C to exit"
wdd = wm.add_watch(os.path.expanduser(monitor_path), mask, rec=True, auto_add=True)
while True:
try:
notifier.process_events()
if notifier.check_events():
notifier.read_events()
except KeyboardInterrupt:
notifier.stop()
break
Hey Martin there is a tool already available for this here in Forums... dint work for me for some reason.. Just informing you so that u do not reinvent the wheel ..
EDIT :: here it is: http://forum.xda-developers.com/showthread.php?t=711298
Regards
Ahh! Finally one that works!
Thanks!
TheDeadCpu said:
Ahh! Finally one that works!
Thanks!
Click to expand...
Click to collapse
Excellent; glad that my effort wasn't wasted then
I can't make it work but thanks for your job !
(and for your soft-root too !!)
voodka2007 said:
I can't make it work but thanks for your job !
(and for your soft-root too !!)
Click to expand...
Click to collapse
Could you be more specific about what happens when you run it and it doesn't work? You need python-py-inotify for it to detect the file...
Sent from my HTC Wildfire using XDA App
Script can be run, it just can't found rom.zip... i have install python-pyinotify package, and it's same.
I have try 2 monitoring path :
~/.wine/dosdevices/c:/windows/temp
and
~/.wine/drive_c/windows/temp
I have try with root, sudo, check username, chmod the script, and it's same.
voodka2007 said:
Script can be run, it just can't found rom.zip... i have install python-pyinotify package, and it's same.
I have try 2 monitoring path :
~/.wine/dosdevices/c:/windows/temp
and
~/.wine/drive_c/windows/temp
I have try with root, sudo, check username, chmod the script, and it's same.
Click to expand...
Click to collapse
Check the format of your path. It should be like this:
monitor_path = "~/.wine/drive_c/users/%s/Temp/" % username
This is because it won't extract to c:\Windows\Temp but to c:\Users\Username\Temp
Try leaving monitor path just as it was (but change the username)...
Code:
[Pyinotify ERROR] add_watch: cannot watch /home/voodka/.wine/drive_c/users/voodka/Temp/ (WD=-1)
I haven't users folder in my .wine/drive_c/
What version of windows have you set in winecfg?
Sent from my HTC Wildfire using XDA App
Thanks for your perseverance !
In my wincfg i use Windows XP
But i have try with Windows 7 and it's always same...
Do this problem can come from Wine 1.2 ? (i don't use 1.0)
Thanks...
PERFECT
i must buy you a beer
Worked for me.
Radio_13.53.55.24H_3.35.19.25_release_151892_signed.exe and Ubuntu 10.10
thanks!
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