Google Voice outgoing call on WiFi-only GT P7510 - Galaxy Tab 10.1v Android Development

got a GT-P7510 last week which is WiFi-only. my first thought was why can't i make free phone calls out from Google Voice. it turned out to be quite a daunting task. if you happened to have tried installing GV from either market or a custom-made apk for Xoom (see thread: http://forum.xda-developers.com/showthread.php?t=984111), then you'd have an idea what i'm talking about. even with a working GV on my phone, if i pull out the SIM and connect Wifi, when calling out with GV it complains that "Mobile network not available" regardless that the internet is perfectly connected!! WTF!
with the help of seo from another thread i'm now able to get a little further into this quest. if you also need a bit help decompiling and recompiling jar/apks, and updating core apps and resources, please refer to these 2 posts:
http://forum.xda-developers.com/showpost.php?p=20392590&postcount=82
http://forum.xda-developers.com/showpost.php?p=20439914&postcount=84
basically at this time i'm focused on Phone.apk and telephony under framework.jar. the following is what i have discovered so far.
1. update "framework-res.apk", under res/values/bools.xml, set the following values to true:
Code:
<bool name="config_voice_capable">true</bool>
<bool name="config_built_in_sip_phone">true</bool>
after this step, the phone app shows up and contacts app now allows to invoke the phone when a phone number is pressed. however, instead of showing up the in-call UI, it crashes the phone app. also, the phone app does not show the dialpad. it goes directly into contacts.
2. i investigated the crash and found it was because of PhoneUtils.okToAddCall() checking the phone type, which returned NONE and got it freaked out. digging deeper, i realized that com.android.phone registered a default phone as a faked GSMPhone. the code is under frameworks/base/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java. instead of setting the phone type to PHONE_TYPE_GSM, it uses PHONE_TYPE_NONE ! i dont have HC source code to refer to but i doubt this was the original coding from google. it appears to me that samsung might have modified the code to block off all phone accesses.
in smali i updated both getPhoneType() method and the ctor where setPhoneType() was called to apply PHONE_TYPE_GSM. now it doesnt crash anymore. however, instead of dialing out, now i'm seeing "Mobile network not available" message instead.
3. to prevent the GSM network check from kicking in, i then modified smali/com/android/phone/InCallScreen.smali in Phone.apk. in method checkIfOkToInitiateOutgoingCall(), update the switch jump-table to return InCallInitStatus.SUCCESS on OUT_OF_SERVICE. the change is shown in the following:
Code:
.line 2740
:pswitch_data_0
.packed-switch 0x0
:pswitch_0
:pswitch_3 ==> :pswitch_0
:pswitch_2
:pswitch_1
.end packed-switch
after this change, the error message doesnt show up any more.
but at this time, the call didnt really happen. another null-pointer exception was thrown from GsmCallTracker.smali when handling EVENT_GET_LAST_CALL_FAIL_CAUSE message. at the code:
Code:
.line 1083
.local v3, conn:Lcom/android/internal/telephony/gsm/GsmConnection;
invoke-static {}, Lcom/android/internal/telephony/NonstaticTelephonyFeature;->getInstance()Ljava/util/Map;
move-result-object v7
# <<<< if-eqz v7, :cond_e8
const-string v8, "CONFIG_FULL_DISCONNECT_CAUSE"
invoke-interface {v7, v8}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
apparently it did check the return value of NonstaticTelephonyFeature().getInstance(). adding the check "if-eqz v7, :cond_e8" as shown above shields off the FC.
this also revealed another problem: looks like the underlying GSM state machine returned an error so the call cound not continue. it is very interesting to see that GV actually plugs itself here and there very intimately into the innerworks of the GSM phone, maybe even piggyback on the GSM state machine while making the call.
this is where i am now before i put it down a bit. will come back for more when i have some spare time.
- lt

or just download GrooveIP from the market and you can make calls too.

Is it just me or can you now make calls with GV using 3G connection?

Yes

Related

Market issues ...

