EDIT: post #3 now includes the steps so a guide to add it to your own files this information is from http://forum.xda-developers.com/showthread.php?t=811532 only modified to work with photon
ok guys i got it working im on skinny rev unlocked with dark fire theme so that is the framework apk i used but its easy to modify for the developers wanting to add this to there theme or rom.. just use my files android.policy.jar and framework.jar
to do this decompile and edit this xml in your framework.apk
Code:
"framework-res.apk\res\values\strings.xml"
add
Reboot
Recovery
next add png icons here
"framework-res.apk\res\drawable-hdpi"
make sure they are named
"ic_lock_reboot.png
"ic_lock_recovery.png
then recompile/build etc.. after you have build apk decompile it again
go here
frameworkres.apk\res\values\public.xml
you will see this with different id #s
and
these are what you need to change in the android.policy.jar
com\android\internal\policy\impl\GlobalActions.sma li"
at line 661
const v3, 0x1080501 (reboot icon)
const v4, 0x10404ed (reboot string)
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080502 (recovery icon)
const v4, 0x10404ee (recovery string)
the first set of icon ids are for reboot
first # is drawable icon second is string #
second set is recovery as in the ( ) 's
so now change these numbers to those in the public.xml as i described above
next recompile your android.policy.jar and its ready to add
thanks!
screenie here http://dl.dropbox.com/u/46879286/20120214113758.jpeg
colors are off sorry
chrystal0925 said:
ok guys i got it working im on skinny rev unlocked with dark fire theme so that is the framework apk i used but its easy to modify for the developers wanting to add this to there theme or rom.. just use my files android.policy.jar and framework.jar
download here http://dl.dropbox.com/u/46879286/photon.power.mod.zip
to do this decompile and edit this xml in your framework.apk
"framework-res.apk\res\values\strings.xml"
add
Reboot
Recovery
next add png icons here
"framework-res.apk\res\drawable-hdpi"
make sure they are named
"ic_lock_reboot.png
"ic_lock_recovery.png
then recompile/build etc.. after you have build apk decompile it again
go here
frameworkres.apk\res\values\public.xml
you will see this with different id #s
and
these are what you need to change in the android.policy.jar
com\android\internal\policy\impl\GlobalActions.sma li"
at line 661
const v3, 0x1080501 (reboot icon)
const v4, 0x10404ed (reboot string)
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080502 (recovery icon)
const v4, 0x10404ee (recovery string)
the first set of icon ids are for reboot
first # is drawable icon second is string #
second set is recovery as in the ( ) 's
so now change these numbers to those in the public.xml as i described above
next recompile your android.policy.jar and its ready to add
thanks!
screenie here http://dl.dropbox.com/u/46879286/20120214113758.jpeg
colors are off sorry
Click to expand...
Click to collapse
This is great I was working on it last night did you have to make changes to build prop?
Sent from my MB855 using xda premium
No I didn't and it works fine
edit: above may not work on other roms with my files so heres a guide need to be deodex odex is not working:
use apk_manager to decompile framework-res
open "values\strings.xml add this to it
Code:
<string name="reboot_recovery">Recovery</string>
<string name="reboot">Reboot</string>
next add png icons here (i attached some to use )
"framework-res.apk\res\drawable-hdpi"
make sure they are named
"ic_lock_reboot.png
"ic_lock_recovery.png
recompile then decompile to get it to auto generate the public id's
now to add the option to the shutdown
so decompile framework.jar and open "com\android\internal\app\ShutdownThread.smali
add to line 40 keep the lines spaced(skipping a line between )
Code:
.field public static mReboot:I
then at line 542 before "invoke-static {}, Landroid/os/Power;->shutdown()V" add this
Code:
sget v1, Lcom/android/internal/app/ShutdownThread;->mReboot:I
const/4 v2, 0x1
if-eq v1, v2, :reboot
const/4 v2, 0x2
if-eq v1, v2, :rebootRecovery
then at line 557 or about line 554 after this
.line 512
return-void
add this
Code:
:reboot
const-string v4, "now"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
:rebootRecovery
const-string v4, "recovery"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
next save and recompile
now decompile androidpolicy.jar
open com\android\internal\policy\impl\GlobalActions.smali
look for .method private createDialog()Landroid/app/AlertDialog;
and at line 624 edit to add two more methods
Code:
.line 232
const/4 v0, 0x4
(change the 0x4 to 0x6)
and at line 657 edit out the ids from your public.xml (]do not add this reference here )
add this
Code:
const/4 v1, 0x4
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$10;
const v3, 0x1080501 ([COLOR="Red"]change this to drawable reboot id[/COLOR])
const v4, 0x10404ed [COLOR="red"](reboot string id[/COLOR])
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080502( [COLOR="red"]drawable recovery id[/COLOR])
const v4, 0x10404ee ([COLOR="red"]recovery string id[/COLOR])
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
so you need to go back to your framework.apk
open res/values/public to get the id's to change the above..
save and go to
GlobalActions$5.smali and copy it and name it GlobalActions$10.smali
open GlobalActions$10 and replace all instances ( so any where you see) of GlobalActions$5
with GlobalActions$10 then add this code
Code:
sput v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
to line 52 before
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
now copy GlobalActions$10.smali and name it GlobalActions$11.smali
replace all instances of GlobalActions$10 with GlobalActions$11
then save recompile and everything is now added to run this mod!
chrystal0925 said:
No I didn't and it works fine
Sent from my MB855 using XDA App
Click to expand...
Click to collapse
Sounds good,and Thanks
Sent from my MB855 using xda premium
Welcome hope it helps!
Sent from my MB855 using XDA App
If anyone needs send me your framework apk and I can mod it for you to use
Sent from my MB855 using XDA App
how to change android.policy.jar. when i open it, its only contain manifest.mf. there is also android.policy.odex.
zeguym said:
how to change android.policy.jar. when i open it, its only contain manifest.mf. there is also android.policy.odex.
Click to expand...
Click to collapse
you need baksmali to decompile it. which rom are you on? if you cant get it send me the policy and framework.. once you decompile the policy it turns it into a classes.dex then you zip the policy using 7zip or winrar and you replace the new classes.dex with the one in the zip..
chrystal0925 said:
you need baksmali to decompile it. which rom are you on? if you cant get it send me the policy and framework.. once you decompile the policy it turns it into a classes.dex then you zip the policy using 7zip or winrar and you replace the new classes.dex with the one in the zip..
Click to expand...
Click to collapse
I use stock rom.
Can you kindly give step by step how to decompile and compile it again.
I already have baksmali, but when trying to decompile it, it always failed.
is this because stock rom is odex ? not deodex ?
zeguym said:
I use stock rom.
Can you kindly give step by step how to decompile and compile it again.
I already have baksmali, but when trying to decompile it, it always failed.
is this because stock rom is odex ? not deodex ?
Click to expand...
Click to collapse
That could be why I'm using deodex files.. I'm not to sure on directions I use a tool like a script its simple it was 2 commands one to decompile other to recompile.. as far as I know deodex is for theming Modding etc..
I was trying to see if you can use my files but your framework I've had people use my reboot mod on the echo on stock but the framework apk was a deodex version and the rest odex I could deodex it n try if you can post the apk I dont think I have a stock file but if so then you would just decompile my files and edit what I listed after adding to the frameworkapk. You can try this way as well
Sent from my MB855 using XDA App
ive tried flashing on top of an odex version with a completely stock version just deodex it dont work it has to many looping issues so recommend that your rom is deodex..
wrong post. deleted.
This is a simple mod for a very popular "feature." I think this approach is unique and may be beneficial as mms.apk is modified much more often than logsprovider. This is based on XWLA4 btw, Enjoy!
1. Decompile mms.apk with apk_manager or whatever.
2. Go to /smali/com/android/mms/transaction
3. Open MessagingNotification.smali and the two methods we are interested in are: updateHistoryForMms & updateHistoryForSms
These two functions basically build an sql query to insert the messaging entries into the log database.
4. Within both functions, we will simply comment out (place a # in front) the final insert. Here are the exact changes based on XWLA4:
(line 3669)
Code:
const-string v6, "content://logs/mms"
invoke-static {v6}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v6
[b]#[/b] invoke-virtual {v5, v6, v7}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
.line 1348
add-int/lit8 p2, p2, 0x1
(line 4002)
Code:
const-string p1, "content://logs/sms"
invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object p1
[b]#[/b] invoke-virtual {v1, p1, v9}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
5. And that's it, recompile, send to phone and reboot. Note that with this patch the log entries are never saved. So if someone gets a hold of your phone and tries to dig them up, you're fine!
Lastly, I haven't looked at the ICS code yet..I'm guessing it's pretty similar. I posted in themes because I don't have privileges to post in dev yet
Good work. I'll be waiting for the ICS version
This is awesome! Thank you. Ever since upgrading this has annoyed me. Will definitely try this when I get home!
This also works for the normal I9100.
Applied this to my Mms.apk from the Villain 3.0 ROM (Gingerbread).
The lines you're looking for are #3782 and #4142.
Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?
I'm on ICScewD v2.1 and mine is different. So I searched for "Content://logs/mms" and this is what it looks like:
Code:
const-string v16, "content://logs/mms"
invoke-static/range {v16 .. v16}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v16
move-object v0, v5
move-object/from16 v1, v16
move-object v2, v7
invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
.line 1319
const-string v7, "Mms/MessagingNotification"
Should I comment out
Code:
invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
?
And this is what it looks like for the sms:
Code:
const-string v0, "content://logs/sms"
invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v0
invoke-virtual {v1, v0, v9}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
.line 1242
So it worked out well. I commented out the
Code:
invoke-virtual {v0, v1, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
for mms and
Code:
invoke-virtual {v1, v0, v9}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;
for sms. Thank you!
Nice work fanatic!
I went ahead and checked mms.apk from ICS 4.0.3 LPQ, and it's pretty much identical. You can just search for 'insert' and it will land you on the 2 lines to comment out. I haven't tried ICS yet, so someone let me know how it goes.
DriftorX said:
Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?
Click to expand...
Click to collapse
Curious bout this also...
DriftorX said:
Anyone know if this holds true for the T-Mobile T989 Galaxy S2 as well?
Click to expand...
Click to collapse
crz6662 said:
Curious bout this also...
Click to expand...
Click to collapse
Likely. Definitely likely enough to try it. Or you can download Samsung Log Converter; I've heard it works if you're not into smali .
1. Decompile mms.apk with apk_manager or whatever.
2. Go to /smali/com/android/mms/transaction
3. Open MessagingNotification.smali and the two methods we are interested in are: updateHistoryForMms & updateHistoryForSms
These two functions basically build an sql query to insert the messaging entries into the log database.
4. Within both functions, we will simply comment out (place a # in front) the final insert. Here are the exact changes based on XWLA4:
Click to expand...
Click to collapse
Good day all ! Do I understand correctly that this will remove the logs sms and mms from logging calls? for firmware 2.2.1
Someone already tried? This method helps?
does it stop sms entry from showing up under favorites?
Hello guys.
First of all, I need to say something about the touchpad implementation:
there's many ways to implement the touchpad on the Xperia Play. Some of these ways works with CM9, and somes works only with the Sony's framework. This is a little obviously, as some games recognize the touchpad on CM9, and others don't.
I know about the fix we can make on the build.prop. But this will only work with the games that do a check on the device model and implements the touchpad in a compatible way with CM9.
FAQ
Why (programmatically) some games that uses touchpad does not work on CM9/CM10?
I can't say about all games, but some games uses the event onTouchEvent of the classes View or Activity to get the touchpad return. The CM9 does not support this return on this event. What Sony did on their framework is a way to activate the touchpad return over this event, that's not present on AOSP
What this fix does?
This fix change the CM9/CM10 framework.jar to, transparently, activate the touchpad return on the onTouchEvent. So, the games that uses this method to recognize the touchpad will begin to work.
How I use this fix?
FOR ICS USERS
FIRST: EDIT YOUR BUILD.PROP
First of all, you need to edit the build.prop because many games use some properties there to recognize the phone as a Xperia play! There's no a real rule, so, some games can look to one property, and others to another. Here you can take a look in what to do. Also, edit the build.prop can solve the circle button problem. here you can read why.
SECOND: FLASH THE ZIP
Do a nandroid backup and, then, flash the appropriated zip for your android version.
THIRD: INSTALL THE TOUCHPADACTIVATOR (FOR VERSION 0.6+)
Some games just can't activate the touchpads because some verifications that it did, like compare if the SDK Version é lesser than 13. Change this property and some others can cause many problems on the phone, so, I created an app to switch when the game need to activate the touchpad and when it's always activated. SOME APPS HAVE PROBLEMS TO DEAL WITH THE TOUCHPAD WHEN IT'S ALWAYS ACTIVATED, LIKE FPSE, so, with this app, you can switch the touchpad behavior as you need.
IMPORTANT:DO THE BACKUP OF YOUR FRAMEWORK.JAR, DO NOT DELETE IT, JUST IN CASE. If you want, you can do a nandroid backup to be more safe.
FOR JB USERS For now, you need to edit the ROM flashable zip. Extract the framework.jar from the JB fix and replace directly on the system/framework folder of the ROM zip. Then, extract the build.prop from the ROM zip, do the described changes, and put it back. After that, flashthe edited ROM zip and install the touchpad activator. The flashable zip is not working, idk why yet. For now, this is the only supported way until I can solve this.
The 'ALWAYS ACTIVATED' behavior that we can choose in the TouchpadActivator app can drain the battery life?
No. The battery life is not influenced by the chosen behavior. The term "ALWAYS ACTIVATED" just means that the touchpad events is always forwarded to the onTouchEvent, but the device is always listen to the touchpad doesn't matter what behavior you choose! (even without this fix)
What ROMs supports this fix?
It can works on CM9/CM10 based ROMs, you need to try to be sure. I tested it on CM10 FXP137 and CM9 FXP138, and maybe the creator of some custom ROM did changes on the framework for himself, and then this fix can be incompatible with his ROM, and it's very likely.
ROMs based on CM7 will not work with this fix because I'm using a new feature of the ICS.
Which games is fixed with this fix?
See post #3
This fix solve once for all the touchpad issues of CM9?
I can't say that. Maybe there's other way to get the touchpad return that is not compatible with CM9 already. Maybe Sony will do a update and change this rules. Only time will telll
My phone brick! What can I do now?
Restore your nandroid backup or rename back the old framework.jar. Just to be clear: I'm not responsible for any bricks or problems of your phone.
After apply the fix, some apps gives FC. Why?
Some games and apps gives FC if their data is downloaded before the fix. It's normal. Try the app a second time, it works on almost every time. If it's keeping FC, then clear the app data and try again. Remember that some games download the data in two steps (first part download, then the app is closed and you need to open it again to proceed). If even with this the app keeping FC, post a logcat on this thread, the ROM you're using, what app is giving those troubles and any other info that you think it's useful.
The touchpad is not recognizing at all. Why?
As I need to make many tests and reboot the phone... It's very likely that I let the gamepad slided down. But, after some pain I realize that when I didn't slide down the gamepad after the reboot, the touchpad doesn't work (That is, the gamepad was already slided down, so, I didn't do it after the reboot). So, if anyone experiencing this problem, just slide up and down the gamepad and test again. This is the only situation that something like that happened to me.
What is PointerID?
pointerID is just an identification for your finger when it is touching the touchpad. It's a way to the phone know what is each finger. On GB, this ID start at 1 (finger 1, finger 2, etc...). On ICS, it start at 0 (finger 0, finger 1...). Some games do some shameful validation based that the first id will always be 1 and then get problems on GB. This is why this option is included. As it is a new resource and I'm considering it experimental, when you reboot the phone the pointerID will allways be setted to start at 0.
The pointerid starting at 1 is working better than starting at 0. Can this be the default behavior?
Yes, you can set the pointerid starting at 1 as the default behavior. Just put on the build.prop this: mod.touchpad.startfrom1 = 1. You can do this by yourself if you feel that this new behavior is better than the default one. The idea is remove this switcher and let the pointerID permanently starting at 1 (as it is on GB), but I need to do some tests to make sure that all will work okay.
There's a GB version planned for the future?
No. I'll not make a GB version for this fix, for two reasons:
1 - It's a completely different fix. The concept of this fix is based on the onGenericMotionEvent, that exists since ICS. To make a GB version we need to analyse the stock GB support for touchpad entirely, not just the framework java code, and probably will be only possible to implement directly in the sources.
2 - I don't have interest. I think we have to look forward, and we have GB ROMs good enough for gaming. Also soon, with the V 3.0 of the turbo kernel, we can make a dual boot with GB and desired ROM and then use GB just for games.
Do I need to install the touchpad activator?
No. You don't need. Editing the build.prop and flashing the zip/replacing the framework probable will be enough to get good results. BUT some games need to be tricked to get the touchpad working. For example: Max Payne checks the SDK version to activate or not the touchpad. You can't change the SDK Version in the build.prop, otherwise you'll get big problems (like the data partition wiped) when you reboot the ROM. So, to avoid this problem, you need to set the touchpad behavior, in the touchpad activator, to ALWAYS ACTIVATED. The option to set the pointer ID s becoming obsolete, because every game should work with pointerID starting at 1. The next version of the activator will not have this property anymore and this option will be setted directly in the build.prop
IS VERY RECOMMENDED TO INCLUDE IN THE BUILD.PROP THE FOLLOWING LINE
Code:
mod.touchpad.startfrom1=1
This option doesn't affected any tested game and can improve the touchpad compability in anothers
DOWNLOAD
CM9 Version 1.1 (Flashable zip) for FXP 147 or later here
CM9 Version 1.1 (Flashable zip) for FXP 146 or less here
CM10 FXP149 or later Version 1.1 (not flashable zip! replace the file in the ROM zip) here
AOKP-ICS Version 1.0 here
AOKP-JB Version 1,1 (not flashable zip) here
Paranoid-ICS Version 1.0 here
TouchpadActivator V 1.3 (apk): here (Have test for app side activation and pointer ID switch)
TouchpadActivator V 1.1 (apk): here
TouchpadActivator V 1.3 (Source): here
TouchpadActivator V 1.1 (Source): here
FIX FOR Markphyton ROM This fix will add the ALWAYS ACTIVATED behavior. You need to replace the framework files with the ones on the zip (THIS IS NOT A FLASHABLE ZIP) and delete any .odex of the framework folder. Also, install the TouchpadActivator to change the touchpad behavior
THANKS TO:
CosmicDan, for the support and the help with Sony framework!
cj360 for the AOKP-ICS version 0.4
wedgess, for the help with the java edit instructions!
THANKS TO THE PEOPLE HELPING TO TEST THIS FIX (I tried to list all the ones that gave me some feedback. If I forgot someone, please, tell me )
abrahamt24, bamsbamx, benben972, chery2k, CosmicDan, Dany XP, gopin, hitman980206, jimmyvau, karma123, Lordomn, MilkyJoePD, olokos, solomon4400, thi3um, wuby
Instructions to change the framework.jar FOR DEVS
IF YOU WANT EQUIVALENT INSTRUCTIONS TO EDIT JAVA SOURCODE, TAKE A LOOK HERE
VERSION 1.1
CHANGES:
V 1.2 Now, the changes on the View.smali checks if the device is a Xperia PLAY. So, the framework edited can be used on other compatible devices without side effects
V 1.1 Added support to switch the initial pointerId for the touchpad
V 1.0 The implementation follow the Sony framework source code now, but probably we'll not feel any difference on the touchpad support (probably)
V0.6 Created support to the property mod.touchpad.activated to set when the touchpad is always activated and when the game need to activate it. Also, it's offer support to the app TouchpadActvation.apk
V0.5 Touchpad activation implemented
V0.4
The ViewRoot method is not static anymore and return void
The new class ViewRoot is now parent of ViewRootImpl.
The dispatchGenericMotionEvent had been modified on other classes, the verification of BIND_TOUCHPAD_ONTOUCH is removed
First, you need to decompile the framework, I'm using Virtuous Ten studio to do it. This IDE use the apktool to generate the code, so, to everyone using apktool too, the code will be the same.
Now, make the following steps:
INSTRUCTIONS
Copy the ViewRoot.smali from the attachment to the /android/view folder of the decompiled framework.
At the beginning of the ViewRootImpl.smali, insert the line in red:
Code:
# interfaces
.implements Landroid/view/ViewParent;
.implements Landroid/view/View$AttachInfo$Callbacks;
.implements Landroid/view/HardwareRenderer$HardwareDrawCallbacks;
[B][COLOR="Red"].implements Landroid/view/ViewRoot;[/COLOR][/B]
Then, still on ViewRootImpl.smali, insert this method at the end of the file
Code:
.method public setProcessPositionEvents(Z)V
.locals 1
iget-object v0, p0, Landroid/view/ViewRootImpl;->mView:Landroid/view/View;
if-eqz v0, :cond_9
iget-object v0, p0, Landroid/view/ViewRootImpl;->mView:Landroid/view/View;
invoke-virtual {v0, p1}, Landroid/view/View;->setProcessGenericMotionAsPointer(Z)V
:cond_9
return-void
.end method
Insert this method at the end of the View.smali:
Code:
.method public sendTreatAsTouchEvent(Landroid/view/MotionEvent;)I
.locals 6
.parameter "event"
.prologue
const/4 v3, 0x0
const/4 v2, 0x1
const/4 v1, 0x0
const/4 v0, 0x0
sget-object v4, Landroid/os/Build;->BRAND:Ljava/lang/String;
const-string v5, "SEMC"
invoke-virtual {v4, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v4
if-eqz v4, :cond_3b
sget-object v4, Landroid/os/Build;->MODEL:Ljava/lang/String;
const-string v5, "R800"
invoke-virtual {v4, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
move-result v4
if-eqz v4, :cond_3b
invoke-virtual {p1}, Landroid/view/MotionEvent;->getSource()I
move-result v4
const v5, 0x100008
if-ne v4, v5, :cond_3c
move v0, v2
:goto_22
if-eqz v0, :cond_3b
iget-boolean v0, p0, Landroid/view/View;->mProcessGenericMotionAsPointer:Z
if-nez v0, :cond_32
const-string/jumbo v4, "mod.touchpad.activated"
invoke-static {v4, v3}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v4
if-ne v4, v2, :cond_3e
move v0, v2
:cond_32
:goto_32
if-eqz v0, :cond_3b
invoke-virtual {p0, p1}, Landroid/view/View;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z
move-result v3
if-eqz v3, :cond_40
move v1, v2
:cond_3b
:goto_3b
return v1
:cond_3c
move v0, v3
.line 17967
goto :goto_22
:cond_3e
move v0, v3
goto :goto_32
:cond_40
const/4 v1, 0x2
goto :goto_3b
.end method
.method setProcessGenericMotionAsPointer(Z)V
.locals 0
iput-boolean p1, p0, Landroid/view/View;->mProcessGenericMotionAsPointer:Z
return-void
.end method
Still on View.smali, insert the property in red:
Code:
.field private mPerformClick:Landroid/view/View$PerformClick;
[B][COLOR="red"].field private mProcessGenericMotionAsPointer:Z[/COLOR][/B]
.field mPrivateFlags:I
Finnally, insert this lines on the dispatchGenericMotionEvent (in red):
Code:
.method public dispatchGenericMotionEvent(Landroid/view/MotionEvent;)Z
.locals 5
.parameter "event"
.prologue
const/4 v3, 0x0
const/4 v2, 0x1
[B][COLOR="red"] invoke-virtual {p0, p1}, Landroid/view/View;->sendTreatAsTouchEvent(Landroid/view/MotionEvent;)I
move-result v1
.line 7184
if-eqz v1, :cond_g
sub-int v2, v1, v2
goto :goto_3b
[COLOR="SeaGreen"]<<<<< ATTENTION, THIS goto MUST BE EXACTLY THE SAME COMMAND OF THE LAST LINE OF THE METHOD[/COLOR]
:cond_g[/COLOR][/B]
.line 5597
iget-object v4, p0, Landroid/view/View;->mInputEventConsistencyVerifier:Landroid/view/InputEventConsistencyVerifier;
... ... ... (THE CODE OF THE METHOD) ... ... ...
.end method
FOR SWITCH THE START POINTER ID FOR THE TOUCHPAD
Add this methods to the end of the android/view/MotionEvent:
Code:
.method public addPointerId(I)I
.locals 2
.parameter "pointerId"
.prologue
move v0, p1
invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
move-result v1
if-eqz v1, :cond_1
const/4 v1, 0x1
add-int/2addr v0, v1
:cond_1
return v0
.end method
.method public modPointerId(I)I
.locals 2
.parameter "pointerId"
.prologue
move v0, p1
invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
move-result v1
if-eqz v1, :cond_1
const/4 v1, 0x1
invoke-virtual {p0}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v1
if-lt v0, v1, :cond_1
const/4 v0, 0x0
:cond_1
return v0
.end method
.method public subPointerId(I)I
.locals 2
.parameter "pointerId"
.prologue
move v0, p1
if-eqz v0, :cond_1
invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
move-result v1
if-eqz v1, :cond_1
const/4 v1, 0x1
sub-int/2addr v0, v1
:cond_1
return v0
.end method
.method public pointerIdStartFrom1Plus()I
.locals 3
.prologue
const/4 v2, 0x0
invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1()I
move-result v0
if-eqz v0, :cond_1
sget v0, Landroid/view/InputDevice;->SOURCE_TOUCHPAD:I
invoke-virtual {p0}, Landroid/view/MotionEvent;->getSource()I
move-result v1
if-ne v0, v1, :cond_1
const/4 v2, 0x1
:cond_1
return v2
.end method
.method public pointerIdStartFrom1()I
.locals 2
.prologue
const/4 v0, 0x0
const-string/jumbo v1, "mod.touchpad.startfrom1"
invoke-static {v1, v0}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I
move-result v0
return v0
.end method
Add (or change) the lines in red to the following methods:
Code:
.method public final getPointerId(I)I
.locals 2
.parameter "pointerIndex"
.prologue
.line 1927
iget v0, p0, Landroid/view/MotionEvent;->mNativePtr:I
invoke-static {v0, p1}, Landroid/view/MotionEvent;->nativeGetPointerId(II)I
move-result v0
[COLOR="red"] invoke-virtual {p0, v0}, Landroid/view/MotionEvent;->addPointerId(I)I
move-result v0[/COLOR]
return v0
.end method
... ... ...
.method public final getPointerIdBits()I
.locals 5
.prologue
.line 2786
const/4 v1, 0x0
.line 2787
.local v1, idBits:I
iget v3, p0, Landroid/view/MotionEvent;->mNativePtr:I
invoke-static {v3}, Landroid/view/MotionEvent;->nativeGetPointerCount(I)I
move-result v2
.line 2788
.local v2, pointerCount:I
const/4 v0, 0x0
.local v0, i:I
:goto_0
if-ge v0, v2, :cond_0
.line 2789
[COLOR="red"]
invoke-virtual {p0, v0}, Landroid/view/MotionEvent;->getPointerId(I)I
[/COLOR]
move-result v4
shl-int/2addr v3, v4
or-int/2addr v1, v3
.line 2788
add-int/lit8 v0, v0, 0x1
goto :goto_0
.line 2791
:cond_0
return v1
.end method
... ... ...
.method public final getX(I)F
[COLOR="red"] .locals 4[/COLOR]
.parameter "pointerIndex"
.prologue
.line 1974
[COLOR="red"]invoke-virtual {p0, p1}, Landroid/view/MotionEvent;->modPointerId(I)I
move-result v3[/COLOR]
iget v0, p0, Landroid/view/MotionEvent;->mNativePtr:I
const/4 v1, 0x0
const/high16 v2, -0x8000
invoke-static {v0, v1, [COLOR="red"]v3[/COLOR], v2}, Landroid/view/MotionEvent;->nativeGetAxisValue(IIII)F
move-result v0
return v0
.end method
... ... ...
.method public final getY(I)F
[COLOR="red"] .locals 4[/COLOR]
.parameter "pointerIndex"
.prologue
.line 1989
[COLOR="red"]invoke-virtual {p0, p1}, Landroid/view/MotionEvent;->modPointerId(I)I
move-result v3[/COLOR]
iget v0, p0, Landroid/view/MotionEvent;->mNativePtr:I
const/4 v1, 0x1
const/high16 v2, -0x8000
invoke-static {v0, v1, [COLOR="red"]v3[/COLOR], v2}, Landroid/view/MotionEvent;->nativeGetAxisValue(IIII)F
move-result v0
return v0
.end method
Now, you need to rename the method split to split2, and add this method:
Code:
.method public final split(I)Landroid/view/MotionEvent;
.locals 2
.parameter "idBits"
.prologue
move v1, p1
invoke-virtual {p0}, Landroid/view/MotionEvent;->pointerIdStartFrom1Plus()I
move-result v0
if-eqz v0, :cond_1
const v0, 0x1
shr-int/2addr v1, v0
:cond_1
invoke-virtual {p0, v1}, Landroid/view/MotionEvent;->split2(I)Landroid/view/MotionEvent;
move-result-object v0
return-object v0
.end method
IMPORTANT: If you're not using apktool or virtuous ten studio, the best is to decompile the jar and look to the smali changed to see how the code will looks like
We will try to describe any other problems with the games we found too. BUT, it's not means that the fix cause the problems. It'll be very appreciate if someone that read some non touchpad related problem here can confirm that happens without the fix too
SOME GAMES HAVE LAGS WHEN USING THE TOUCHPAD WITH CM10. It's not a issue of the fix, it's a issue we identify on CM10. You can try FPSe without the fix and use the touchpads to see for yourself. The games we identify with this problem we'll say.
TIP ABOUT GAME TESTING
if you tried any game optimized to xperia play using this fix and it works, please, tell us so we can update this list!
if you had some trouble with a xperia play optimized game, then, again, tell us so we can improve the fix
Finally, if you get FCs with some game when you tried, then send to us a logcat so we can look at the reason and search for a solution This is very important! This fix already brought a very improvement on the touchpad compability, but we is still working to improve it, and we need information and your help to it
Games where the touchpad is working (maybe some game was already working, I can't tell ):
9mm (ICS) Works but very laggy
Amazing spiderman (ICS)
Asphalt 7 (ICS)
Asphalt 6 (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB
Backstab (ICS) (JB)
brothers in arms 2 free+ (ICS) Works with some bugs when you use two fingers on the touchpad NEED POINTER ID STARTING FROM 1
Call of Duty - Zombies (ICS)
Cyberlords - Arcology (ICS)
Dead on arrival (ICS)
Dead Space (ICS) (JB) Touchpad works on version 1.1.33. Actually the game works perfectly with this version on ICS. But the current version on the play store is 1.1.39, and we have reports that in this version the touchpad is not recognized.
Dead Trigger (ICS) (JB)
Desert winds (ICS)
Dungeon Defenders (ICS) NEED POINTER ID STARTING FROM 1
Eternity warriors (ICS)
Fifa 10 (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB. On ICS, I didn't feel any lag but the sound is cutting while we touch the left touchpad
Fifa 12 (ICS) (JB)
Fight heroes (ICS)
FPse (ICS) (already was working). You need to let the touchpad activation for the app
GraviTire 3D (ICS)
GTA III (JB) Touch is used for changing the radio. LAGS WHEN USING TOUCHPAD ON JB
GTA Vice city (JB) This game doesn't use the touchpads. LAGS WHEN TOUCH THE TOUCHPADS ON JB
Guerilla bob (JB)
Gun bros (ICS) Sometimes (when a message appear, I think) You need to release the touchpad and press again... but I think it's a game implementation problem
Lara croft and the guardian of light (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB
Max payne (ICS) (JB) Need the touchpad always activated (you can switch it with V0.6+)
Minecraft Pocket edition (ICS) (JB) FREE OF JB LAG (already was working)
Modern combat 3 (ICS) (JB) LAGS WHEN USING TOUCHPAD ON JB
Modern combat 4 (ICS)
Mupen64plus (ICS) (JB) (already was working)
Need For Speed Most Wanted (JB) This game don't user triggers or touchpads. Actually, Touchpad is used for scroll the map, but probably because some misimplementation
Nova 3 (ICS) (JB) You need V 1.0.2 to get this working with the XPlay because Gameloft took off the support to our device
Rises of Glory (ICS) (JB)
Samurai vegeance II (ICS)
Shadow gun (ICS) (JB)
Six Guns (ICS)
Sonic 4 Ep.2 (ICS) This game does not use touchpads, but the gamepad is recognized with the fix (probably with the STEP 1)
Start Batallion (ICS) Works with some bugs when you use two fingers on the touchpad NEED POINTER ID STARTING FROM 1
The Bard's Tale (ICS) (JB) FREE OF JB LAG Apparently this game have native implementation of the touchpad, what means that it don't need the fix to work
The Dark Knight Rises (ICS)
USB/BT Joystick Center 6 (ICS) With this app you can map touchscreen areas to the gamepad and touchpad, making a non optmized game can be played with the xperia play buttons. You can see how to config it here. The result is good in some games and bad in another.
Wild Blood (ICS)
Games where the touchpad is not working
Galaxy on Fire II (ICS) (jb) FREE OF JB LAGTouchpad works and the screen button is gone, but the gamepad don't work. You need to push the area of the screen where the buttons mus be in if you want to play
Nova 2 (JB) touchpad non working + graphical bug at the menu ( not in the game) NEED A NEW TEST FOR V 0.3
OnLive (ICS) Last report: touchpad working gamepad don't. I'm waiting for more details (more details about how to get more details here)
Pewpew (ICS) -The touchpad of this game doesn't work well in the ICS, even without the fix, the touchpad is detected but it's messed up. You can use the cross to move and the buttons to shot. Each button shot in one direction, so, it's like a second cross in the gamepad.
THE KING OF FIGHTERS Android (ICS) This game doesn't use the touchpad, just the gamepad, but the gamepads isn't treated well on ICS... WORKD WELL ON MIUI AUSTRALIA. INVESTIGATING WHY
farenheith said:
OP updated. Please, guys! Do some tests so I can be more sure about this fix. I'll do it myself too.
Click to expand...
Click to collapse
I'm still debating on installing FXP 138 soon, and when I do I will definitely help test
johnnzey said:
I'm still debating on installing FXP 138 soon, and when I do I will definitely help test
Click to expand...
Click to collapse
What ROM are you using? if it's CM9 based, the fix must work, because the framework.jar did not changed since 2008 (at least this is the modified date of the original file ).
If your ROM is CM9 and you can make a test will be great, because I'll can update the OP with the info
Nice work! Was going to help bit you already did it, fantastic
I'll make a windows tool to patch an existing ROM on your phone with the patch. So people can plug in their phone and run the batch file and test it out.
Sent from Xperia Play (R800a) with Tapatalk
I tried to make a flashable zip but I don't know what I did wrong xD. When I was flashing the zip the framework.jar was not been replaced.
I lost like 3 hours because of this
So I give up and started to copy the file manually xD
farenheith said:
I tried to make a flashable zip but I don't know what I did wrong xD. When I was flashing the zip the framework.jar was not been replaced.
I lost like 3 hours because of this
So I give up and started to copy the file manually xD
Click to expand...
Click to collapse
Lol... did you tell the script to mount system?
Yeah I guess a patch tool for Windows is not really needed, but it may remove the need to update the framework for every new CM9/CM10 release.
yeah, actually is just used a default flashable zip that use sometimes. I just change de files on the system folder.
This is the commands of the script:
show_progress(0.0, 0);
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
show_progress(1.0, 1);
unmount("/system");
farenheith said:
yeah, actually is just used a default flashable zip that use sometimes. I just change de files on the system folder.
This is the commands of the script:
show_progress(0.0, 0);
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
show_progress(1.0, 1);
unmount("/system");
Click to expand...
Click to collapse
Yeah that looks fine, strange. Maybe it needs a dalvik-cache wipe too, even though I thought ICS and later can detect stale dalvik and regenerate it sometimes helps. But wait, you say the framework.jar isn't even replaced? Dunno!
EDIT: BTW, I have Asphalt 6 and Dungeon Defenders - both of which touchpads didnt work before. I am putting this mod into Turbo MIUI and will test and let you know!
EDIT2: Use the CM9/CM10 update-binary and use this mount line in your script:
Code:
mount("yaffs2", "MTD", "system", "/system");
Anyone knows if star battalion have touchpad support?
Great! were getting somewhere without Sony's help... when do you think you would fully release it?
x1rocket said:
Great! were getting somewhere without Sony's help... when do you think you would fully release it?
Click to expand...
Click to collapse
It's already out dude, just push/copy the framework.jar to /system/framework/ and try your games and report if any still don't work.
Exactly. Actually, I just put this fix as an Alpha release because, maybe , I need to implement some other trick if some game have a different method to access the touchpad. I just want to be more sure before of say something like "full touchpad support", If I don't have proofs yet.
Edit: BTW, CosmicDan. Your ROM Turbo MIUI is JB, right? When you test the games will be very good then! I wonder if using JB I can play something like GTA, without freeze the phone
farenheith said:
Exactly. Actually, I just put this fix as an Alpha release because, maybe , I need to implement some other trick if some game have a different method to access the touchpad. I just want to be more sure before of say something like "full touchpad support", If I don't have proofs yet.
Edit: BTW, CosmicDan. Your ROM Turbo MIUI is JB, right? When you test the games will be very good then! I wonder if using JB I can play something like GTA, without freeze the phone
Click to expand...
Click to collapse
I tested gta on jb and it didnt freeze the phone.
Sent from my R800i
CosmicDan said:
Yeah that looks fine, strange. Maybe it needs a dalvik-cache wipe too, even though I thought ICS and later can detect stale dalvik and regenerate it sometimes helps. But wait, you say the framework.jar isn't even replaced? Dunno!
EDIT: BTW, I have Asphalt 6 and Dungeon Defenders - both of which touchpads didnt work before. I am putting this mod into Turbo MIUI and will test and let you know!
EDIT2: Use the CM9/CM10 update-binary and use this mount line in your script:
Code:
mount("yaffs2", "MTD", "system", "/system");
Click to expand...
Click to collapse
Thanks to CosmicDan now I could create a flashable zip .
And I have released a new version. I made a change on the code of Activity.smali, but the way it was before it's fine too. It just a check to make sure that the only event that will be forward to the onTouchEvent is the TOUCHPAD ones.
i get bootloop with [ROM][AOKP][JB][BETA]KXP for PLAY[Build 2]
this is what i did
set permissions
push the framework.jar to /system/framework/
restart
stay in boot logo
karma123 said:
i get bootloop with [ROM][AOKP][JB][BETA]KXP for PLAY[Build 2]
this is what i did
set permissions
push the framework.jar to /system/framework/
restart
stay in boot logo
Click to expand...
Click to collapse
aokp needs to modded to work with this, I'll do it later if I can.
Sent from my Xperia Play using xda premium
that will be awsome thanks
karma123 said:
that will be awsome thanks
Click to expand...
Click to collapse
Just to be sure, what framework.jar did you pushed? If you pushed the CM9 one, you can try the CM10 one. If you pushed the CM10, then send me the original framework.jar of the AOKP. Probably they did some change on the framework. If you send me this file, I can do the changes described on the post #2 for you.