[oreo] WifiDisplay fix - Sony Xperia XZ1 Guides, News, & Discussion

[oreo] WifiDisplay fix
WfdService.apk
smali\com\sonymobile\wifidisplay\WFDSessionHelper.smali
Remove red
.method public monitorForegroundApp()V
.locals 3
.prologue
.line 107
const-string/jumbo v0, "user"
sget-object v1, Landroid/os/Build;->TYPE:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/ObjectZ
move-result v0
if-nez v0, :cond_0
.line 108
const-string/jumbo v0, "1"
const-string/jumbo v1, "persist.debug.wfd.appmonitoring"
const-string/jumbo v2, "0"
invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/StringLjava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/ObjectZ
move-result v0
.line 107
if-eqz v0, :cond_0
.line 109
const-string/jumbo v0, "WFDSessionHelper"
const-string/jumbo v1, "Disable foreground application monitoring"
invoke-static {v0, v1}, Lcom/qualcomm/wfd/Log;->d(Ljava/lang/String;Ljava/lang/StringV
.line 110
return-void
.line 113
:cond_0
new-instance v0, Ljava/lang/Thread;
new-instance v1, Lcom/sonymobile/wifidisplay/WFDSessionHelper$1;
invoke-direct {v1, p0}, Lcom/sonymobile/wifidisplay/WFDSessionHelper$1;-><init>(Lcom/sonymobile/wifidisplay/WFDSessionHelperV
invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/RunnableV
invoke-virtual {v0}, Ljava/lang/Thread;->start()V
.line 140
return-void
.end method
Click to expand...
Click to collapse
system\etc\wfdconfig.xml
Modify 1 to 0
<!-- enable HDCP by default -->
<ContentProtection>
<Valid>1</Valid>
<!--
Valid values WFD_HDCP_2_0,
WFD_HDCP_2_1 and WFD_HDCP_2_2
-->
<Version>WFD_HDCP_2_2</Version>
<CPPort>6789</CPPort>
<!--
turn on/off audio encryption
-->
<EncryptAudio>1</EncryptAudio>
</ContentProtection>
Click to expand...
Click to collapse
system\build.prop
Delete persist.debug.wfd.enable=1
Add persist.debug.wfd.appmonitoring=1

Could you add a description as to what this fixes?

M-Rom said:
[oreo] WifiDisplay fix
Click to expand...
Click to collapse
Dear, thanks for the fix! It really works and all is well! :good:

f1^ter said:
Dear, thanks for the fix! It really works and all is well! :good:
Click to expand...
Click to collapse
What does it fix?

gm007 said:
What does it fix?
Click to expand...
Click to collapse
Have Deodex WfdService.apk, to disassemble .apk and make changes. It seems the manual is well described.
Edit:
To remove directory /system/app/WfdService folder "oat". Go in recovery and flash WifiDisplay-FIX.zip after installation, remember to perform the operation with system\etc\wfdconfig.xml . Don't forget about a backup System.

f1^ter said:
Have Deodex WfdService.apk, to disassemble .apk and make changes. It seems the manual is well described.
Edit:
To remove directory /system/app/WfdService folder "oat". Go in recovery and flash WifiDisplay-FIX.zip after installation, remember to perform the operation with system\etc\wfdconfig.xml . Don't forget about a backup System.
Click to expand...
Click to collapse
Well of course we can se what it does, but WHAT DOES IT FIX????? WHAT IS THE PROBLEM IT SOLVES????
I do not know I have a problem with the WfdService!!!!

pergoteborg said:
Well of course we can se what it does, but WHAT DOES IT FIX????? WHAT IS THE PROBLEM IT SOLVES????
I do not know I have a problem with the WfdService!!!!
Click to expand...
Click to collapse
Wireless connection to a TV for example. In fact, the analogue of Miracast.

f1^ter said:
Wireless connection to a TV for example. In fact, the analogue of Miracast.
Click to expand...
Click to collapse
Ok, good to know since I do not use it and Therefore dont have the problem.
Maybe put that in the header?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Send from my Xperia XZ1 Dual (G8342) using Tapatalk

On Android Pie, whiteout ta partition backup, this restore a semi working miracast: it only works for Xperia home app and Settings app.
Thanks :good:

Related

Developing

I am slowly getting through the basics of apk decompiling, Editing, Debugging & recompiling.
Using tools like Apk Tool, Winrar, Notepad++ Winmerge, Adb .
first time I have touched an android or even done any kind of stuff like this was Early August 2012. So not long at all, now i have a question to the more experienced Devs. Eg; Lets just say I dont want increasing ringtone How do you pin point where in the apk to start editing i mean there are heaps of files its like looking for a needle in a haystack. One way I came close and pin pointed it is using a previous made mod and then used Winmerge to compare the differences, Problem is the differences in these to Apks is not just the Increasing ringtone, so when I winmerged them it picked out out the other differences Now this deffinatley narrowed it down. I have a feeling it has something to do with the Callnotifier.xml is this the only Xml?
Also Lets just say you dont have another apk to compare it to , how to you find out this stuff..
Another thing is I want to cook up a rom, but the way I want to do it is modding my own rom untill I am happy with it and then creating something like a nandroid without my personal data. then making it flashable for people. What tools is best used for this? I was thinking editing my nandroid and adding it to a cwm flash. but I think there is an easier way.
Thanks for you help
btemtd said:
I am slowly getting through the basics of apk decompiling, Editing, Debugging & recompiling.
Using tools like Apk Tool, Winrar, Notepad++ Winmerge, Adb .
first time I have touched an android or even done any kind of stuff like this was Early August 2012. So not long at all, now i have a question to the more experienced Devs. Eg; Lets just say I dont want increasing ringtone How do you pin point where in the apk to start editing i mean there are heaps of files its like looking for a needle in a haystack. One way I came close and pin pointed it is using a previous made mod and then used Winmerge to compare the differences, Problem is the differences in these to Apks is not just the Increasing ringtone, so when I winmerged them it picked out out the other differences Now this deffinatley narrowed it down. I have a feeling it has something to do with the Callnotifier.xml is this the only Xml?
Also Lets just say you dont have another apk to compare it to , how to you find out this stuff..
Another thing is I want to cook up a rom, but the way I want to do it is modding my own rom untill I am happy with it and then creating something like a nandroid without my personal data. then making it flashable for people. What tools is best used for this? I was thinking editing my nandroid and adding it to a cwm flash. but I think there is an easier way.
Thanks for you help
Click to expand...
Click to collapse
In my point of view,this is no shortcut,this is experience have been modified in the way
correct me,maybe i'm wrong!
Disable Increasing ringtone @secphone.apk\com\android\phone\Ringer$1.smali
delete every this code
Code:
setstreamvolume
thanks for your input.....It would now be good to have someone that has done this mod, to give us the 100% answer and maybe some extra advise/tips/tricks from their personal book of knowledge
Try the Android hacking forum on XDA
http://forum.xda-developers.com/
jje
I search, search and search the net for info on the mod i want. Some can be difficult to find the guides for.
If searching fails ill ask a dev for some info.
When it comes to comparing apks I will only do that if I know where the change needs to be then trial and error
Sent from my GT-I9305 using XDA Premium HD app
btemtd said:
thanks for your input.....It would now be good to have someone that has done this mod, to give us the 100% answer and maybe some extra advise/tips/tricks from their personal book of knowledge
Click to expand...
Click to collapse
I've 100% done this mod
disable increasing ringtone
http://www.mediafire.com/?72la46qi95j1d7b
leamoor said:
I've 100% done this mod
disable increasing ringtone
http://www.mediafire.com/?72la46qi95j1d7b
Click to expand...
Click to collapse
is this Disable Increasing ONLY mod?
And could you let me know what files inside the Secphone.apk you edited just for curiosty? was it the one file you stated above? Or did you port this mod?
btemtd said:
is this Disable Increasing ONLY mod?
And could you let me know what files inside the Secphone.apk you edited just for curiosty? Or did you port this mod?
Click to expand...
Click to collapse
yes,only disable Increasing ringtone!
this is exactly what i said @#2
decompile secphone/smali/com/android/phone/Ringer$1
delete red sentences
Code:
#setter for: Lcom/android/phone/Ringer;->mOriginRingtoneVolume:I
invoke-static {v1, v2}, Lcom/android/phone/Ringer;->access$702(Lcom/android/phone/Ringer;I)I
.line 571
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
iget-object v1, v1, Lcom/android/phone/Ringer;->mAudioManager:Landroid/media/AudioManager;
[COLOR="Red"]invoke-virtual {v1, v6, v4, v5}, Landroid/media/AudioManager;->setStreamVolume(III)V[/COLOR]
.line 573
const/4 v1, 0x7
const-wide/16 v2, 0x7d0
invoke-virtual {p0, v1, v2, v3}, Lcom/android/phone/Ringer$1;->sendEmptyMessageDelayed(IJ)Z
.line 578
:cond_4
:goto_2
invoke-virtual {v0}, Landroid/media/Ringtone;->play()V
.line 579
iget-object v2, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
monitor-enter v2
.line 580
:try_start_1
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mFirstRingStartTime:J
invoke-static {v1}, Lcom/android/phone/Ringer;->access$900(Lcom/android/phone/Ringer;)J
move-result-wide v3
const-wide/16 v5, 0x0
cmp-long v1, v3, v5
if-gez v1, :cond_5
.line 581
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
move-result-wide v3
#setter for: Lcom/android/phone/Ringer;->mFirstRingStartTime:J
invoke-static {v1, v3, v4}, Lcom/android/phone/Ringer;->access$902(Lcom/android/phone/Ringer;J)J
.line 583
:cond_5
monitor-exit v2
goto/16 :goto_0
:catchall_0
move-exception v1
monitor-exit v2
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v1
.line 546
:catchall_1
move-exception v1
:try_start_2
monitor-exit v2
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
throw v1
.line 563
:cond_6
invoke-virtual {v0, v5}, Landroid/media/Ringtone;->setRepeat(Z)V
goto :goto_1
.line 574
:cond_7
const-string v1, "extra_ringer"
invoke-static {v1}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_4
.line 575
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mExtraRinger:Lcom/android/phone/ExtraRinger;
invoke-static {v1}, Lcom/android/phone/Ringer;->access$800(Lcom/android/phone/Ringer;)Lcom/android/phone/ExtraRinger;
move-result-object v1
invoke-virtual {v1}, Lcom/android/phone/ExtraRinger;->startExtraRinger()V
goto :goto_2
.line 589
:pswitch_2
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
const-string v2, "mRingHandler: PLAY_TTS..."
#calls: Lcom/android/phone/Ringer;->log(Ljava/lang/String;Z)V
invoke-static {v1, v2, v4}, Lcom/android/phone/Ringer;->access$400(Lcom/android/phone/Ringer;Ljava/lang/String;Z)V
.line 591
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
iget-object v2, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
iget-object v2, v2, Lcom/android/phone/Ringer;->mContext:Landroid/content/Context;
invoke-static {v2, v4}, Lcom/android/phone/CallTextToSpeech;->getInstance(Landroid/content/Context;I)Lcom/android/phone/CallTextToSpeech;
move-result-object v2
#setter for: Lcom/android/phone/Ringer;->mCallTextToSpeech:Lcom/android/phone/CallTextToSpeech;
invoke-static {v1, v2}, Lcom/android/phone/Ringer;->access$1002(Lcom/android/phone/Ringer;Lcom/android/phone/CallTextToSpeech;)Lcom/android/phone/CallTextToSpeech;
.line 592
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mRingHandler:Landroid/os/Handler;
invoke-static {v1}, Lcom/android/phone/Ringer;->access$1100(Lcom/android/phone/Ringer;)Landroid/os/Handler;
move-result-object v1
if-eqz v1, :cond_0
.line 593
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mRingHandler:Landroid/os/Handler;
invoke-static {v1}, Lcom/android/phone/Ringer;->access$1100(Lcom/android/phone/Ringer;)Landroid/os/Handler;
move-result-object v1
const/4 v2, 0x5
invoke-virtual {v1, v2}, Landroid/os/Handler;->removeMessages(I)V
goto/16 :goto_0
.line 598
:pswitch_3
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
const-string v2, "mRingHandler: STOP_RING..."
#calls: Lcom/android/phone/Ringer;->log(Ljava/lang/String;Z)V
invoke-static {v1, v2, v4}, Lcom/android/phone/Ringer;->access$400(Lcom/android/phone/Ringer;Ljava/lang/String;Z)V
.line 599
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
.end local v0 #r:Landroid/media/Ringtone;
check-cast v0, Landroid/media/Ringtone;
.line 600
.restart local v0 #r:Landroid/media/Ringtone;
if-eqz v0, :cond_9
.line 602
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mCallTextToSpeech:Lcom/android/phone/CallTextToSpeech;
invoke-static {v1}, Lcom/android/phone/Ringer;->access$1000(Lcom/android/phone/Ringer;)Lcom/android/phone/CallTextToSpeech;
move-result-object v1
if-eqz v1, :cond_8
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mCallTextToSpeech:Lcom/android/phone/CallTextToSpeech;
invoke-static {v1}, Lcom/android/phone/Ringer;->access$1000(Lcom/android/phone/Ringer;)Lcom/android/phone/CallTextToSpeech;
move-result-object v1
invoke-virtual {v1}, Lcom/android/phone/CallTextToSpeech;->IsSpeakingTts()Z
move-result v1
if-eqz v1, :cond_8
.line 603
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mCallTextToSpeech:Lcom/android/phone/CallTextToSpeech;
invoke-static {v1}, Lcom/android/phone/Ringer;->access$1000(Lcom/android/phone/Ringer;)Lcom/android/phone/CallTextToSpeech;
move-result-object v1
invoke-virtual {v1}, Lcom/android/phone/CallTextToSpeech;->stopTts()V
.line 604
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#setter for: Lcom/android/phone/Ringer;->mCallTextToSpeech:Lcom/android/phone/CallTextToSpeech;
invoke-static {v1, v8}, Lcom/android/phone/Ringer;->access$1002(Lcom/android/phone/Ringer;Lcom/android/phone/CallTextToSpeech;)Lcom/android/phone/CallTextToSpeech;
.line 606
:cond_8
invoke-virtual {v0}, Landroid/media/Ringtone;->stop()V
.line 610
:goto_3
invoke-virtual {p0}, Lcom/android/phone/Ringer$1;->getLooper()Landroid/os/Looper;
move-result-object v1
invoke-virtual {v1}, Landroid/os/Looper;->quit()V
goto/16 :goto_0
.line 608
:cond_9
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "- STOP_RING with null ringtone! msg = "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
#calls: Lcom/android/phone/Ringer;->log(Ljava/lang/String;Z)V
invoke-static {v1, v2, v4}, Lcom/android/phone/Ringer;->access$400(Lcom/android/phone/Ringer;Ljava/lang/String;Z)V
goto :goto_3
.line 614
:pswitch_4
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "RETURN_ORIGIN_VOLUME: "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
iget-object v3, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mOriginRingtoneVolume:I
invoke-static {v3}, Lcom/android/phone/Ringer;->access$700(Lcom/android/phone/Ringer;)I
move-result v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
#calls: Lcom/android/phone/Ringer;->log(Ljava/lang/String;Z)V
invoke-static {v1, v2, v4}, Lcom/android/phone/Ringer;->access$400(Lcom/android/phone/Ringer;Ljava/lang/String;Z)V
.line 615
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
iget-object v1, v1, Lcom/android/phone/Ringer;->mAudioManager:Landroid/media/AudioManager;
iget-object v2, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mOriginRingtoneVolume:I
invoke-static {v2}, Lcom/android/phone/Ringer;->access$700(Lcom/android/phone/Ringer;)I
move-result v2
[COLOR="Red"] invoke-virtual {v1, v6, v2, v5}, Landroid/media/AudioManager;->setStreamVolume(III)V[/COLOR]
.line 616
const-string v1, "extra_ringer"
invoke-static {v1}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_0
.line 617
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
#getter for: Lcom/android/phone/Ringer;->mExtraRinger:Lcom/android/phone/ExtraRinger;
invoke-static {v1}, Lcom/android/phone/Ringer;->access$800(Lcom/android/phone/Ringer;)Lcom/android/phone/ExtraRinger;
I am so confused now as i just tried to decompile the same secphone.apk as i did before which worked, it also worked now but it gave this message
with your apk and my own something like could not decode replacing by false value: drawable *****bla bla/calll video icon.png
My apk said could not find 9patch chunk in file and all of a sudden it is doing this i did nothing!! each apk repeated this message with a few differnet files. Now how and why would it do this for no reason. it has always decompiled flawlessly. now it seems like there are missing files weirddd.
PS how did you locate that line, It would be almost in possible to search for that with no leads
btemtd said:
I am so confused now as i just tried to decompile the same secphone.apk as i did before which worked, it also worked now but it gave this message
with your apk and my own something like could not decode replacing by false value: drawable *****bla bla/calll video icon.png
My apk said could not find 9patch chunk in file and all of a sudden it is doing this i did nothing!! each apk repeated this message with a few differnet files. Now how and why
Click to expand...
Click to collapse
This is the method i from i9000 alreay know(i decompile some devs mod and fround it)
What version apktool are you used?Modifed code apk some apktool can not compile and decompile them
maybe for this reason,i used two sets of apktool to compile and decompile jelly bean apk
i'm use apktool 1.4.3 to decomplie,apktool 1.4.2 to compile,hope this can help.
but the funny thing this only just happened now it showing these weird errors, but the file is decompiled , but before it nevr showed these errors. They are more like files or certain things not found... not really errors. thanks anyways
here is the screen shot of these weird messages i have NEVER seen them before when decompiing does anyone know what they are, and why is it saying that
OK I removed that line that you said setstreamvolume etc,,,,,, now check out what happened wen i tried to compile it. I really dont get it now this would of happened if i didnt remove the line as it already happened even when i decompiled
has anyone seen this
btemtd said:
OK I removed that line that you said setstreamvolume etc,,,,,, now check out what happened wen i tried to compile it. I really dont get it now this would of happened if i didnt remove the line as it already happened even when i decompiled
has anyone seen this
Click to expand...
Click to collapse
Because your apktool can not compile modified apk
try use another apktool compile them
upload your apk here,for test compile and decompile
leamoor said:
Because your apktool can not compile modified apk
try use another apktool compile them
upload your apk here,for test compile and decompile
Click to expand...
Click to collapse
but this seems too strange i already made a mod 5x6 touchwiz layout... and it compiled perfectt.
Do you think i hould get the latest apktool?
btemtd said:
but this seems too strange i already made a mod 5x6 touchwiz layout... and it compiled perfectt.
Do you think i hould get the latest apktool?
Click to expand...
Click to collapse
Yes,this is strange,but sometimes happen ,
apktool I will suggestion you get the latest one!

[MOD][HOW-TO][4.1.2]StatusBar Toggles+Custom Settings[Controlable]

Hi To all
Me again...
This mod and how to is come from my Rom!
After many request...i decided share that to all but if anybody will use that just dont forget give me a credit:laugh:
What is this mod and how to?
this mod and how to have:
how to make custome settings in "secsettings.apk"
how to add make 23 toggle statusbar
how to add toggle between stock and 23 toggle statusbar in custome settings
and many things will come...
what you tools you need?
you need apktools or apk manger or apkmulti tools for decompile and Tools and Not pad++(i always use apkmulti tools this is better or you can use wanam Apk_Manager Repack.
lets Go to start
post 1 have system files download my Attachment "systemfiles.zip" put all of the in your device system\app folder to system\app and system\framework to system\framework
post 2 is "how to make custome settings in "secsettings.apk" and secsettings.apk files"
post 3 is "how to make custome settings in "systemui.apk""
screen shots:
will upload
thanks:
Wanam
lets go strat with Secsettings.apk
part1:
decompile "Secsettings.apk"
download my Attachment file "SecSettings.apk.rar" extract that and copy all things from that to your "secsettings.apk"
go to decompiled "secsettings.apk" go "res/xml open "settings_headers.xml" with not pad ++
Find this line:
Code:
<header android:id="@id/manufacturer_settings" android:fragment="com.android.settings.WirelessSettings">
<intent android:action="com.android.settings.MANUFACTURER_APPLICATION_SETTING" />
</header>
put this after that line:
Code:
<header android:title="Custom Settings" />
<header android:icon="@drawable/biftor_rom_control" android:title="Custom Settings" android:fragment="com.android.settings.Biftor.BiftorMain" />
save and compile "secsettings.apk" after you compile that decompile it again you need change id
part 2:
Decompile your modded "Secsettings.apk" Go to res/values and open "public.xml" with not pad
try to find this:
Code:
<public type="xml" name="biftor_customsettings" id="
copy id of "biftor_customsettings"
Go to smali/com/android/settings/Biftor open "BiftorMain.smali" and try to find this:
Code:
.locals 5
const/4 v1, 0x1
const/4 v2, 0x0
invoke-super {p0, p1}, Landroid/preference/PreferenceFragment;->onCreate(Landroid/os/Bundle;)V
const v0, [COLOR="Red"]0x7f07008d[/COLOR]
invoke-virtual {p0, v0}, Lcom/android/settings/Biftor/BiftorMain;->addPreferencesFromResource(I)V
const-string v0, "23toggle_statubar"
invoke-virtual {p0, v0}, Lcom/android/settings/Biftor/BiftorMain;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v0
check-cast v0, Landroid/preference/CheckBoxPreference;
see red line
Chang that to id of "biftor_customsettings" you copied that befor
save and compile
Secsettings.apk finish
Go to post 3 for Systemui.apk
lets go start with "Systemui.apk"
part1:
decompile your "Systemui.apk"
download my Attachment file "systemui.apk.rar" extract that and copy all things from that to your "Systemui.apk" decompiled
go to res/values open "ids.xml" with not pad++
add this line to that"
Code:
<item type="id" name="exp_power_stat">false</item>
after that compile and after compile,decompile that again!
part 2:
Go to smali\com\android\systemui\statusbar\phone and open "PhoneStatusBar.smali" with Not pad++
try to find this line:
Code:
.field mPostCollapseCleanup:Ljava/lang/Runnable;
and add this line after that:
Code:
.field mPowerWidget:Lcom/Biftor/systemui/quickpanel/PowerWidget;
try to find this method:
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
[COLOR="Blue"] .locals 13[/COLOR]
.prologue
.line 521
change the blue line to this:
Code:
.locals 15
try to find this on ".method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;"
Code:
sget-boolean v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useTouchWizGUI:Z
if-eqz v9, :cond_9
.line 532
const v9, 0x7f03003e
const/4 v10, 0x0
invoke-static {v1, v9, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v9
check-cast v9, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
[COLOR="Blue"] iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;[/COLOR]
put this after blue line:
Code:
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "23toggle_statubar"
const/4 v14, 0x0
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-eqz v12, :cond_Biftor
const v9, 0x7f030045
const/4 v10, 0x0
invoke-static {v1, v9, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v9
check-cast v9, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
:cond_Biftor
exactly same this:
you can remove "##############" this is just for hint!
Code:
sget-boolean v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useTouchWizGUI:Z
if-eqz v9, :cond_9
.line 532
const v9, 0x7f03003e
const/4 v10, 0x0
invoke-static {v1, v9, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v9
check-cast v9, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
##############################
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "23toggle_statubar"
const/4 v14, 0x0
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-eqz v12, :cond_Biftor
const v9, 0x7f030045 [COLOR="Red"]#biftor23_tw_super_status_bar[/COLOR]
const/4 v10, 0x0
invoke-static {v1, v9, v10}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v9
check-cast v9, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
:cond_Biftor
#################
try to find this on ".method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;":
Code:
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v10, 0x7f0d004c
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Landroid/widget/ScrollView;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
.line 700
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
const/4 v10, 0x0
[COLOR="Blue"] invoke-virtual {v9, v10}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V
[/COLOR]
put this lines after blue line:
Code:
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "23toggle_statubar"
const/4 v14, 0x0
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-eqz v12, :cond_arm
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v10, 0x7f0d011b [COLOR="Red"]#exp_power_stat[/COLOR]
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Lcom/Biftor/systemui/quickpanel/PowerWidget;
move-object/from16 v0, p0
iput-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/Biftor/systemui/quickpanel/PowerWidget;
.line 702
:cond_arm
exactly same this:
Code:
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v10, 0x7f0d004c
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Landroid/widget/ScrollView;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
.line 700
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V
#################
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "23toggle_statubar"
const/4 v14, 0x0
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-eqz v12, :cond_arm
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v10, 0x7f0d011b [COLOR="Red"]#exp_power_stat[/COLOR]
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Lcom/Biftor/systemui/quickpanel/PowerWidget;
move-object/from16 v0, p0
iput-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/Biftor/systemui/quickpanel/PowerWidget;
.line 702
:cond_arm
#################
try to find this on ".method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;":
Code:
sget-boolean v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useAttPlmnDisplay:Z
const/4 v10, 0x1
if-ne v9, v10, :cond_7
.line 857
const-string v9, "android.intent.action.SCREEN_ON"
invoke-virtual {v2, v9}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 860
:cond_7
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
[COLOR="Blue"] invoke-virtual {v1, v9, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;[/COLOR]
put this after blue line:
Code:
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "23toggle_statubar"
const/4 v14, 0x0
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-eqz v12, :cond_ar
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/Biftor/systemui/quickpanel/PowerWidget;
invoke-virtual {v9}, Lcom/Biftor/systemui/quickpanel/PowerWidget;->setupWidget()V
.line 863
:cond_ar
exactly same this:
Code:
sget-boolean v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->useAttPlmnDisplay:Z
const/4 v10, 0x1
if-ne v9, v10, :cond_7
.line 857
const-string v9, "android.intent.action.SCREEN_ON"
invoke-virtual {v2, v9}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 860
:cond_7
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v1, v9, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
#################
iget-object v12, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "23toggle_statubar"
const/4 v14, 0x0
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-eqz v12, :cond_ar
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/Biftor/systemui/quickpanel/PowerWidget;
invoke-virtual {v9}, Lcom/Biftor/systemui/quickpanel/PowerWidget;->setupWidget()V
.line 863
:cond_ar
#################
Important Note 1 Red lines:
Go to res/values open "public.xml" with Not pad++
Find new id of "exp_power_stat" and "biftor23_tw_super_status_bar"
after that replace new id to red lines.
i attached my modded "PhoneStatusBar.smali" you can use that maybe you need that!
final part:
go to decompiled SystemUI.apk open "AndroidManifest.xml"
try to find this:
Code:
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="com.sprint.permission.SPRINT4G" />
<uses-permission android:name="android.permission.WRITE_APN_SETTINGS" />
[COLOR="Blue"] <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
[/COLOR]
put this after blue line:
Code:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.REBOOT" />
compile Systemui.apk and Signe that (dont forget do signe)
and put it in your device!
important Note 2:
you need do This [HOW TO][20Mar][How to Disable Signature Checker For System App[Sammy JB]
because you Changed "AndroidManifest.xml" and you singed SystemUi.apk
Dont Forget do this!
i attached my Modded Systemui.apk if you want you can use that!
Enjoy.
res3
res4
res5 maybe will need...
I'd like to know what makes this mod.
please post the screenshoot.
thanks
remuntada78 said:
I'd like to know what makes this mod.
please post the screenshoot.
thanks
Click to expand...
Click to collapse
This mod is your statusbar toggle
With this mod
You can make lidroid 23toggle statusbar
And make toggle for switch from stock toggle to lidroid 23 toggle or lidroid to stock toggle....
I haven't screen Shot from that
Goodluck
Armin.
Sent from my GT-I9100 using xda premium
offtopic but apktool is stuck in compiling secsettings.apk ,,, i increased the heap size to 1024mb and still getting stuck ,,,whats wrong ?
rrgrrg said:
offtopic but apktool is stuck in compiling secsettings.apk ,,, i increased the heap size to 1024mb and still getting stuck ,,,whats wrong ?
Click to expand...
Click to collapse
You just gotta wait. It can take aaagggeeesss
Sent from my GT-I9305 using Tapatalk 4 Beta
Goldieking said:
You just gotta wait. It can take aaagggeeesss
Sent from my GT-I9305 using Tapatalk 4 Beta
Click to expand...
Click to collapse
ok ,,thats why not every rom has this future :silly:
edit : i see that aapt.exe is taking more memory by the passage of time ,,but its a slight increase so its working yea
rrgrrg said:
offtopic but apktool is stuck in compiling secsettings.apk ,,, i increased the heap size to 1024mb and still getting stuck ,,,whats wrong ?
Click to expand...
Click to collapse
rrgrrg said:
ok ,,thats why not every rom has this future :silly:
edit : i see that aapt.exe is taking more memory by the passage of time ,,but its a slight increase so its working yea
Click to expand...
Click to collapse
Hi
I suggest use apk multi tools that's much better than apktools for noob peoples...
Goodluck
Armin.
Sent from my GT-I9100 using xda premium
Biftor said:
Hi
I suggest use apk multi tools that's much better than apktools for noob peoples...
Goodluck
Armin.
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Or apk manager
Sent from my GT-I9100 using Tapatalk 2
Just a question please, I was looking for a guide almost like this one but from what I have read both stock and 23 toggle mods would look the same. My question is what would it take to have 2 different themes? eg-a full stock theme and a aosp 23 toggle theme, so I can add transparent pulldown, blue % battery ect.
Sent from my GT-I9100 using xda premium
bombaybadboy said:
Just a question please, I was looking for a guide almost like this one but from what I have read both stock and 23 toggle mods would look the same. My question is what would it take to have 2 different themes? eg-a full stock theme and a aosp 23 toggle theme, so I can add transparent pulldown, blue % battery ect.
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Should ask Goldie for this mate, but he is taking a break right now.
Namoi said:
Should ask Goldie for this mate, but he is taking a break right now.
Click to expand...
Click to collapse
Im just a seeker of knowledge and see parts of this guide could be useful to me mate
Sent from my GT-I9100 using xda premium
bombaybadboy said:
Just a question please, I was looking for a guide almost like this one but from what I have read both stock and 23 toggle mods would look the same. My question is what would it take to have 2 different themes? eg-a full stock theme and a aosp 23 toggle theme, so I can add transparent pulldown, blue % battery ect.
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Hi
You can do it same me!
You can change lidorid stock to aosp theme that's easy just change layout xml for lidroid in systemui.apk
Just look again you have one tw_super_statusbar.xml for 23 toggle!!!
Change layouts to aosp style!
Goodluck
Armin.
Sent from my GT-I9100 using xda premium
Biftor said:
Hi
You can do it same me!
You can change lidorid stock to aosp theme that's easy just change layout xml for lidroid in systemui.apk
Just look again you have one tw_super_statusbar.xml for 23 toggle!!!
Change layouts to aosp style!
Goodluck
Armin.
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Thankyou for the reply but how do you separate 2 tw_statusbar.xml and stat_battery_charge.xml and expandable_header ect can I ask. I will have a proper look when I next get back on my pc
Sent from my GT-I9100 using xda premium
bombaybadboy said:
Thankyou for the reply but how do you separate 2 tw_statusbar.xml and stat_battery_charge.xml and expandable_header ect can I ask. I will have a proper look when I next get back on my pc
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
For battery you should add your new xml to batterycontroller.smali with your lidroid toggle switch string I will check that!!
After that lock in Tw_super_statusbar.xml
You can add new Tw_statusbar.xml and new new expanded.xml and in tw_statusbar_expanded.xml
You have tw_statusbar_expanded_header.xml
You can make your aosp layouts and added to new Tw_super_statusbar.xml
Tw_super_statusbar.xml is same controller
Look into the Tw_super_statusbar.xml
I can't access to my pc now!
Goodluck
Armin.
Sent from my GT-I9100 using xda premium
Biftor said:
For battery you should add your new xml to batterycontroller.smali with your lidroid toggle switch string I will check that!!
After that lock in Tw_super_statusbar.xml
You can add new Tw_statusbar.xml and new new expanded.xml and in tw_statusbar_expanded.xml
You have tw_statusbar_expanded_header.xml
You can make your aosp layouts and added to new Tw_super_statusbar.xml
Tw_super_statusbar.xml is same controller
Look into the Tw_super_statusbar.xml
I can't access to my pc now!
Goodluck
Armin.
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Thankyou for your time and will give me something to look into I only have a hour or 2 pc time a day and its hard for me to hunt blind. Thanks again
Sent from my GT-I9100 using xda premium

Modifying NfcNci.apk so that it doesn't care about Deodex.

Just for the sake of transparency Here is a quick rundown of the process for everyone to see.
High level overview:
1. ) baksmali classes.dex from NfcNci.apk
2. ) Mod the resulting smali.
3. ) smali, and inject back into NfcNci.apk
Since this is the dev section I will focus on step 2 you can read about steps 1 and 3 elsewhere. For the sake of this example I will be working with the system dump from the original release of the gt-i9505g (S4 Google Edition) System Software.
What you are looking for is this function contained in the NfcIntegrityChecker class:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
If we track back the exception error message that comes up in the debug log ("Client module is tampered"), you will see that the text is contained in the NfcService class within the function ".method public enforceNfcIntegrity()V"
Code:
.method public enforceNfcIntegrity()V
.locals 3
.prologue
.line 470
iget-object v1, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
monitor-enter v1
.line 471
:try_start_0
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
invoke-virtual {v0}, Lcom/android/nfc/NfcIntegrityChecker;->getStatus()I
move-result v0
const/4 v2, 0x3
if-ne v0, v2, :cond_0
.line 472
new-instance v0, Ljava/lang/SecurityException;
const-string v2, "NfcIntegrityChecker is not on the proper status"
invoke-direct {v0, v2}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
.line 480
:catchall_0
move-exception v0
monitor-exit v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.line 475
:cond_0
:try_start_1
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
invoke-virtual {v0}, Lcom/android/nfc/NfcIntegrityChecker;->getStatus()I
move-result v0
const/4 v2, 0x2
if-eq v0, v2, :cond_1
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
const-string v2, "client"
invoke-virtual {v0, v2}, Lcom/android/nfc/NfcIntegrityChecker;->checkIntegrity(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
const-string v2, "clientlib"
invoke-virtual {v0, v2}, Lcom/android/nfc/NfcIntegrityChecker;->checkIntegrity(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_2
.line 478
:cond_1
new-instance v0, Ljava/lang/SecurityException;
const-string v2, "Client module is tampered"
invoke-direct {v0, v2}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
.line 480
:cond_2
monitor-exit v1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 481
return-void
.end method
If we follow the flow of the application we see that the code for this failure is only reached if the function call to
Code:
checkIntegrity(Ljava/lang/String;)Z
returns false, or the status is not properly set. (the 'Z' at the end means it returns a boolean).
There are two ways to handle this. We can either patch out the call to checkIntegrity entirely (jump over it, or literally remove the calls), or we can modify the checkIntegrity function so that it always returns true.
So, let's look at the checkIntegrity function:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
.locals 11
.parameter "type"
.prologue
const/4 v10, 0x2
const/4 v9, 0x1
const/4 v8, 0x0
.line 293
iget-object v5, p0, Lcom/android/nfc/NfcIntegrityChecker;->mModuleMap:Ljava/util/HashMap;
invoke-virtual {v5, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/ArrayList;
.line 294
.local v2, modules:Ljava/util/ArrayList;,"Ljava/util/ArrayList<[Ljava/lang/String;>;"
const/4 v1, 0x0
.line 295
.local v1, module:[Ljava/lang/String;
const/4 v3, 0x1
.line 296
.local v3, ret:Z
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v4
.line 298
.local v4, size:I
const/4 v0, 0x0
.local v0, i:I
:goto_0
if-ge v0, v4, :cond_2
.line 299
invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v1
.end local v1 #module:[Ljava/lang/String;
check-cast v1, [Ljava/lang/String;
.line 301
.restart local v1 #module:[Ljava/lang/String;
if-eqz v1, :cond_0
array-length v5, v1
if-eq v5, v10, :cond_4
.line 302
:cond_0
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_1
const-string v5, "NfcIntegrityChecker"
const-string v6, "checkIntegrity module format error"
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 303
:cond_1
const/4 v3, 0x0
.line 314
:cond_2
:goto_1
if-nez v3, :cond_3
iput v10, p0, Lcom/android/nfc/NfcIntegrityChecker;->mStatus:I
.line 316
:cond_3
return v3
.line 307
:cond_4
aget-object v5, v1, v8
aget-object v6, v1, v9
invoke-direct {p0, v5, v6}, Lcom/android/nfc/NfcIntegrityChecker;->checkModuleIntegrity(Ljava/lang/String;Ljava/lang/String;)Z
move-result v5
if-nez v5, :cond_6
.line 308
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_5
const-string v5, "NfcIntegrityChecker"
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "checkModuleIntegrity "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v8
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, " tampered : "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v9
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 309
:cond_5
const/4 v3, 0x0
.line 310
goto :goto_1
.line 298
:cond_6
add-int/lit8 v0, v0, 0x1
goto :goto_0
.end method
There is only one return statement, so this should be a simple matter of setting our value, and calling return. In some cases there is code that your application needs to run in order to function, so usually a light touch is a good idea, but in this case all of the code is there to run various checks so we can skip most of it.
The easiest way would be to replace the whole function with this:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
.locals 2
.parameter "type"
.prologue
const/4 v0, 0x1
return v0
.end method
But that method never sat right with me (old school c++ cracking I guess), so I prefer something like this:
add a goto, and modify the constant here:
.line 303
:cond_1
:goto_666
const/4 v3, 0x1
then add the following line to the beginning of the function (after the .prologue)
goto :goto_666
We end up with something like this:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
.locals 11
.parameter "type"
.prologue
const/4 v10, 0x2
const/4 v9, 0x1
const/4 v8, 0x0
goto :goto_666
.line 293
iget-object v5, p0, Lcom/android/nfc/NfcIntegrityChecker;->mModuleMap:Ljava/util/HashMap;
invoke-virtual {v5, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/ArrayList;
.line 294
.local v2, modules:Ljava/util/ArrayList;,"Ljava/util/ArrayList<[Ljava/lang/String;>;"
const/4 v1, 0x0
.line 295
.local v1, module:[Ljava/lang/String;
const/4 v3, 0x1
.line 296
.local v3, ret:Z
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v4
.line 298
.local v4, size:I
const/4 v0, 0x0
.local v0, i:I
:goto_0
if-ge v0, v4, :cond_2
.line 299
invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v1
.end local v1 #module:[Ljava/lang/String;
check-cast v1, [Ljava/lang/String;
.line 301
.restart local v1 #module:[Ljava/lang/String;
if-eqz v1, :cond_0
array-length v5, v1
if-eq v5, v10, :cond_4
.line 302
:cond_0
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_1
const-string v5, "NfcIntegrityChecker"
const-string v6, "checkIntegrity module format error"
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 303
:cond_1
:goto_666
const/4 v3, 0x1
.line 314
:cond_2
:goto_1
if-nez v3, :cond_3
iput v10, p0, Lcom/android/nfc/NfcIntegrityChecker;->mStatus:I
.line 316
:cond_3
return v3
.line 307
:cond_4
aget-object v5, v1, v8
aget-object v6, v1, v9
invoke-direct {p0, v5, v6}, Lcom/android/nfc/NfcIntegrityChecker;->checkModuleIntegrity(Ljava/lang/String;Ljava/lang/String;)Z
move-result v5
if-nez v5, :cond_6
.line 308
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_5
const-string v5, "NfcIntegrityChecker"
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "checkModuleIntegrity "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v8
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, " tampered : "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v9
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 309
:cond_5
const/4 v3, 0x0
.line 310
goto :goto_1
.line 298
:cond_6
add-int/lit8 v0, v0, 0x1
goto :goto_0
.end method
confirmed working
thanks again!
This is great, thanks for your contribution!
So does the integrity check call only have to do with access to the secure element? Or does it also eliminate the need to spoof device model for compatibility purposes?
CPA Poke said:
This is great, thanks for your contribution!
So does the integrity check call only have to do with access to the secure element? Or does it also eliminate the need to spoof device model for compatibility purposes?
Click to expand...
Click to collapse
It is just for the secure element. You can modify the wallet apk to bypass things like root checking, model versions, and carrier checks as well. It looks like the xposed framework patch that has been floating around does some of this, but it doesn't seem to patch the calls to read the device properties for device ID and such.
In my testing, I was able to replace all of those calls in the wallet app with constant strings containing "valid" values. This would kind of suck to have to do for each update... Though It would be a simple enough matter to write a script to do this automagically for each update. (Baksmali, sed/awk to find and replace in the smali, and smali to classes.dex) or write an xposed module to watch for calls to read prop values originating from wallet.
Sent from my GT-I9505G
Fenny said:
It is just for the secure element. You can modify the wallet apk to bypass things like root checking, model versions, and carrier checks as well. It looks like the xposed framework patch that has been floating around does some of this, but it doesn't seem to patch the calls to read the device properties for device ID and such.
In my testing, I was able to replace all of those calls in the wallet app with constant strings containing "valid" values. This would kind of suck to have to do for each update... Though It would be a simple enough matter to write a script to do this automagically for each update. (Baksmali, sed/awk to find and replace in the smali, and smali to classes.dex) or write an xposed module to watch for calls to read prop values originating from wallet.
Sent from my GT-I9505G
Click to expand...
Click to collapse
I think that's what the existing Xposed Wallet hack modules do (watch for the read prop values originating from Wallet). But for whatever reason it won't intercept the calls on initial setup, which is why you have to actually change the build.prop prior to initially setting up Wallet.
Fenny said:
It is just for the secure element. You can modify the wallet apk to bypass things like root checking, model versions, and carrier checks as well. It looks like the xposed framework patch that has been floating around does some of this, but it doesn't seem to patch the calls to read the device properties for device ID and such.
In my testing, I was able to replace all of those calls in the wallet app with constant strings containing "valid" values. This would kind of suck to have to do for each update... Though It would be a simple enough matter to write a script to do this automagically for each update. (Baksmali, sed/awk to find and replace in the smali, and smali to classes.dex) or write an xposed module to watch for calls to read prop values originating from wallet.
Sent from my GT-I9505G
Click to expand...
Click to collapse
if you had time to add a how-to to bypass root checking, model version and carrier check, I'd update it every time. wouldn't be a problem and I'd be happy to help out.
mrvirginia said:
if you had time to add a how-to to bypass root checking, model version and carrier check, I'd update it every time. wouldn't be a problem and I'd be happy to help out.
Click to expand...
Click to collapse
Bypassing Root:
Look at the com.google.android.apps.wallet.security.EnvironmentProperty class in the constructor method.
We're looking for this segment containing SU_COMMAND_LOCATIONS:
Code:
.line 70
new-array v0, v4, [Ljava/lang/String;
const-string v1, "/system/bin/su"
aput-object v1, v0, v3
const-string v1, "/system/xbin/su"
aput-object v1, v0, v2
sput-object v0, Lcom/google/android/apps/wallet/security/EnvironmentProperty;->SU_COMMAND_LOCATIONS:[Ljava/lang/String;
Note: These variable names change (v3, v4, etc...), usually they will be the const/4 numbers defined at the beginning of the method. Just make sure you use the one that contains 0.
Change this line from v4 (which contains the number 2)
Code:
new-array v0, v4, [Ljava/lang/String;
to v3 (which contains the number 0)
Code:
new-array v0, v3, [Ljava/lang/String;
Then simply delete the following lines:
Code:
const-string v1, "/system/bin/su"
aput-object v1, v0, v3
const-string v1, "/system/xbin/su"
aput-object v1, v0, v2
This will Set the environment property SU_COMMAND_LOCATIONS as an empty string array which will cause the checkDevice function in Lcom/google/android/apps/wallet/security/EnvironmentProperty$1 to simply break out of it's for loop and return 0 (which is what we want).
Bypassing device/carrier restrictions:
Here is a quick script I whipped up to replace the build prop calls automagically.
Usage would be something like:
Baksmali the classes.dex in your apk:
java -jar baksmali.jar your.apk -o outdir
Run the script (below):
/path/to/pwnprop.sh outdir
Do whatever other changes to the outdir directory.
Then smali:
java -jar smali.jar outdir -o classes.dex
Finally, winzip, lol. (If you actually use winzip imma kill you.)
The script:
Save this as pwnprop.sh (or whatever you feel like) and chmod +x
Code:
#!/bin/bash
do_replace ()
{
case $3 in
# Replace these with whatever device you want to clone.
MODEL)
ours="Galaxy Nexus";;
BRAND)
ours="Google" ;;
BOARD)
ours=""tuna"
ID)
ours="JDQ39E" ;;
PRODUCT)
ours="yakju" ;;
DEVICE)
ours="yakju" ;;
FINGERPRINT)
ours="google/yakju/maguro:4.2.2/JDQ39/573038:user/release-keys" ;;
*)
echo "Replacement property not defined: "$3" in "$1
return ;;
esac
sed -i 's{sget-object '$2', Landroid/os/Build;->'$3':Ljava/lang/String;{const-string '$2', "'$ours'"{g' $1
echo sed -i 's{sget-object '$2', Landroid/os/Build;->'$3':Ljava/lang/String;{const-string '$2', "'$ours'"{g' $1
}
OIFS=$IFS; IFS=$'\n'
for line in `grep -ro "[v0-9]*, Landroid/os/Build;->[A-Z]*" $ | sed 's{, Landroid/os/Build;->{:{'`
do
IFS=':'
temparray=($line)
if [ ${#temparray[@]} -eq 3 ]
then
do_replace $line
fi
IFS=$OIFS
done
CPA Poke said:
I think that's what the existing Xposed Wallet hack modules do (watch for the read prop values originating from Wallet). But for whatever reason it won't intercept the calls on initial setup, which is why you have to actually change the build.prop prior to initially setting up Wallet.
Click to expand...
Click to collapse
I think it actually just replaces the function that checks, "Is this device id allowed?" But for the initial setup the strings in build prop are sent to google where they can reject them server-side.
when trying to run the script, i keep getting a syntax error
pwnprop.sh: line 2: $'\r': command not found
pwnprop.sh: line 3: syntax error near unexpected token `$'\r''
'wnprop.sh: line 3: `do_replace ()
i'm doing:
bash pwnprop.sh classes
classes is my "outdir"
edit: alright, i've converted dos2unix. now i'm just getting errors that the file doesn't exist. argh, oh linux.
edit: zip has been updated to no longer check for su binary. still needs a device/carrier bypass restriction removed...
Fenny said:
I think it actually just replaces the function that checks, "Is this device id allowed?" But for the initial setup the strings in build prop are sent to google where they can reject them server-side.
Click to expand...
Click to collapse
Gotcha, that makes perfect sense.
mrvirginia said:
when trying to run the script, i keep getting a syntax error
pwnprop.sh: line 2: $'\r': command not found
pwnprop.sh: line 3: syntax error near unexpected token `$'\r''
'wnprop.sh: line 3: `do_replace ()
i'm doing:
bash pwnprop.sh classes
classes is my "outdir"
edit: alright, i've converted dos2unix. now i'm just getting errors that the file doesn't exist. argh, oh linux.
edit: zip has been updated to no longer check for su binary. still needs a device/carrier bypass restriction removed...
Click to expand...
Click to collapse
Make sure you have the sed, echo, and grep utilities installed and in your path.
Sent from my GT-I9505G
Fenny said:
Make sure you have the sed, echo, and grep utilities installed and in your path.
Sent from my GT-I9505G
Click to expand...
Click to collapse
i finally figured out what the problem was. iirc, i was running it as root or something. had the same problem when i tried using the Kitchen again a week or two ago and got it sorted so i'll attempt to run this again [hopefully] over the weekend and give everyone a working Wallet regardless of device so they won't have to do silly tweaks anymore with build.prop etc. thank you again, sir.
oh, did you ever figure out the SIM unlock issue?
Causes NFC to FC on official 4.3 with full wipe. Oddly, it works with dirty flash. Ideas?
[Edit]
Never mind. It was just a bad signature.
@ OP: this NfcNci mod works on TW firmware MF8.
maanz said:
@ OP: this NfcNci mod works on TW firmware MF8.
Click to expand...
Click to collapse
Good to hear. Sounds like this is a new feature in Samsung firmware. Still makes me wonder if non-samsung devices suffer the same fate. The function call is the same no matter which implementation of NfcNci you are using, but I suppose that each vendor's implementation of the integrity checks by necessesity will differ.
Sent from my GT-I9505G
@Fenny looks like Superuser (unsecure) check was removed from newest Wallet release on the Google Play Store
mrvirginia said:
@Fenny looks like Superuser (unsecure) check was removed from newest Wallet release on the Google Play Store
Click to expand...
Click to collapse
That is great news. Much less work to be done on it then.
Keep up the good work! You guys are close, I can feel it! I would offer to help this weekend, but I think I would just slow you down.
Sent from my Galaxy Nexus using XDA Premium 4 mobile app

[GUIDE] How To Add -Apps Edge/Contacts/Task Panel - For Galaxy S5 - UX Port Roms [MM]

Hello Xda Users,
This Guide is for Adding Edge Panels To Latest Samsung UX Based Roms
What's Required:
*Apktool for Decompiling/Recompiling jars
*Notepad++ For Editing Smalis
Steps:
1. Open your " system/etc/floating_feature.xml " with Notepad++
And
Find The Following Code:
Code:
<SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE></SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE
<SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE_STRIPE></SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE_STRIPE>
REPLACE IT WITH:
Code:
<SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE>[COLOR="DarkGreen"]people,task,circle,panel[/COLOR]</SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE>
<SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE_STRIPE>[COLOR="darkgreen"]-1[/COLOR]</SEC_FLOATING_FEATURE_COMMON_CONFIG_EDGE_STRIPE>
Now you must use ApkTool to decompile/Make Changes to smalis/Recompile
*Use Tickle My Android Apktool or Any other Apktool
2. Now Decompile your " Services.jar "
Find Red Text and Add Green Lines:
LOCATE TO:
smali/com/android/server/SystemServer.smali
Click to expand...
Click to collapse
Open up "SystemServer.smali" with Notepad++
SEARCH FOR:
Code:
[COLOR="Red"]const-string/jumbo v6, "spengestureservice"[/COLOR]
YOU SHOULD SEE SOMETHING LIKE THIS:
Code:
const-string/jumbo v6, "spengestureservice"
new-instance v7, Lcom/android/server/smartclip/SpenGestureManagerService;
move-object/from16 v0, v218
invoke-direct {v7, v5, v0}, Lcom/android/server/smartclip/SpenGestureManagerService;-><init>(Landroid/content/Context;Lcom/android/server/wm/WindowManagerService;)V
invoke-static {v6, v7}, Landroid/os/ServiceManager;->addService(Ljava/lang/String;Landroid/os/IBinder;)V
:try_end_85
.catch Ljava/lang/Throwable; {:try_start_85 .. :try_end_85} :catch_53
:goto_57
const-string v6, "2"
invoke-static {v6}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I
move-result v192
const/4 v6, 0x2
move/from16 v0, v192
if-lt v0, v6, :cond_32
move-object/from16 v0, p0
iget-object v6, v0, Lcom/android/server/SystemServer;->mSystemServiceManager:Lcom/android/server/SystemServiceManager;
const-string v7, "com.android.server.aod.AODManagerService"
invoke-virtual {v6, v7}, Lcom/android/server/SystemServiceManager;->startService(Ljava/lang/String;)Lcom/android/server/SystemService;
:cond_32
:try_start_86
const-string v6, "SystemServer"
Now add the Green lines:
Code:
const-string/jumbo v6, "spengestureservice"
new-instance v7, Lcom/android/server/smartclip/SpenGestureManagerService;
move-object/from16 v0, v218
invoke-direct {v7, v5, v0}, Lcom/android/server/smartclip/SpenGestureManagerService;-><init>(Landroid/content/Context;Lcom/android/server/wm/WindowManagerService;)V
invoke-static {v6, v7}, Landroid/os/ServiceManager;->addService(Ljava/lang/String;Landroid/os/IBinder;)V
:try_end_85
.catch Ljava/lang/Throwable; {:try_start_85 .. :try_end_85} :catch_53
:goto_57
[COLOR="DarkGreen"]move-object/from16 v0, p0
iget-object v6, v0, Lcom/android/server/SystemServer;->mSystemServiceManager:Lcom/android/server/SystemServiceManager;
const-string v7, "com.android.server.cocktailbar.CocktailBarManagerService"
invoke-virtual {v6, v7}, Lcom/android/server/SystemServiceManager;->startService(Ljava/lang/String;)Lcom/android/server/SystemService;[/COLOR]
const-string v6, "2"
invoke-static {v6}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I
move-result v192
const/4 v6, 0x2
move/from16 v0, v192
if-lt v0, v6, :cond_32
move-object/from16 v0, p0
iget-object v6, v0, Lcom/android/server/SystemServer;->mSystemServiceManager:Lcom/android/server/SystemServiceManager;
const-string v7, "com.android.server.aod.AODManagerService"
invoke-virtual {v6, v7}, Lcom/android/server/SystemServiceManager;->startService(Ljava/lang/String;)Lcom/android/server/SystemService;
:cond_32
:try_start_86
const-string v6, "SystemServer"
LOCATE TO:
smali/com/android/server/power/PowerManagerService.smali
Click to expand...
Click to collapse
SEARCH FOR:
Code:
[COLOR="Red"]const-string v8, "SEC_PRODUCT_FEATURE_COMMON_SUPPORT_COCKTAIL_FW: false"[/COLOR]
REPLACE IT WITH:
Code:
[COLOR="darkgreen"]const-string v8, "SEC_PRODUCT_FEATURE_COMMON_SUPPORT_COCKTAIL_FW: true"[/COLOR]
LOCATE TO:
smali/com/android/server/notification/NotificationManagerService$6.smali
Click to expand...
Click to collapse
SEARCH FOR:
Code:
[COLOR="Red"].method public enqueueEdgeNotification(Ljava/lang/String;Ljava/lang/String;ILandroid/os/Bundle;I)V
[/COLOR]
YOU SHOULD SEE SOMETHING LIKE THIS:
Code:
.method public enqueueEdgeNotification(Ljava/lang/String;Ljava/lang/String;ILandroid/os/Bundle;I)V
.locals 8
return-void
.end method
Now Replace the Whole method with this one:
Code:
[COLOR="darkgreen"].method public enqueueEdgeNotification(Ljava/lang/String;Ljava/lang/String;ILandroid/os/Bundle;I)V
.locals 8
# invokes: Lcom/android/server/notification/NotificationManagerService;->checkCallerIsSystemOrSameApp(Ljava/lang/String;)V
invoke-static {p1}, Lcom/android/server/notification/NotificationManagerService;->access$3700(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/server/notification/NotificationManagerService$6;->this$0:Lcom/android/server/notification/NotificationManagerService;
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
move-result v3
invoke-static {}, Landroid/os/Binder;->getCallingPid()I
move-result v4
move-object v1, p1
move-object v2, p2
move v5, p3
move-object v6, p4
move v7, p5
invoke-virtual/range {v0 .. v7}, Lcom/android/server/notification/NotificationManagerService;->enqueueEdgeNotificationInternal(Ljava/lang/String;Ljava/lang/String;IIILandroid/os/Bundle;I)V
return-void
.end method[/COLOR]
In Same Smali
SEARCH FOR:
Code:
[COLOR="Red"].method public removeEdgeNotification(Ljava/lang/String;ILandroid/os/Bundle;I)V
[/COLOR]
YOU SHOULD SEE SOMETHING LIKE THIS:
Code:
.method public removeEdgeNotification(Ljava/lang/String;ILandroid/os/Bundle;I)V
.locals 7
return-void
.end method
Now Replace the Whole method with this one:
Code:
[COLOR="darkgreen"].method public removeEdgeNotification(Ljava/lang/String;ILandroid/os/Bundle;I)V
.locals 7
# invokes: Lcom/android/server/notification/NotificationManagerService;->checkCallerIsSystemOrSameApp(Ljava/lang/String;)V
invoke-static {p1}, Lcom/android/server/notification/NotificationManagerService;->access$3700(Ljava/lang/String;)V
invoke-static {}, Landroid/os/Binder;->getCallingPid()I
move-result v0
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
move-result v1
const/4 v3, 0x1
const/4 v4, 0x0
const-string v5, "cancelNotificationWithTag"
move v2, p4
move-object v6, p1
invoke-static/range {v0 .. v6}, Landroid/app/ActivityManager;->handleIncomingUser(IIIZZLjava/lang/String;Ljava/lang/String;)I
move-result p4
iget-object v0, p0, Lcom/android/server/notification/NotificationManagerService$6;->this$0:Lcom/android/server/notification/NotificationManagerService;
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
move-result v1
invoke-static {}, Landroid/os/Binder;->getCallingPid()I
move-result v2
move-object v3, p1
move v4, p2
move-object v5, p3
move v6, p4
invoke-virtual/range {v0 .. v6}, Lcom/android/server/notification/NotificationManagerService;->removeEdgeNotificationInternal(IILjava/lang/String;ILandroid/os/Bundle;I)V
return-void
.end method[/COLOR]
Done
3. Now Recompile your " services.jar "
4. *Now Decompile your " Framework.jar "
LOCATE TO:
smali/android/app/NotificationManager.smali
Click to expand...
Click to collapse
SEARCH FOR:
Code:
[COLOR="Red"].method constructor <init>(Landroid/content/Context;Landroid/os/Handler;)V[/COLOR]
YOU SHOULD SEE SOMETHING LIKE THIS:
Code:
.method constructor <init>(Landroid/content/Context;Landroid/os/Handler;)V
.locals 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Landroid/app/NotificationManager;->mContext:Landroid/content/Context;
return-void
.end method
Now add the Green lines:
Code:
.method constructor <init>(Landroid/content/Context;Landroid/os/Handler;)V
[COLOR="DarkGreen"].locals 4[/COLOR]
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Landroid/app/NotificationManager;->mContext:Landroid/content/Context;
[COLOR="darkgreen"]new-instance v0, Landroid/app/NotificationManager$EdgeNotificationManager;
invoke-direct {v0, p1}, Landroid/app/NotificationManager$EdgeNotificationManager;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Landroid/app/NotificationManager;->mEdgeNotificationManager:Landroid/app/NotificationManager$EdgeNotificationManager;[/COLOR]
return-void
.end method
LOCATE TO:
smali/android/app/SystemServiceRegistry.smali
Click to expand...
Click to collapse
SEARCH FOR:
Code:
[COLOR="Red"]const-string/jumbo v1, "multiwindow_facade"[/COLOR]
YOU SHOULD SEE SOMETHING LIKE THIS:
Code:
const-string/jumbo v1, "multiwindow_facade"
const-class v2, Lcom/samsung/android/multiwindow/MultiWindowFacade;
new-instance v3, Landroid/app/SystemServiceRegistry$83;
invoke-direct {v3}, Landroid/app/SystemServiceRegistry$83;-><init>()V
invoke-static {v1, v2, v3}, Landroid/app/SystemServiceRegistry;->registerService(Ljava/lang/String;Ljava/lang/Class;Landroid/app/SystemServiceRegistry$ServiceFetcher;)V
const-string v1, "2"
invoke-static {v1}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
const/4 v1, 0x2
if-lt v0, v1, :cond_1
const-string v1, "AODManagerService"
const-class v2, Lcom/samsung/android/aod/AODManager;
new-instance v3, Landroid/app/SystemServiceRegistry$87;
invoke-direct {v3}, Landroid/app/SystemServiceRegistry$87;-><init>()V
invoke-static {v1, v2, v3}, Landroid/app/SystemServiceRegistry;->registerService(Ljava/lang/String;Ljava/lang/Class;Landroid/app/SystemServiceRegistry$ServiceFetcher;)V
:cond_1
const-string/jumbo v1, "spengestureservice"
Now add the Green lines:
Code:
const-string/jumbo v1, "multiwindow_facade"
const-class v2, Lcom/samsung/android/multiwindow/MultiWindowFacade;
new-instance v3, Landroid/app/SystemServiceRegistry$83;
invoke-direct {v3}, Landroid/app/SystemServiceRegistry$83;-><init>()V
invoke-static {v1, v2, v3}, Landroid/app/SystemServiceRegistry;->registerService(Ljava/lang/String;Ljava/lang/Class;Landroid/app/SystemServiceRegistry$ServiceFetcher;)V
[COLOR="darkgreen"]const-string v1, "CocktailBarService"
const-class v2, Lcom/samsung/android/cocktailbar/CocktailBarManager;
new-instance v3, Landroid/app/SystemServiceRegistry$85;
invoke-direct {v3}, Landroid/app/SystemServiceRegistry$85;-><init>()V
invoke-static {v1, v2, v3}, Landroid/app/SystemServiceRegistry;->registerService(Ljava/lang/String;Ljava/lang/Class;Landroid/app/SystemServiceRegistry$ServiceFetcher;)V[/COLOR]
const-string v1, "2"
invoke-static {v1}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
const/4 v1, 0x2
if-lt v0, v1, :cond_1
const-string v1, "AODManagerService"
const-class v2, Lcom/samsung/android/aod/AODManager;
new-instance v3, Landroid/app/SystemServiceRegistry$87;
invoke-direct {v3}, Landroid/app/SystemServiceRegistry$87;-><init>()V
invoke-static {v1, v2, v3}, Landroid/app/SystemServiceRegistry;->registerService(Ljava/lang/String;Ljava/lang/Class;Landroid/app/SystemServiceRegistry$ServiceFetcher;)V
:cond_1
const-string/jumbo v1, "spengestureservice"
5. Now Download
The " SystemServiceRegistry$85.smali " and
Add it to " framework.jar\smali\android\app "
Download From Here ->> View attachment SystemServiceRegistry$85.rar
Done
6. Now Recompile your " framework.jar "
7. Download the Attached
System Folder For " Edge Apks, Permissions Xmls "
Add them to correct location into your System Folder
Download From Here ->> https://www.androidfilehost.com/?fid=457095661767134120
Thank you
If Anyone has Access code Error, then only follow this post #2
Then Match the Access Code in the two smalis as below
LOCATE TO:
smali/com/android/server/notification/NotificationManagerService$6.smali
Click to expand...
Click to collapse
SEARCH FOR:
Code:
[COLOR="Red"].method public enqueueEdgeNotification(Ljava/lang/String;Ljava/lang/String;ILandroid/os/Bundle;I)V
[/COLOR]
YOU SHOULD SEE SOMETHING LIKE THIS:
See the Red Code, the access code should be same in NotificationManagerService.smali Also
Code:
.method public enqueueEdgeNotification(Ljava/lang/String;Ljava/lang/String;ILandroid/os/Bundle;I)V
.locals 8
# invokes: Lcom/android/server/notification/NotificationManagerService;->checkCallerIsSystemOrSameApp(Ljava/lang/String;)V
invoke-static {p1}, Lcom/android/server/notification/NotificationManagerService;->[COLOR="Red"][B]access$3700[/B][/COLOR](Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/server/notification/NotificationManagerService$6;->this$0:Lcom/android/server/notification/NotificationManagerService;
LOCATE TO:
smali/com/android/server/notification/NotificationManagerService.smali
Click to expand...
Click to collapse
SEARCH FOR:
Code:
[COLOR="Red"].method static synthetic access$3700(Ljava/lang/String;)V
[/COLOR]
YOU SHOULD SEE SOMETHING LIKE THIS:
See the Red Code, the access code is same as in NotificationManagerService$6.smali
Code:
.method static synthetic [COLOR="Red"][B]access$3700[/COLOR][/B](Ljava/lang/String;)V
.locals 0
invoke-static {p0}, Lcom/android/server/notification/NotificationManagerService;->checkCallerIsSystemOrSameApp(Ljava/lang/String;)V
return-void
.end method
Also make sure that access$3700 access right on NotificationManagerService
Hi mate @yash92duster, do you know how to make the background to blur? really needed... thank's before
Axl_Rush said:
Hi mate @yash92duster, do you know how to make the background to blur? really needed... thank's before
Click to expand...
Click to collapse
What background?
Explain more
Where you needed blur?
yash92duster said:
What background?
Explain more
Where you needed blur?
Click to expand...
Click to collapse
I mean, i want to make this blur. I have change in system/lib/libsurface.so but my phone dont even boot.
Axl_Rush said:
I mean, i want to make this blur. I have change in system/lib/libsurface.so but my phone dont even boot.
Click to expand...
Click to collapse
if you have S5 then that blur lib will work
it works fine on S5 G900F and G900H - no issues
if you tried this mod and blur lib on different device
specify the device model, stock rom or port rom
if you had tried on A Series device then native blur wont work
if J series also in some variants it wont work
so give more info so that i can see if i can help
yash92duster said:
if you have S5 then that blur lib will work
it works fine on S5 G900F and G900H - no issues
if you tried this mod and blur lib on different device
specify the device model, stock rom or port rom
if you had tried on A Series device then native blur wont work
if J series also in some variants it wont work
so give more info so that i can see if i can help
Click to expand...
Click to collapse
Oh I see.. Well ok my friend...
My device is J700F running on stock MM Indonesia firmware
I appreciate for your work and for your help my friend.. thank U
and sorry for my bad english
Axl_Rush said:
Oh I see.. Well ok my friend...
My device is J700F running on stock MM Indonesia firmware
I appreciate for your work and for your help my friend.. thank U
and sorry for my bad english
Click to expand...
Click to collapse
you can try to enable the EDGE PANELS in your J Series Device
but
Blur lib wont work on J series ( Many tried and failed )
only way for you is to use ACER BLUR to edge panels
Check for acer blur in
https://forum.xda-developers.com/showthread.php?t=2799050
https://forum.xda-developers.com/ga...ified-development/devs-helpingd-devs-t3321679
yash92duster said:
you can try to enable the EDGE PANELS in your J Series Device
but
Blur lib wont work on J series ( Many tried and failed )
only way for you is to use ACER BLUR to edge panels
Check for acer blur in
https://forum.xda-developers.com/showthread.php?t=2799050
https://forum.xda-developers.com/ga...ified-development/devs-helpingd-devs-t3321679
Click to expand...
Click to collapse
Ok i will try it.... thank's mate :good::good:
@yash92duster : this method really working on pure stock S5 MM? I tried many times but always FC when swipe... from another guide also..and tried your framework ans services.jar that you share on that guide, but still FC.
maybe something missing on pure stock. If anyone have success on pure stock, please share the framework & service.jar, me and others will greatly appreciate it.
thanks working fine in AJ A8 Rom
@yash92duster
nice guide, very well done. I was wondering if this would work on Nougat 7.X.X too...
I am trying to port that Galaxy Tab A, but when I decompile framework.jar, nothing really...in fact, its framework.jar is only 14kb size..so probably Samsung move that stuff somewhere in Galaxy Tab A...no idea..
jazzespresso said:
@yash92duster
nice guide, very well done. I was wondering if this would work on Nougat 7.X.X too...
I am trying to port that Galaxy Tab A, but when I decompile framework.jar, nothing really...in fact, its framework.jar is only 14kb size..so probably Samsung move that stuff somewhere in Galaxy Tab A...no idea..
Click to expand...
Click to collapse
Bad deodex
Lol
yash92duster said:
Bad deodex
Lol
Click to expand...
Click to collapse
oh crap...yeah saw -- Framework\arm folder is still there...funny though, it deodexed some, but not all...
what deodex utility you use usually?
jazzespresso said:
oh crap...yeah saw -- Framework\arm folder is still there...funny though, it deodexed some, but not all...
what deodex utility you use usually?
Click to expand...
Click to collapse
Use
Assayyed
It works perfectly till 7.0
7.1.1 also works in assayyed but for framework folder alone use flumics tool
yash92duster said:
Use
Assayyed
It works perfectly till 7.0
7.1.1 also works in assayyed but for framework folder alone use flumics tool
Click to expand...
Click to collapse
yeah I used Assayyed cook my ROM, so assumed it deodexed fine, then found out today, it is not...
it seems like, build ROM with Assayyed Kitchen, and switch over to flumics tool to deodex and copy back to Assayyed and finish the build
I got all figured out now..
following your guide up until framework.jar, smali/android/app/SystemServiceRegistry.smali, and search for "multiwindow_facade", which does not find in the file (found all other though) but i added Green lines change in the file anyway...
have not tested yet, we will see if it works:good:
jazzespresso said:
yeah I used Assayyed cook my ROM, so assumed it deodexed fine, then found out today, it is not...
it seems like, build ROM with Assayyed Kitchen, and switch over to flumics tool to deodex and copy back to Assayyed and finish the build
I got all figured out now..
following your guide up until framework.jar, smali/android/app/SystemServiceRegistry.smali, and search for "multiwindow_facade", which does not find in the file (found all other though) but i added Green lines change in the file anyway...
have not tested yet, we will see if it works:good:
Click to expand...
Click to collapse
Better ask in right place
This is not kitchen thread:silly:
yash92duster said:
Better ask in right place
This is not kitchen thread:silly:
Click to expand...
Click to collapse
wasn't really kitchen question, read my post again
Screenshots?

[GUIDE] Remove high volume warning for headphones

decompile services.jar.
open smali\com\android\server\audio\AudioService.smali.
Goto this method and add blue text:
.method private checkSafeMediaVolume(III)Z
.locals 4
.param p1, "streamType" # I
.param p2, "index" # I
.param p3, "device" # I
.prologue
const/4 v3, 0x3
const/4 v2, 0x0
.line 6263
iget-object v1, p0, Lcom/android/server/audio/AudioService;->mSafeMediaVolumeState:Ljava/lang/Integer;
monitor-enter v1
.line 6264
:try_start_0
iget-object v0, p0, Lcom/android/server/audio/AudioService;->mSafeMediaVolumeState:Ljava/lang/Integer;
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
move-result v0
goto :goto_td
if-ne v0, v3, :cond_0
.line 6265
iget-object v0, p0, Lcom/android/server/audio/AudioService;->mStreamVolumeAlias:[I
aget v0, v0, p1
if-ne v0, v3, :cond_0
.line 6266
and-int/lit16 v0, p3, 0x3fc
if-eqz v0, :cond_0
.line 6267
iget v0, p0, Lcom/android/server/audio/AudioService;->mSafeMediaVolumeIndex:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-le p2, v0, :cond_0
monitor-exit v1
.line 6268
return v2
.line 6270
:goto_td
:cond_0
const/4 v0, 0x1
monitor-exit v1
return v0
.line 6263
:catchall_0
move-exception v0
monitor-exit v1
throw v0
.end method
Click to expand...
Click to collapse
recompile services.jar.
I've been looking for a method to turn off the high volume warning and I thank you for helping solve this... but I have no idea where to even start with this. Where is the service.jar located? And can I use a standard root file explorer to open it?
I tried doing some Google searches but it seems to point me towards windows. Does this have to be done on a computer?
what version are you using? B06, b08.
you need to decompile and modify it.
HallOfPromise said:
I've been looking for a method to turn off the high volume warning and I thank you for helping solve this... but I have no idea where to even start with this. Where is the service.jar located? And can I use a standard root file explorer to open it?
I tried doing some Google searches but it seems to point me towards windows. Does this have to be done on a computer?
Click to expand...
Click to collapse
There's a tutorial made by bkores about decompiling stuff. Just go read it
Or you could just add audio.safemedia.bypass=true to your build.prop
No more volume warnings
I'm on B32.
I'll attempt the build.prop edit. I've done that in the past before. Thanks for the help!
Tebor said:
Or you could just add audio.safemedia.bypass=true to your build.prop
No more volume warnings
Click to expand...
Click to collapse
This indeed worked for me! Super easy, as well. The warning has been bugging me since upgrading to Nougat. My biggest problem was having to hit OK on the warning message while driving, and having to volume back up after every phone restart. I honestly don't like messing with my phone while driving, and it's illegal to simply handle the phone here in California. It has to be mounted in order to mess with it.
since i dont know how to compile java i would like the more easy way too. i did a search with tc on the fon for "build.prop" without hits. how exactly is it done?
drahtwurst said:
since i dont know how to compile java i would like the more easy way too. i did a search with tc on the fon for "build.prop" without hits. how exactly is it done?
Click to expand...
Click to collapse
You need root and the file is in /system/build.prop.
@HallOfPromise,
Too loud music would damage to ear when in headphone, so here is the suggestion: Please turn down the volume when use headphone. The driving-mode idea great, ZTE engineer will take your idea. 
Tebor said:
Or you could just add audio.safemedia.bypass=true to your build.prop
No more volume warnings
Click to expand...
Click to collapse
Works. Thanks.
audio.safemedia.bypass alone doesn't work on UB32 for me. Neither does Xposed Gravitybox's disabler. However they do work when put together. :victory: Thanks
For those not wanting Xposed perhaps experimenting with the bypass combined with this other method may work. https://www.xda-developers.com/how-to-automatically-disable-the-high-volume-warning-without-root/ It doesn't work alone either, I had tried that before.
Quick tip that i've just discovered : Installing Viper4Android (last ver. 2.5.0.4) removed me that (autocensored) warning on my A2017G. And with the good settings, sound is so much better...

Categories

Resources