I am not sure how many others out there may have experienced the issues I am about to describe, but it is extremely annoying. So I am asking all devs out there to please hear out this issue. I have searched all over for a solution with no result.
ISSUE:
Every action I perform in the Market takes nearly about 1 minute. So for instance, just opening Market takes about 1 minute to load the default Market home screen. So then I see an app I am curious of and click on it. It then takes another minute before the content about the app is fully displayed. Then lets say I want to install the app and click install. If permissions are required, it then takes another minute before that dialog fully displays with the OK/Cancel buttons. Then when the install completes, I can see in the notification bar that the application installed successfully, but the status of the app in the Market remains in the Installing state until I reboot my phone.
Other issues I have noticed is that going to GAMES --> ALL GAMES or APPS --> ALL APPS, I do not see the top paid apps or top paid games.
I have seen this behavior for all apps purchased and free.
Here are other factors. I have experienced this issue on both stock and custom ROMS. I am a big fan of Cyanogen and have tried the various methods on his wiki with no success. I have experienced this issue on different phones as well (i.e. G1, MyTouch3G, Droid & Nexus One). I called Nexus One support and ran through all of their usual troubleshooting methods with no success. They eventually gave up and told me it was a T-Mobile problem.
Here's the other odd issue is that if I wipe my phone and log in with my wife's account, I don't have this problem. Google suggested I setup a new account, but that is not happening. I have had my gmail account since the beginning of time when they first offered trials for gmail. I also have purchased around 70 apps through the market.
Here is a logcat output I captured while attempting to download an app:
http://pastebin.com/BXWkS8DJ
Any help would be greatly appreciated because I am now starting to lose interest in the Market because of this issue.
UPDATE: I did create a new account and the issue goes away, but my account still has the issue. Also tried the file posted, with no success. This issue really seems to be account-related.
Thanks!
java.net.SocketTimeoutException: The operation timed out...
Click to expand...
Click to collapse
Are you using 3G, EDGE or WiFI??
From what I see... you've got network issues... or rather something in your network is interfering with the connection to the market... but it's rather confusing and strange when you say another google account works well...
Try connecting to another network and see if thing work out...
Whenever I use the market app, when I go to "just in" ill scroll like 20 apps and then it repeats them and adds like 10 more then repeats all of them and adds a couple each time after that. Plus the vast majority the time I use the app it loses connection but data says 3g. So I hit retry like 10 times then exit app and start again but always have to restart phone. I haven't rooted so I think its just another software issue. I've tried clearing cache and I've wiped the phone but Android has all kinds of software problems I'm sure it will be addressed in due time...
craigacgomez said:
Are you using 3G, EDGE or WiFI??
From what I see... you've got network issues... or rather something in your network is interfering with the connection to the market... but it's rather confusing and strange when you say another google account works well...
Try connecting to another network and see if thing work out...
Click to expand...
Click to collapse
Hi thanks for the reply.
I have tried both 3G and WIFI with the same outcome. My WIFI is connected to my home network which measures speeds at about 4Mbps as opposed to the 3G which is at about 0.2 - 1Mbps. Also I am on T-Mobile's network.
I do agree that it really sounds like a network issue, but why wouldn't it work over WIFI. I have also tried putting my phone in Airplane mode to cut off the mobile connection and then enabled wifi to force the connection through wifi. But still no dice. I have wiped and reloaded with different ROMS many, many times all resulting in the same outcome. I was hoping that now that I have a Nexus and can get direct phone support from Google, that maybe the Google gods would fix my issue. But so much for wishful thinking. I am still stuck. I remember there was a time when I had my G1 and the Market worked great. I wound up eventually with over 500 apps installed. Now the Market crawls so slowly that I have lost interest in waiting to see whats new.
The funny thing is my MyTouch with my wifes account browses so much quicker in the Market than my Nexus. I should post a video of the two together. I can literally pull up an app and install it on the MyTouch quicker than just pulling up an app on my Nexus.
DMaverick50 said:
Whenever I use the market app, when I go to "just in" ill scroll like 20 apps and then it repeats them and adds like 10 more then repeats all of them and adds a couple each time after that. Plus the vast majority the time I use the app it loses connection but data says 3g. So I hit retry like 10 times then exit app and start again but always have to restart phone. I haven't rooted so I think its just another software issue. I've tried clearing cache and I've wiped the phone but Android has all kinds of software problems I'm sure it will be addressed in due time...
Click to expand...
Click to collapse
I have seen that issue before too where there is a duplication of apps listed. I would gladly take that issue back to give up the one I have now.
thenefield said:
Hi thanks for the reply.
I have tried both 3G and WIFI with the same outcome. My WIFI is connected to my home network which measures speeds at about 4Mbps as opposed to the 3G which is at about 0.2 - 1Mbps. Also I am on T-Mobile's network.
I do agree that it really sounds like a network issue, but why wouldn't it work over WIFI. I have also tried putting my phone in Airplane mode to cut off the mobile connection and then enabled wifi to force the connection through wifi. But still no dice. I have wiped and reloaded with different ROMS many, many times all resulting in the same outcome. I was hoping that now that I have a Nexus and can get direct phone support from Google, that maybe the Google gods would fix my issue. But so much for wishful thinking. I am still stuck. I remember there was a time when I had my G1 and the Market worked great. I wound up eventually with over 500 apps installed. Now the Market crawls so slowly that I have lost interest in waiting to see whats new.
The funny thing is my MyTouch with my wifes account browses so much quicker in the Market than my Nexus. I should post a video of the two together. I can literally pull up an app and install it on the MyTouch quicker than just pulling up an app on my Nexus.
Click to expand...
Click to collapse
OK, I see you've done a lot to try to resolve this... and I do believe u've got a really weird problem!!!
You say ur's wife's account works well on ur N1 rite?? Could you try ur account on ur wife's MyTouch? If you have the same problem there... there's something wrong with ur google account (i think!!)... in that case, try reconfiguring all configurations & stuff on your account via the google dashboard....
Hi,
Did you managed to fix the issue?
I now face the same problem
it's really google account issue, as i create a new google account from the phone and the market works just fine.
run fix_permissions from the terminal emulator
gtrplr71 said:
run fix_permissions from the terminal emulator
Click to expand...
Click to collapse
that solved it!
Thank you!
Really??? A simple fix_permissions fixed the issue for you???
Mine eventually fixed itself somehow magically.
This issue is very strange though.
It only happends with my account. If I create a new account I don't have the issue.
What I have noticed is that when the issue occurs, I am missing my device ID hash in the market shared_prefs file. When the issue goes away, my device ID hash gets created.
I have also noticed that when I replaced my shared_prefs file when having the issue with the one that has my device ID hash, the issue instantly goes away.
One last funny note, Google recommend I call T-Mobile on the issue. When I called T-Mobile the rep said all of these symptoms are normal because that's how their support phones operate. They argued me down that there is no such thing as a "Top Paid" tab. Apparently they had the same issue and felt it was normal.
i was just about to write a post here...
well, the 'fix_permissions' worked but now i flashed a new rom and the issue came back
now fix_permissions doesn't work either
how can i get the right shared_prefs file? i will save him in the sdcard and run a simple script to override file when i will get this issue. but i need a "working" file
how long did you have to wait till it was fixed?
could be related to the developer account (to publish applications) that i just added to me google account?
Hopefully you did a backup before a wipe.
The specific file is:
/data/data/com.android.vending/shared_prefs/vending_preferences.xml
If you did do a backup, restore to your backup and copy that file to your sdcard.
Then you can do a wipe and replace that file after booting and logging in.
Don't forget to reset the permissions of the file to 660 (rw-rw----).
If you didn't have a backup, I'm not sure what else to say. I waited months before this got fixed and google never offered a permanent solution.
The device id hash seems to be created from collection of user account and hardware info. Using the file generated from a new account would not work on my original account.
nooooo!
i want my id! i didn't do any nandroid backup for the working one...
ho god, please bring the black smock and give me my market back!
months? you waited months?? grrrr
yes!!
woohooo
no need to special hash id
what i did is pushed this file (to /data/data/com.android.vending/shared_prefs/vending_preferences.xml):
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<boolean name="local_db_sync_required" value="false" />
<int name="SERVER_VERSION" value="1000" />
<string name="vending_tos_version">1.0.0</string>
<long name="MARKET_LAST_HEARTBEAT_TIMESTAMP" value="1271657433127" />
<long name="last_sync_time" value="1271659724720" />
<long name="last_tickle_id" value="1271657514775" />
<int name="reconciled_version" value="1710" />
<boolean name="metadata_paid_apps_enabled" value="true" />
<string name="vending_backup_state">vending</string>
<string name="vending_tos_version">1.0.0</string>
</map>
you can probably lose the time stamps keys, but it doesn't matter, the application will change it by himself
after pushing you can fire up the market and bang! working like a charm!
if someone knows why this thing happen and how to _really_ solved not but workaround i will more then happy to learn how
Hi, I push the file vending_preferences.xml with:
adb push vending_preferences.xml /data/data/com.android.vending/shared_prefs/vending_preferences.xml
And the market is slow... How I can put the file well?
are you sure that the new file was pushed correctly?
can you give the output of this command
Code:
adb shell "find / -iname \"*vending_preferences.xml*\" -exec cat '{}' \;"
dmanbuhnik said:
are you sure that the new file was pushed correctly?
can you give the output of this command
Code:
adb shell "find / -iname \"*vending_preferences.xml*\" -exec cat '{}' \;"
Click to expand...
Click to collapse
I put this:
adb push vending_preferences.xml /data/data/com.android.vending/shared_prefs/vending_preferences.xml
Is correct?
i wanted to see if the new file was pushed correctly
the last command i gave you is only to see the new file in the device
with that output we can see the text of that file
Sorry, this is the output:
C:\android-sdk\tools>adb shell "find / -iname \"*vending_preferences.xml*\" -exe
c cat '{}' \;"
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="SERVER_VERSION" value="1000" />
<boolean name="local_db_sync_required" value="false" />
<long name="last_tickle_id" value="1271657514775" />
<string name="vending_backup_state">vending</string>
<string name="vending_tos_version">1.0.0</string>
<boolean name="metadata_paid_apps_enabled" value="true" />
<long name="MARKET_LAST_HEARTBEAT_TIMESTAMP" value="1271657433127" />
<int name="reconciled_version" value="1710" />
<long name="last_sync_time" value="1273045486427" />
</map>
ok, your file is not the same
what is the output of this command:
Code:
adb shell "find / -iname \"*vending_preferences.xml*\""
the output of this command will give you a file name
"/path/to/vending_preferences.xml"
then you should push again my file with
Code:
adb remount
adb push vending_preferences.xml /path/to/vending_preferences.xml
(when you change the /path/to/vending_preferences.xml to the output of the first command...)
after that, kill the market with any kind of task killer and open it again to check the results

[Q] Remove items from Settings.apk Sense

Okay, I have tried everything I can think of to edit Settings.apk. I ran apktool, I did a 'findstr' for the offsets for what I wanted to remove, I looked at AndroidManifest.xml, I have done everything I can think of to remove some items from the Settings menu. This is what I have done so far:
1. Removed the activity from AndroidManifest.xml - caused Settings to not appear at all.
2. Edited /res/xml/settings.xml and settings_tune_performance.xml to remove the items - cant remember what this did, I believe Settings again did not appear
3. Obviously undid the previous edits, then edited Strings.xml kind of the same way the "Remove End Call Button" by JsChiSurf was done using the method of putting "/u0020" for each letter that I wanted blocked out...icon still remains, but no name for the items.
4. Along with edit #3, I also edited \smali\com\android\settings\framework\activity\HtcEntryProxy.smali - this looks to be the most important file to building the list of what shows. I was able to clone "Wireless Settings" over "Personalize" thereby getting rid of Personalize. I then took it one step further and basically moved lines of code over pieces that I want removed. I removed Personalize, Accounts & Sync, and Connect to PC and basically moved everything around so that I would only have 13 items instead of 16 - this resulted in a FC. Today, I tried to remove 2 items (3rd and 4th items) because of the way the code was written and it resulted in FC again (Code is written in blocks of 2 - local 1, end local 1, local 2, end local 2, restart local 1, end local 1, restart local 2, end local 2 - chose 3 and 4 since they were restarts, and so are the rest of them - just explaining why 3 and 4 was removed).
It looks like HtcEntryProxy.smali is the file to edit, but there has to be a file that sets the amount of tabs at 16. HEP.smali has a reference to "locals 8" and I thought of changing that to like 6 or 7 to see if I could get items to drop off and maybe there is code that just doubles the number. Seriously, if anyone at all can help, it will be greatly appreciated.
I have done every mod/edit I have wanted:
Remove End Call Button by JsChiSurf
Remove Vibrate on Call Connect by JsChiSurf
Replace Call History Button for Contacts in Dialer by JsChiSurf
Toggle Haptic Feedback on Phone Dialpad by Nieylana
Enable Forced Roaming by MrGreg (Could potentially work on NFX Roms as I am using on a Stock Sprint Rom)
Reboot option in power menu 3-in-1 by snq-
None of that may sound very interesting but a couple things of note:
1. Forced Roaming was said to not work on Sprint Stock Roms/NFX and I got it to work.
2. The Haptic Feedback mod was not working for the Sprint release I was using, I believe it was for a previous release
3. 2 mods by JsChiSurf were made using MetaMorph, I decompiled, found the changes, made the changes to my file and recompiled. The other mod was for an older version and therefore would not have worked, so I made the changes to my version.
4. As you can tell by another post of mine, the reboot menu was not a big deal to anybody but me since everyone moved on to 2.2/2.3
It isnt like editing files is new to me, and no, I have not done a MOD of my own, basically just took other peoples work and figured out how to get it to work for my purposes, so some people may jump all over me for that, but it takes a REALLY long time going through xmls and smali to find one bit of code that was changed, so it wasnt like it was easy.
To end this, I will just say that there are only a few mods that I personally want to see done:
1. Remove certain tabs that arent working from Settings.apk - Since they are in blocks of 2, the tabs would be Personalize, Accounts & Sync, Connect to PC, Accessibility (since it doesnt do anything)
2. A menu setting for enabling rotation PROPERLY. I know fresh has 270 degree rotation enabled, but no way to properly enable different rotation like CyanogenMod. It is 270 or 90 - nothing else. I would like to enable 360, 270, 180 or 90 with a menu like Cyanogen - there is a thread that talks about porting it, but it looks like a whole weekend thing - so I wont be undertaking this until I have the time to set aside (like in 2 weeks). If anyone has any ideas, by all means, let me know.
Well, I am also looking for something like it... :S

SIP stack stripped from stock GB?

Simple question. Does the stock GB on the Bionic have the integrated SIP stack stripped from the OS or not? This is more important to me now with all the rumors of Verizon tracking / limiting rooted users. If I'm forced to use the stock OS then what other liberties did these clowns take to try to prevent me from doing things they don't want? (e.g. backing me into a corner so I still have to pay their ridiculous voice service charges)
This might be the time I decide to cancel my Verizon altogether and go with TracFone + Galaxy WiFi Player (use VoIP when in WiFi range, otherwise use backup prepaid phone). Buncha greedy jerks.
Can someone who owns the phone already check this for me? Should be able to tell by going to "Settings -> Call Settings" and looking for an "Internet Calling" configuration section. If it's not there then they likely stripped it from the OS.
Thanks!
MIA. Looks like it's been stripped.
there are better alternatives anyway - like sipdroid - i wouldnt let the lack of GB native VOIP hinder your decision. Just my thoughts
thanks guys!
to the point about external apps offering SIP support. yes, you're right, but there are numerous advantages to using the native SIP stack vs external apps like sipdroid.
a few come to mind:
* sipdroid/csipsimple has some hardware/driver issues on some phones and makes it hard to work around them at the software level.
* i've found the NAT punching/traversal these programs offer is sometimes lackluster (do they even use libjingle?) making my voip inoperable on public wifis without special port trigger setup or putting my phone in a DMZ.
* it's nice having the SIP stack integrated into OS so it's fully supported by the native dialer and other phone functions
so, i do have interest in making sure my next purchase has this feature. i'm also not sure i'm willing to sign a 2 yr commitment with a provider that limits which features i can use in the OS... that seems to be their power trip going a bit too far.
FYI -
I just got done trying the Galaxy S2 fix for this (see thread http://forum.xda-developers.com/showthread.php?t=1109962) where you add the android.software.sip.voip.xml back to the system\etc\permissions folder but it did not bring the feature back. Looks like Motorola was more effective than Samsung in their stripping of the feature.
jeffason said:
Looks like Motorola was more effective than Samsung in their stripping of the feature.
Click to expand...
Click to collapse
This feature disabled in BlurPhone. It is hardcoded as mSipSupported = 0 and no way to activate it.
i'm trying to re-enable this by editing blurphone.apk. i see in phoneapp.smali constructor this code:
Code:
.line 299
iput-boolean v1, p0, Lcom/android/phone/PhoneApp;->mIsSipSupported:Z
now, how do i change it to set the field to true instead of false? (sorry, i'm new to this)
Man I reallly hope someone has some luck with this - it's the only thing about the Bionic I have a problem with...ha
i tried changing the dalvik opcodes myself to force mIsSipSupported to true, then recompiled, resigned, and pushed to my system files but it crashes (force close) everytime it tries to access the BlurPhone.apk functionality now =(
not sure what approach should be, maybe someone has more info they can chime in with regarding modifying this .apk without it crashing
I'd love if someone figured this out I used to use CSIP SIMPLE and Google Voice Call back, which worked great, but having those running in the background was juicing my battery like no other. Hope someone can find a native SIP workaround!
I made a post/request in the developer forums @ http://forum.xda-developers.com/showthread.php?t=1322163
I'm ponying up $20 to a dev that can restore SIP support in a couple different ways on the Bionic. If this feature is valuable to you then join me by pooling in some funds for a dev to help us out!
Hope we will have a solution soon!

[ROM] [OFFICIAL/UNOFFICIAL] Cyanogenmod 13.0 for Shield Portable

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
CyanogenMod is a free, community built, aftermarket firmware distribution of Android 6.0.x (Marshmallow), which is designed to increase performance and reliability over stock Android for your device.
Code:
/*
* Your warranty is now void.
*
* We are not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your device, we will laugh at you.
*
*/
CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. You will need to provide your own Google Applications package (gapps). CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.
All the source code for CyanogenMod is available in the CyanogenMod Github Repo. And if you would like to contribute to CyanogenMod, please visit our Gerrit Code Review. Your changelog is whatever was merged into gerrit.
Instructions:
1. First time flashing CyanogenMod 13.0 your device, or coming from another ROM?
2. Download the zip(s).
3. Install a compatible Recovery
4. Perform a NANDroid backup of your current ROM (Optional)
5. Wipe data & cache partitions of your device
6. Flash CyanogenMod.
7. Optional: Install the Google Apps addon package.
Firmware Update:
If you have not installed the latest stock ota, then some firmware files need updated. The following flashable zips will update the bootloader and the dtb corresponding with the listed stock version. Only the latest one listed here will be supported by recent CM builds.
106
Official Nightly Downloads:
get.cm
GAPPS
Unofficial Downloads with Nvidia App Support (CM 12.1):
20151003
Bugreport:
Report in this thread. CM's JIRA is only for stable builds, which I have not released.
Known Problems:
Only the power button seems to wake the device.
Wireless controller doesn't work.
Source Code:
https://github.com/CM-Shield/android_device_nvidia_roth
https://github.com/CM-Shield/android_kernel_nvidia_roth
XDA:DevDB Information
CM13.0 Unofficial Roth, ROM for the Nvidia Shield
Contributors
Steel01, Unjustified Dev
ROM OS Version: 6.0.x Marshmallow
ROM Kernel: Linux 3.4.x
Based On: CyanogenMod
Version Information
Status: Nightly
Created 2015-02-28
Last Updated 2016-03-15
sweet - since I'm not using most of the quicksettings on the stock shield I can finally get rid of most of them without installing xposed and gravity box...
but right now its missing the buttons-menu in the settings - so you cant configure the power menu or any of that stuff.
still, the bootup time is amazing on this thing compared to stock...
Sweet! Does this have the stuff I sent to @Unjustified Dev? (Setting volume button as volume down)
r3pwn said:
Sweet! Does this have the stuff I sent to @Unjustified Dev? (Setting volume button as volume down)
Click to expand...
Click to collapse
No, this build does nothing with the volume button. What I'd like to see it do is bring up the volume widget without changing the volume which would be as similar to stock as I can figure, but I don't see a way to do that. You can change that pretty easily locally, if you want that on your install.
@Spleeno: I expect that has to do with upstream cm. I didn't turn off any settins and I don't think Unjustified Dev did either. I know upstream was still working on forward porting all of 11's features last I looked. I don't know where they're at on that now.
Also, if it helps at all, it's possible to disable the LED by running (as root) "echo 0 > /sys/class/leds/roth-led/brightness". (This was a setting on stock, not sure if you guys want to re-add it in.)
Steel01 said:
No, this build does nothing with the volume button. What I'd like to see it do is bring up the volume widget without changing the volume which would be as similar to stock as I can figure, but I don't see a way to do that. You can change that pretty easily locally, if you want that on your install
Click to expand...
Click to collapse
I had mine set to Volume down for a couple reasons:
1. When tapped once, it would pull up the volume menu (and lower volume by one step, but not a huge issue)
2. When held with the power button, it takes a screenshot (that's what happened on stock, too)
3. Holding it down mutes it, if for some reason you needed to quickly mute the device.
r3pwn said:
Also, if it helps at all, it's possible to disable the LED by running (as root) "echo 0 > /sys/class/leds/roth-led/brightness". (This was a setting on stock, not sure if you guys want to re-add it in.)
I had mine set to Volume down for a couple reasons:
1. When tapped once, it would pull up the volume menu (and lower volume by one step, but not a huge issue)
2. When held with the power button, it takes a screenshot (that's what happened on stock, too)
3. Holding it down mutes it, if for some reason you needed to quickly mute the device.
Click to expand...
Click to collapse
For the first, I'd want to leave that to user choice. Wonder how hard it would be to add that to the settings section. Can you even add setting pages from the device tree without modifying upstream?
On the second, you might have me convinced there. I'll change it on mine next time I'm poking at it. And will probably change it in the tree unless something weird pops out.
There's several more things I want to look at porting over. Console mode looks to be really easy. At least in basic form. There's a couple props to force hdmi only and resolution. Only problem is if the cable is unplugged, it wont automatically switch back over. The wireless controller is another, but more difficult. I got the apps to run, but they errored out. I have a couple more ideas to try, but haven't got there yet. Took a break over the weekend, but should be back at it tomorrow night.
Steel01 said:
For the first, I'd want to leave that to user choice. Wonder how hard it would be to add that to the settings section. Can you even add setting pages from the device tree without modifying upstream?
Click to expand...
Click to collapse
I'm not sure. I'll have to take a look. Anything is possible with overlays, though, right?
Absolute worst case scenario, I'll make an app with a few misc. things like this to gain some functionality back from stock.
And while we're in the spirit of discussing rom-related components, I have a bug report: Attempting to use Nvidia's GRID Streaming service results in only the audio going through. (Not sure if that affects PC streaming, as my PC is nowhere near powerful enough to test)
And also,
There seems to be some weird issue with storage. Either apps aren't getting moved to the sdcard when told or the system is factoring them into the internal storage space calculation anyways. (I'll get back to you on this one, it isn't too hard to test to figure it out.)
Steel01 said:
Took a break over the weekend, but should be back at it tomorrow night.
Click to expand...
Click to collapse
Alright. No rush, take as long of a break as you need!
Steel01 said:
I expect that has to do with upstream cm. I didn't turn off any settins and I don't think Unjustified Dev did either. I know upstream was still working on forward porting all of 11's features last I looked. I don't know where they're at on that now.
Click to expand...
Click to collapse
Hm, I'm running the 20150223 cm12 nightly on my z3 compact and it already has the button menu - I wouldnt have expected/noticed with some of the early january builds ofc
So I started a proper post with quotes and all, but the android keyboard or textbox edit thing in Firefox did something weird and ate my post. And there's no undo... So this is my shorter and more miffed second attempt.
@Spleeno: My bad, I see that on my Nexus 5 now. I'll compare my dev tree with the N5's and see what the difference in that area is.
@r3pwn: On the Grid issue: I confirmed that this morning, but didn't have much time to look at the logs. I saw something about missing codecs, but that was at the top and maybe not related. I'll look more into it tonight. It could well be a worse underlying problem.
@Steel01 man thanks so much for your initiative, i'm happy to see a custom rom o my shield and its working great, i have tested with retroarch nightly and ppsspp nightly and its working awesome.
if its possible until you define the function to volume button i think you can change from program_red to button_select to at least we can use on the emulators
another thing i have noticed the volume button on original shield rom is 109 on you rom is 183
thanks for your time and thanks so much for the custom rom!
update:
other things i have noticed
when we make a fresh installation the shield don't have the mtp option checked
we have a vibration option on sound menu (i dont know if this make some erros on system if enable/disable)
if the kernel have the option Prism from nvidia its possible to put on display using the adaptive brightness ( /sys/class/graphics/fb0/device/smartdimmer/enable)
thanks again
I looked at the sdcard issue. It appears that only the app is getting transferred over,not any obbs that belong to the app. You can move those manually, but that's not very user-friendly.
Okay, I've been chasing this grid problem around most of the night... Finally got a lead when I gave up and started trying to mess with the controller stuff again. Apparently the Grid service want to use stuff from the main Nvidia control service. Which is embedded in the stock build and not open source. I was able to pull the apks (NvCPLSvc and the controller related NvBlakeManager and BlakePairing) from my Shield Tablet (already on lollipop), resign them with CM's keys and get them to run. Once NvCPLSvc was happy, the logs related to Grid stuff look a lot more similar to what I get on my stock tablet, but still no dice. It's getting stuck in the queue. Dunno if I'll make any more progress on that tonight or not, but I'm a lot closer.
On the controller front, at least it's more obvious what the problem is. Nvidia modified the wireless p2p stuff in the android framework. Some functions that blake calls don't exist in CM and causes the service to bomb. I'm playing with a diff between the aosp tree and CM. Should be able to get get a sane one tonight and run off a build to see how much further I can get. Then the question will be if I can magically add the changes to the device tree or if they would have to be submitted to upstream CM or Google which isn't likely to get merged.
@YamazakiRobert:
The mtp part could be due to some testing we were doing and trying to get adb up when cm wasn't booting. I'll check when I'm working on the device tree again.
I doubt turning on vibrate would damage anything since there isn't any hardware for it. But I agree the option shouldn't be there. More things to add to the device tree list.
That smartdimmer path is there on this build and is enabled by default. Though, I haven't seen any effects like adaptive brightness. That feature drives me nuts and is one of the first things I turn off on a phone reinstall... But, I'll look into enabling auto brightness in CM. Should be able to find that in the N5 tree as well.
@r3pwn:
Creating a open source control app would probably be the easiest way to go. Control things like the leds, console mode, etc. If someone could figure out what blake is actually doing under the hood, it would be nice to get away from those stock programs as well. But I didn't have a whole lot of luck with deciphering that a few weeks ago. But it's looking like NvCPLSvc will have to stick around if people want Grid access, which is unfortunate.
The transfer problem sounds like an upstream issue or even on-purpose decision. Does this work on other CM ports?
Edit: Ugh. The wifi framework stuff appears to have been refactored between 4.4 and 5.0. Got the patch cleaned up and applied and stuff overlaps and isn't found and all kinds of fun. I probably should have pulled all this from the tablet aosp. Guess I'll try that angle tomorrow.
Thank you for this majestic piece of work.
I'm going to build a shrine with your username when you'll make a working CM12 with GRID.
Steel01 said:
@r3pwn:
Creating a open source control app would probably be the easiest way to go. Control things like the leds, console mode, etc. If someone could figure out what blake is actually doing under the hood, it would be nice to get away from those stock programs as well. But I didn't have a whole lot of luck with deciphering that a few weeks ago. But it's looking like NvCPLSvc will have to stick around if people want Grid access, which is unfortunate.
The transfer problem sounds like an upstream issue or even on-purpose decision. Does this work on other CM ports?
Edit: Ugh. The wifi framework stuff appears to have been refactored between 4.4 and 5.0. Got the patch cleaned up and applied and stuff overlaps and isn't found and all kinds of fun. I probably should have pulled all this from the tablet aosp. Guess I'll try that angle tomorrow.
Click to expand...
Click to collapse
I can get right on making the app to control the LED, just as soon as I get back to my shield. Ah, who cares, I can start on it now! Also, glad to see you're making progress with GRID and the controller. I'll check out the storage thing on my G3 to see if it's a CM thing or something else.
So, the wifi framework stuff for the controller is taking more work than I bargained for. The changes needed are not in the tablet aosp tree at all, so I can't base from there. Makes me think they got put in the portables tree by accident. Somewhat of a break, it seems. But stuff is all in the wrong directories when trying to pull it into lollipop. It doesn't help that I'm mostly shooting blind and reacting to compiler errors. I think I'm starting to get a picture of what's going on, though. I'm probably going to have to start over at least one more time, but it's starting to look like it might be a small patch after all. I just need to find where all the files are really supposed to go...
Edit:
Got it to compile with only a few file changes (and I think only three lines in one file matter), but blake still errors out. Saying it can't find a different virtual function that should be right where it says it's looking for it. Somewhat confused atm. Doing a full clean and recompile just to make sure something didn't get way confused as I was tweaking and compiling. I'll see what that looks like tomorrow.
Does anyone around here have the first clue about smali? Given the following snippets from a decompiled BlakeManager:
Code:
.line 498
invoke-virtual {v1}, Landroid/net/wifi/p2p/WifiP2pGroup;->getNetworkId()I
move-result v0
*snip*
iget-object v5, p0, Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi$6;->this$0:Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;
# getter for: Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;->mWifiP2pMgr:Landroid/net/wifi/p2p/WifiP2pManager;
invoke-static {v5}, Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;->access$500(Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;)Landroid/net/wifi/p2p/WifiP2pManager;
move-result-object v5
iget-object v6, p0, Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi$6;->this$0:Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;
# getter for: Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;->mChannel:Landroid/net/wifi/p2p/WifiP2pManager$Channel;
invoke-static {v6}, Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;->access$400(Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi;)Landroid/net/wifi/p2p/WifiP2pManager$Channel;
move-result-object v6
new-instance v7, Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi$6$1;
invoke-direct {v7, p0}, Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi$6$1;-><init>(Lcom/nvidia/blakemanager/connectivity/BlakePairManagerMainWifi$6;)V
invoke-virtual {v5, v6, v0, v7}, Landroid/net/wifi/p2p/WifiP2pManager;->createGroup(Landroid/net/wifi/p2p/WifiP2pManager$Channel;ILandroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V
I am totally confused about the last line. The function createGroup is declared as "public void createGroup(Channel c, ActionListener listener)" in mainline Android and the Shield Portable tree. Which matches the longhand call there. However, the function is being passed 4 parameters. Afaik, that should only be three. One for the 'this' pointer and two for the parameters. What is it doing with that fourth parameter (as I read, v0 is the extra)?
Other info. The logcat error I'm getting is:
Code:
--------- beginning of crash
E/AndroidRuntime( 1236): FATAL EXCEPTION: main
E/AndroidRuntime( 1236): Process: com.nvidia.blakemanager, PID: 1236
E/AndroidRuntime( 1236): java.lang.NoSuchMethodError: No virtual method createGroup(Landroid/net/wifi/p2p/WifiP2pManager$Channel;ILandroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V in class Landroid/net/wifi/p2p/WifiP2pManager; or its super classes (declaration of 'android.net.wifi.p2p.WifiP2pManager' appears in /system/framework/framework.jar)
E/AndroidRuntime( 1236): at com.nvidia.blakemanager.connectivity.BlakePairManagerMainWifi$6.onPersistentGroupInfoAvailable(BlakePairManagerMainWifi.java:505)
E/AndroidRuntime( 1236): at android.net.wifi.p2p.WifiP2pManager$Channel$P2pHandler.handleMessage(WifiP2pManager.java:776)
E/AndroidRuntime( 1236): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 1236): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 1236): at android.app.ActivityThread.main(ActivityThread.java:5256)
E/AndroidRuntime( 1236): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 1236): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 1236): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
E/AndroidRuntime( 1236): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
That virtual method is there in my build and the line in framework.jar/classes.dex matches byte for byte the line from the Shield Tablet's framework. Also, decompiling the Portables BlakeManager shows a way different application, though the call to createGroup only passes 3 parameters. I tried tweaking the smali file to remove v0 and reassembling, but that failed some art verification when I tried copy it over. Even after clearing the cache and a full factory reset. Like so:
Code:
I/art ( 1364): Verification error in void com.nvidia.blakemanager.connectivity.BlakePairManagerMainWifi$6.onPersistentGroupInfoAvailable(android.net.wifi.p2p.WifiP2pGroupList)
I/art ( 1364): couldn't find method android.net.wifi.p2p.WifiP2pManager.createGroup (Landroid/net/wifi/p2p/WifiP2pManager$Channel;ILandroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V
I/art ( 1364): void com.nvidia.blakemanager.connectivity.BlakePairManagerMainWifi$6.onPersistentGroupInfoAvailable(android.net.wifi.p2p.WifiP2pGroupList) failed to verify: register v7 has type Precise Reference: com.nvidia.blakemanager.connectivity.BlakePairManagerMainWifi$6$1 but expected Integer2pGroupList): [0x56]
E/art ( 1364): Verification failed on class com.nvidia.blakemanager.connectivity.BlakePairManagerMainWifi$6 in /system/app/NvBlakeManager.apk because: Verifier rejected class com.nvidia.blakemanager.connectivity.BlakePairManagerMainWifi$6 due to bad method void com.nvidia.blakemanager.connectivity.BlakePairManagerMainWifi$6.onPersistentGroupInfoAvailable(android.net.wifi.p2p.WifiP2pGroupList)
E/JavaBinder( 1364): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
What is it verifying against? The function declaration doesn't have that parameter... I'm beginning to think I'm out of my league unless someone can give me a crash course in low level Android programming. I mean, I can hazard an educated guess as to what that parameter (result of getNetworkId()) does (instead of WifiP2pGroup.PERSISTENT_NET_ID in createGroup, use that), but that would change the declaration. I even tried overloading the function. So confused...
Edit:
Scratch all of that. I botched the overload first time through. Got the overload in correctly and now it's happier. WifiP2P stuff isn't activating correctly, though. Don't know if that's due to their changes to hostapd and wpa_supplicant or if I'm missing more framework stuff.
I'm thinking of throwing together another build to release tomorrow along with a flashable zip of of the Nvidia stuff. That way if anyone else wants to tinker with it, they can. More eyes do make this stuff easier.
I don't like triple posting, but I still want to trigger new post alerts...
Okay, new build is up here: cm-12-20150305-UNOFFICIAL-roth.zip. That includes everything I've done to date. Attached are the two patches I don't have on github. They apply in cm12 to frameworks/base and frameworks/opt/net/wifi respectively. Also attached is a flashable zip of the Nvidia system apps pulled from my tablet (which can be obtained by anyone from Nvidia's ota zips). These are unmodified outside of resigning them with CM's key to allow them to run as system. The command I used is below for reproducibility. Neither Grid or the controller pairing works correctly yet, but nothing outright crashes either. If someone has any ideas from the logs or wherever about what's missing now, I'd appreciate suggestions.
Code:
java -jar /path/to/cm12/out/host/linux-x86/framework/signapk.jar /path/to/cm12/build/target/product/security/platform.x509.pem /path/to/cm12/build/target/product/security/platform.pk8 old.apk new.apk
Changes and known problems:
The volume button is now mapped to volume_down.
If 'Google Play Movies and TV' is updated, it starts FCing on the next reboot. I haven't tried to track down the problem yet. I just removed it.
Edit:
Well, blast... This is going to be much more of a pain than I thought. Good news: I got the wireless controller to connect. Bad news: I had to copy wpa_supplicant and hostapd over from my tablet. This code, I don't see anywhere... I've reuploaded the flashable zip with these files. I do not like this as a long term solution. Not at all.
Edit 2:
So, it connects, but won't reconnect and old pairings aren't saving correctly. Think I have a fix for it, but I'm having to recompile. This works, but after the 2 minute timeout, you have to reboot and re-pair.
Edit 3: Or worse... It just disconnects period after 2 minutes. Hoping my change in the rebuild changes this.
Edit 4: And no dice. It dies after two minutes with a few comments in the log. Any time a button is pressed, it spits a bunch of stuff about not being able to open the audio device. Probably trying to make the button sound through the headphone jack while that isn't completely initialized. More research to do later, but I think I'm done for the night.
Steel01 said:
I don't like triple posting, but I still want to trigger new post alerts...
Click to expand...
Click to collapse
Instead of using baksmali, why not use jadx (decompiles from apk straight to java and is interactive too)?
Sorry for the short (and only potentially helpful) reply to such a massive wall of text, but it's about midnight here and I need some sleep.
Also, I'm guessing your "nvservices.zip" file isn't supposed to be 5 bytes.
r3pwn said:
Instead of using baksmali, why not use jadx (decompiles from apk straight to java and is interactive too)?
Sorry for the short (and only potentially helpful) reply to such a massive wall of text, but it's about midnight here and I need some sleep.
Also, I'm guessing your "nvservices.zip" file isn't supposed to be 5 bytes.
Click to expand...
Click to collapse
I tried several tools to get there... Apktool being the one that got me the smali. Thanks for the reference, I'll look it up tomorrow. It's late here too. And the zip is 2.8 MB on this side. Just downloaded and it opened fine. Dunno what happened on your side.
Steel01 said:
I tried several tools to get there... Apktool being the one that got me the smali. Thanks for the reference, I'll look it up tomorrow. It's late here too. And the zip is 2.8 MB on this side. Just downloaded and it opened fine. Dunno what happened on your side.
Click to expand...
Click to collapse
Oh. I guess it was Tapatalk being stupid.

how does xposed modify/affect ART?

Hi people,
I was wondering which parts of ART and what optimizations does Xposed disable. I read from one of @rovo89 GitHub that he needed to disable a couple of optimizations. Do these changes affect performance? If so, how can I make performance better?
Cheers!
-LLJY
It mostly disables method inlining and call sharpening. The latter would usually detect that a call to "myObject.toString()" will always resolve to one particular implementation, so ART would create a call directly to the native address of the compiled method. Both of these make it impossible to hook a method, as ART simply wouldn't look up the method anymore. I don't see a way to avoid this.
Little insight to demonstrate this. Consider this Java code:
Code:
package de.robv.android.xposed.smallapp;
public class MyClass {
private static int sMyField = 999;
public static int returnConstant() {
return 1234;
}
public static void main() {
sMyField = returnConstant();
}
}
This is the Dex code for the main() method:
Code:
0x0000: 7100 0700 0000 | invoke-static {}, int de.robv.android.xposed.smallapp.MyClass.returnConstant() // [email protected]
0x0003: 0a00 | move-result v0
0x0004: 6700 0600 | sput v0, I de.robv.android.xposed.smallapp.MyClass.sMyField // [email protected]
0x0006: 0e00 | return-void
And here is what ART (on Nougat / x86) compiles it to:
Code:
0x00001054: 83EC0C sub esp, 12
0x00001057: 890424 mov [esp], eax
0x0000105a: 8B08 mov ecx, [eax]
0x0000105c: C781B0010000D2040000 mov [ecx + 432], 1234
0x00001066: 83C40C add esp, 12
0x00001069: C3 ret
As you can see, the call to returnConstant() is gone. The value it would always return has been inlined. Granted, this is a very simple example, but this can happen for more complex methods as well. It's incremental, so if returnConstant() returned the result of "square(9)" and that square() function returned "x*x", then it would remove all of those calls and insert the precalculated value 81 in the native code.
Now if a module hooks returnConstant(), that hook would never be called, because, well, the method isn't called either. This behavior would depend on many factors (e.g. compiler filter settings in the ROM), so module developers couldn't even rely on the assumption that the hook isn't called. It would be virtually random.
To avoid this (and also a few similar simplifications), the Xposed fork of ART disables these optimizations and recompiles all the odex/oat files. I actually have no idea how big the performance impact is, but it's necessary. It can't even be selective, as it's not known at compile time which methods will be hooked. This optimization can't be reverted when a method is hooked (e.g. by recompiling that method), because it would mean that all the calling methods would have to be recompiled, which would require a list of all callers of that method (or at least those that have inlined it).
I'm not sure about Nougat yet. It has a JIT compiler (Marshmallow had one, too, but it was disabled because it wasn't stable yet), maybe that brings some new opportunities. But that's still a long way, first hooking has to work at all.
rovo89 said:
Little insight to demonstrate this. Consider this Java code:
This is the Dex code for the main() method:
And here is what ART (on Nougat / x86) compiles it to:
As you can see, the call to returnConstant() is gone. The value it would always return has been inlined.
some new opportunities. But that's still a long way, first hooking has to work at all.
Click to expand...
Click to collapse
Thank you for the response, I would just like to report that xposed adds a substantial amount of overhead compared to normal ART. Especially noticeable when ART is set to optimize everything.
Before flashing xposed, my phone running my own custom rom is noticeably faster compared to the iPhone 7. After flashing xposed, it lags behind quite abit.
I did loads of testing to come to this conclusion.
Just some feedback for you
_LLJY said:
I did loads of testing to come to this conclusion.
Click to expand...
Click to collapse
Did you also do real benchmarks? Most of the time when people talk about performance, they say it "feels" slower, but that's hard to investigate...
Also, modules might of course add overhead as well. What I mentioned above just refers to the framework itself.
rovo89 said:
Did you also do real benchmarks? Most of the time when people talk about performance, they say it "feels" slower, but that's hard to investigate...
Also, modules might of course add overhead as well. What I mentioned above just refers to the framework itself.
Click to expand...
Click to collapse
I tested Xposed on 3 devices, 2 ARMV7 and one ARM64. The Redmi note 4g(snapdragon 400) doesn't seem to be affected much at all. The Xperia Z5 (810) seems to slow down noticeably(I tested against a brand new Z5 with the same Rom) the Xiaomi mi3(800) does also get affected slightly although i haven't compared it against another new device. I will conduct a more scientific test where I actually time the devices using discomark to see how they do and put the results in a spreadsheet.
rovo89 said:
Did you also do real benchmarks? Most of the time when people talk about performance, they say it "feels" slower, but that's hard to investigate...
Also, modules might of course add overhead as well. What I mentioned above just refers to the framework itself.
Click to expand...
Click to collapse
on 6.0.1(nexus 5x) i don`t see any diference with or without xposed but seems on nougat will be a little complicate with the art modifications ! btw @rovo89 the xposed can be your phD theme (this is research)
Xposed sdk 23 v 86 does not work with cm 13 for i 9515 with newest kernel 3.4.113 anymore. Hope there will still be updates for xposed sdk 23????
Quote:
Originally Posted by friscoboi @sombree 20161115 got me stuck in a bootloop so far. I did everything as always with updates? Or does it take more than 30 minutes to reboot with the new kernel the first time?
It's because you're using xposed. And no, I'm not going to rebuild ROM with one of those unofficial fixes - you'll have to wait for fixed xposed
(Sorry to post here, but the older xposed thread is closed...)
rovo89 said:
Little insight to demonstrate this. Consider this Java code:
Code:
package de.robv.android.xposed.smallapp;
public class MyClass {
private static int sMyField = 999;
public static int returnConstant() {
return 1234;
}
public static void main() {
sMyField = returnConstant();
}
}
This is the Dex code for the main() method:
Code:
0x0000: 7100 0700 0000 | invoke-static {}, int de.robv.android.xposed.smallapp.MyClass.returnConstant() // [email protected]
0x0003: 0a00 | move-result v0
0x0004: 6700 0600 | sput v0, I de.robv.android.xposed.smallapp.MyClass.sMyField // [email protected]
0x0006: 0e00 | return-void
And here is what ART (on Nougat / x86) compiles it to:
Code:
0x00001054: 83EC0C sub esp, 12
0x00001057: 890424 mov [esp], eax
0x0000105a: 8B08 mov ecx, [eax]
0x0000105c: C781B0010000D2040000 mov [ecx + 432], 1234
0x00001066: 83C40C add esp, 12
0x00001069: C3 ret
As you can see, the call to returnConstant() is gone. The value it would always return has been inlined. Granted, this is a very simple example, but this can happen for more complex methods as well. It's incremental, so if returnConstant() returned the result of "square(9)" and that square() function returned "x*x", then it would remove all of those calls and insert the precalculated value 81 in the native code.
Now if a module hooks returnConstant(), that hook would never be called, because, well, the method isn't called either. This behavior would depend on many factors (e.g. compiler filter settings in the ROM), so module developers couldn't even rely on the assumption that the hook isn't called. It would be virtually random.
To avoid this (and also a few similar simplifications), the Xposed fork of ART disables these optimizations and recompiles all the odex/oat files. I actually have no idea how big the performance impact is, but it's necessary. It can't even be selective, as it's not known at compile time which methods will be hooked. This optimization can't be reverted when a method is hooked (e.g. by recompiling that method), because it would mean that all the calling methods would have to be recompiled, which would require a list of all callers of that method (or at least those that have inlined it).
I'm not sure about Nougat yet. It has a JIT compiler (Marshmallow had one, too, but it was disabled because it wasn't stable yet), maybe that brings some new opportunities. But that's still a long way, first hooking has to work at all.
Click to expand...
Click to collapse
Dalvik VM also uses JIT compiler
Sent from my GT-S7580 using Tapatalk
DodoGTA said:
This is the Dex code for the main() method:
And here is what ART (on Nougat / x86) compiles it to:
As you can see, the call to returnConstant() is gone. The value it would always return has been inlined. Granted, this is a very simple example, but this can happen for more complex methods as well. It's incremental, so if returnConstant() returned the result of "square(9)" and that square() function returned "x*x", then it would remove all of those calls and insert the precalculated value 81 in the native code.
Now if a module hooks returnConstant(), that hook would never be called, because, well, the method isn't called either. This behavior would depend on many factors (e.g. compiler filter settings in the ROM), so module developers couldn't even rely on the assumption that the hook isn't called. It would be virtually random.
To avoid this (and also a few similar simplifications), the Xposed fork of ART disables these optimizations and recompiles all the odex/oat files. I actually have no idea how big the performance impact is, but it's necessary. It can't even be selective, as it's not known at compile time which methods will be hooked. This optimization can't be reverted when a method is hooked (e.g. by recompiling that method), because it would mean that all the calling methods would have to be recompiled, which would require a list of all callers of that method (or at least those that have inlined it).
I'm not sure about Nougat yet. It has a JIT compiler (Marshmallow had one, too, but it was disabled because it wasn't stable yet), maybe that brings some new opportunities. But that's still a long way, first hooking has to work at all.
Dalvik VM also uses JIT compiler
Click to expand...
Click to collapse
You don't say
rovo89 said:
Did you also do real benchmarks? Most of the time when people talk about performance, they say it "feels" slower, but that's hard to investigate...
Also, modules might of course add overhead as well. What I mentioned above just refers to the framework itself.
Click to expand...
Click to collapse
I still haven't done actual tests due to time constraints but an interesting thing is that XDA labs does indeed take a fraction of a second longer to launch with Xposed. But it's barely noticeable, I had to time it.
_LLJY said:
I still haven't done actual tests due to time constraints but an interesting thing is that XDA labs does indeed take a fraction of a second longer to launch with Xposed. But it's barely noticeable, I had to time it.
Click to expand...
Click to collapse
if it helps, with xposed activated and deactivated (typically after a new rom install), activated it's perfectly fine, performance is a bit hindered but not so much that you notice it right away. Skip ahead a couple hours and it's laggy and slow, stuttering, apps don't open quite as fast, nor do they stay open (that's to do with another issue regarding xposed v87). But before that v87 update, that issue persisted.
But when i have xposed disabled (after flashing the new build), it's perfectly fine, performance is as snappy as a GS4 (SD600) would get you and apps open faster, don't lag or get bogged down. And they generally perform much better over time.
I can at least for me, confirm this since I've started using xposed (v70-76 i believe).
(Sprint Galaxy S4 SD600 16gb model, cm13 (12/4/2016 nightly) with ten modules installed.)
Do let me know if this helps at all with determining the performance hit with xposed enabled and with a decent amount of modules installed.
I'm gonna guess there's no new news about xposed for nougat
Shiftydogit said:
I'm gonna guess there's no new news about xposed for nougat
Click to expand...
Click to collapse
Correct. @rovo89 has not quite cracked the code on making it work with N just yet. He's working on it though so patience is required.
sjamie said:
Correct. @rovo89 has not quite cracked the code on making it work with N just yet. He's working on it though so patience is required.
Click to expand...
Click to collapse
Hopefully he gets it N seems like a pain in the grass for a lot of things we power users enjoy
Shiftydogit said:
Hopefully he gets it N seems like a pain in the grass for a lot of things we power users enjoy
Click to expand...
Click to collapse
Amen.
Wonder what's happening, I heard that Nougat xposed is unreliable with JIT?
I hope it gets fixed soon and gets out to the public.
Anyways, great job devs<3
Rotated Quickbits said:
Wonder what's happening, I heard that Nougat xposed is unreliable with JIT?
I hope it gets fixed soon and gets out to the public.
Anyways, great job devs<3
Click to expand...
Click to collapse
Maybe a new year present????
mitas35 said:
Maybe a new year present????
Click to expand...
Click to collapse
I'm going to like and respond to this post as it was only minutes away from the new years
All I'm hoping for, is that Android O doesn't mess with the compiler any more than N did, Android O Developer Previews are going to come before the official announcement on the 17 - 19 May 2017, and first betas are set to come in the summer, which aren't that far away...
If it does, then its going to be a long catch up game for @rovo89

Categories

Resources