Problems on SMS text limitation to 1000 per conversation - General Questions and Answers

Hey guys, I am very upset towards the limitation over the stock sms apps in my razr maxx as I would certainly like to store something SMS sent from my dearest.
So I desired to make some tweaks over the messaging apps. I search over and over and finally got the setting code in MessageSettings.smali.
Let me give you some code about it
.field private static final MMS_MAX_SMIL_SIZE:I = 0xc8
.field public static final SMS_MMS_DEFAULT_MESSAGE_COUNT_PER_THREAD:I = 0xc8
.field public static final SMS_MMS_MAX_MESSAGE_COUNT_PER_THREAD:I = 0x3e8
.method public static getConversationMessageLimit()I
.locals 3
.prologue
.line 1280
sget-object v0, Lcom/motorola/messaging/settings/MessageSettings;->mDefaultPrefs:Landroid/content/SharedPreferences;
const-string v1, "MaxMessagesPerThread"
const/16 v2, 0x3e8
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
return v0
.end method
Click to expand...
Click to collapse
I modify them, both the default and max limitation to "0xffff", and replace the original apk in system, seems the 1000 limitation is still there:crying:
Anyone knows exactly what's wrong with my modification? Or I need to make more changes in other files?
Thx guys!
Please, don't ask me to use 3rd party SMS apps, as I love my stock SMS apps a lot except for such a limitation!

Related

[Think Tank] Getting Google Market (vending.apk) to work without google apps.

In adding google apps support to my last 2.0 rom, I experimented a lot of things and, of all the google apps programs, Vending was the one that was the most interesting to me because I noticed that the program would not force-close like the others with other missing google apps, the program just exits, so it's safe to assume that it's looking for a login somewhere. Even after GoogleApps.apk is removed, the market will still work, something it won't do if you don't sign in before removing GoogleApps. All it seems to require are the two permissions in etc (com.google.android.gtalkservice.xml and com.google.android.datamessaging.xml).
Now, here's what I think, if we're able to look what Vending is looking for and create a small app to generate the necessary login information and put it where needed as best-case goal. A more realistic goal, though, would be to look at the smali code and see where the login information is being requested and causes the program to shut off if it's not available. If we find it, we can just bypass it and have the program start without a login, and I believe the only thing that would be affected would be the cloud storage of the apps we've downloaded, but we'd still have full access to market.
Trying to start the app alone gives me this error:
Code:
12-02 10:42:11.522: INFO/ActivityManager(72): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.vending/.AssetBrowserActivity }
12-02 10:42:11.633: WARN/AudioFlinger(375): write blocked for 95 msecs, 68 delayed writes, thread 0xcd90
12-02 10:42:11.982: DEBUG/AccountManagerService(72): bind attempt failed for Session: expectLaunch false, connected false, stats (0/0/0), lifetime 0.003, getAccountsByTypeAndFeatures, legacy_hosted_or_google
12-02 10:42:12.022: DEBUG/vending(2893): com.android.vending.BaseActivity.completeGetAuthToken(): auth result is RESULT_CANCELED
12-02 10:42:12.033: DEBUG/vending(2893): com.android.vending.BaseActivity.onAuthTokenComplete(): null auth token.
12-02 10:42:12.042: WARN/InputManagerService(72): Starting input on non-focused client [email protected] (uid=10006 pid=2893)
12-02 10:42:12.052: WARN/InputManagerService(72): Client not active, ignoring focus gain of: [email protected]
12-02 10:42:12.222: WARN/InputManagerService(72): Window already focused, ignoring focus gain of: [email protected]
12-02 10:42:41.273: WARN/AudioFlinger(375): write blocked for 95 msecs, 69 delayed writes, thread 0xcd90
so, theoretically, if we have onAuthTokenComplete() ignore the result from completeGetAuthToken() of if we modify completeGetAuthToken() to pass something to onAuthTokenComplete() something to allow the program to start, we should be good to go.
Testers, ideas, experiences?.
I guess this is where we start com.android.vending.BaseActivity.smali:
Code:
.method private completeGetAuthToken(ILandroid/content/Intent;)Ljava/lang/String;
.registers 6
.parameter "resultCode"
.parameter "data"
.prologue
const/4 v2, 0x0
.line 1328
const/4 v1, -0x1
if-ne p1, v1, :cond_11
.line 1329
invoke-virtual {p2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
move-result-object v0
.line 1330
.local v0, extras:Landroid/os/Bundle;
if-eqz v0, :cond_20
.line 1331
const-string v1, "authtoken"
invoke-virtual {v0, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
.line 1338
.end local v0 #extras:Landroid/os/Bundle;,
:goto_10
return-object v1
.line 1333
:cond_11
if-nez p1, :cond_20
.line 1334
invoke-virtual {p0, v2}, Lcom/android/vending/BaseActivity;->setResult(I)V
.line 1335
const-string v1, "auth result is RESULT_CANCELED"
new-array v2, v2, [Ljava/lang/Object;
invoke-static {v1, v2}, Lcom/android/vending/util/Log;->d(Ljava/lang/String;[Ljava/lang/Object;)V
.line 1336
invoke-virtual {p0}, Lcom/android/vending/BaseActivity;->finish()V
.line 1338
:cond_20
const/4 v1, 0x0
goto :goto_10
.end method
Try the youtube app, it will insert login data when you log in with your gmail account.
I think this is it, again, at com.android.vending.BaseActivity.smali:
Code:
.method protected final onAuthTokenComplete(Lcom/android/vending/BaseActivity$AuthService;Ljava/lang/String;Z)V
.registers 6
.parameter "service"
.parameter "authToken"
.parameter "performRetry"
.prologue
.line 1083
if-eqz p2, :cond_d
.line 1084
iget-object v0, p0, Lcom/android/vending/BaseActivity;->mApplication:Lcom/android/vending/VendingApplication;
invoke-virtual {v0, p1, p2}, Lcom/android/vending/VendingApplication;->setCachedAuthToken(Lcom/android/vending/BaseActivity$AuthService;Ljava/lang/String;)V
.line 1085
if-eqz p3, :cond_c
invoke-virtual {p0}, Lcom/android/vending/BaseActivity;->doRetry()V
.line 1089
:cond_c
:goto_c
return-void
.line 1087
:cond_d
const-string v0, "null auth token."
const/4 v1, 0x0
new-array v1, v1, [Ljava/lang/Object;
invoke-static {v0, v1}, Lcom/android/vending/util/Log;->d(Ljava/lang/String;[Ljava/lang/Object;)V
goto :goto_c
.end method
p3 takes you to cond_c which is an auth login retry
p2 looks like it loads the vending app and then tries to get pass AuthService() to setCachedAuthToken(), and if that fails takes you to "null auth token" tossed into log.
Progress!!!!
I got the app to load without closing by removing all calls to onAuthTokenComplete, completeGetAuthToken, and onActivityResult.
Now I'm stuck at the ToS page, it won't load anything, so I'll try to bypass that.
past the ToS and stuck at market "Loading" screen.
removed the call to forwardIfNeededToTosActivity in BaseActivity.
Here's where I'm at right now, all necessary files inside, should work on a vanilla build of master. Either update.zip flash it or adb push it, whatever.
I'm tired, need sleep
Hope somebody else works on this too.
Cant sleep without this suggestion. Hopefully somebody is reading and can make it work.
At this point, I think we're just requiring a login so we can browse market. Search never completes, browse never completes, and I think it's because we're not logged in. If we pull whatever necessary bit from /data/data/com.android.vending from a working market build and toss it in, it should, theoretically again, work. If we remove the personal logins and pass it something generic, it should work too.
I'm still bothered by something, though, what happens with paid apps? Probably a force-close.
Anyway, I hope google at least releases a "free market" app that's standalone and we can toss into generic builds without anything else needed so we can at least download free apps.
it's a database problem.
I know nothing of sqlite so this is as far as I get
use youtube app to login.
either you already have it working or you're just suggesting that I use youtube app to login. I tried it but doesn't work with my hacked market. Is there another way that you know of?
jubeh said:
either you already have it working or you're just suggesting that I use youtube app to login. I tried it but doesn't work with my hacked market. Is there another way that you know of?
Click to expand...
Click to collapse
Have you logged in with your Google or with your YouTube account?
Yeah, I tried it with my google account (and it's already synced to my youtube account). I then opened up the market app I attached to an earlier post and still hanged at the "Loading" screen.
I then pushed a full Market app, which dutyfully force-closed due to the missing GoogleApps.apk, I then pushed it, SetupWizard, Checkin, and the rom started boot-looping so I gave up
how to use Market.zip?thank you!
Launched on CyanogenMod v5.0.7 (Android 2.1) Dream
In order to launch Market app you need Vending.apk, GoogleApps.apk, GoogleCheckin.apk, SetupWizard.apk, TalkProvider.apk, gtalkservice.apk and these framework files:
Code:
/system/etc/permissions/com.google.android.datamessaging.xml
/system/etc/permissions/com.google.android.gtalkservice.xml
/system/framework/com.google.android.datamessaging.jar (often absent, seems works without it)
/system/framework/com.google.android.gtalkservice.jar
/system/lib/libgtalk_jni.so
Vending.apk, GoogleApps.apk, SetupWizard.apk, gtalkservice.apk should be placed only on /system (because they require privileges that can be acquired only there, like WRITE_SECURE_SETTINGS, see https://www.isecpartners.com/files/iSEC_Securing_Android_Apps.pdf), GoogleCheckin.apk & TalkProvider.apk probably can be placed anywhere (but I didn't try).
no success
I have try it follow your instructions,
but with no success;
it stays in the UI "Searching..."
any suggestion?
I put your vending.apk to /system/app/,
and the com.google.android.gtalkservice.jar to /system/framework/;
and
com.google.android.gtalkservice.xml
com.google.android.datamessaging.xml
to /etc/permissions/
am I right?
this would be crucial if I could get this too work. I have a Camangi WebStation, which runs a custom Cupcake 1.5 with NO GAPPS or Market even worse NO Google Maps. I would love to get Google Maps to work on it, cause it has a GPS, but no GPS app or Maps function. But yeah it dont have the Google branding, so it doesnt have any important Google Apps.
If this could be implemented to work on other devices, it would be freaking nice
This doesn't work, at least in it's current form, and I have no interest on working on it. This was from when we had the infinite sync problem with eclair and I wanted to make a rom without gapps and just market.
Also, this is not for users, this was for dev help to try to make a googlelogin that vending could use after bypassing the check for googleapps.
Mod, please close this thread.
Where to get
com.google.android.datamessaging.xml etc.,
Please let me know
thanks
-Venu
I USE THIS SETUPS
adb remount
adb push whatever.apk /system/app (put an apk in your sdk tools and replace "whatever" with the name of the apk and this
will push it to your system app folder. You can change the destination as well for example: You want to push Launcher2.apk
to your data/app folder: adb remount
adb push Launcher2.apk /data/app )
but when i type adb remount in cmd show this error
C:\android-sdk\tools>adb remount
remount failed: Operation not permitted

[MOD] YouTube that always defaults to high quality

I got fed up with the YouTube app starting videos in normal quality. To watch high quality I had to click menu and select it. The app is supposed to default to a quality suitable for your current connection but IMHO it sucks at that.
My solution was to mod the app so it always defaults to high quality. It was a 2 minute hack using apktool from brut.all (great tool, thanks!). Changes was made to PlayerActivity.smali. All I did was to remove a if condition statement by adding a # first on the line (comment) so preferHiRes always is true.
Code:
.line 166
invoke-virtual {p0}, Lcom/google/android/youtube/PlayerActivity;->getNetworkSpeed()I
move-result v0
const/4 v1, 0x3
#if-ne v0, v1, :cond_0
const/4 v0, 0x1
:goto_0
iput-boolean v0, p0, Lcom/google/android/youtube/PlayerActivity;->preferHiRes:Z
.line 168
invoke-direct {p0}, Lcom/google/android/youtube/PlayerActivity;->loadYouTubePlayer()V
Source apk is YouTube.apk from gapps-passion-EPE54B-signed.zip.
Download HQ mod
Install (root required, tested on CM 5.0.6):
Extract the apk from the zip (it's NOT a flashable update.zip)
Push it to /system/app
Code:
adb remount
adb push YouTube.apk /system/app/YouTube.apk
This mod is provided as is without guarantees. It works for me and I though I'd share it in case anyone else wanted it. Nandroid first is always good.
AWESOME!!!
There's a thread in the general forum with a modified apk file. Works great
http://forum.xda-developers.com/showthread.php?t=632969&page=6
jonasl, just a nood question...
Where would it have to put "#" to set low qualitiy as default?
Missed the other one completely... I didn't look for app mods in the Q&A section
To get normal quality as default you should ensure that the boolean variable preferHiRes always is false. There are several ways to do this. A rough translation of the original assembly code to java would look something like this
Code:
if(getNetworkSpeed() == 3)
preferHiRes = true;
else
preferHiRes = false;
loadYouTubePlayer()
My mod takes away the if so the code logically runs like this
Code:
if(true)
preferHiRes = true;
else
preferHiRes = false;
loadYouTubePlayer()
You want something like
Code:
if(true)
preferHiRes = false;
else
preferHiRes = false;
loadYouTubePlayer()
This could be done like this
Code:
.line 166
invoke-virtual {p0}, Lcom/google/android/youtube/PlayerActivity;->getNetworkSpeed()I
move-result v0
const/4 v1, 0x3
#if-ne v0, v1, :cond_0
const/4 v0, 0x0
:goto_0
iput-boolean v0, p0, Lcom/google/android/youtube/PlayerActivity;->preferHiRes:Z
.line 168
invoke-direct {p0}, Lcom/google/android/youtube/PlayerActivity;->loadYouTubePlayer()V
Notice that I have only changed const/4 v0, 0x1 to const/4 v0, 0x0. This corresponds to the pseudo java code outlined above.
Of course one could rewrite it all a little bit more for easier reading:
Code:
preferHiRes = false;
loadYouTubePlayer()
This would correspond to
Code:
.line 166
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/google/android/youtube/PlayerActivity;->preferHiRes:Z
.line 168
invoke-direct {p0}, Lcom/google/android/youtube/PlayerActivity;->loadYouTubePlayer()V
.line 169
return-void
.end method
Find .line 166 in PlayerActivity.smali and substitute everything between it and .end method with the snippet above. Change const/4 v0, 0x0 to const/4 v0, 0x1 to default to high quality.
Hope you learned something from this... I know I suck at explaining things that I think are simple but I'm trying Sharing knowledge is what pushes this and other communities forward.
Thanx for taking your time and sharing knowledge, I appreciate it!
jonasl said:
I know I suck at explaining things that I think are simple but I'm trying
Click to expand...
Click to collapse
You don't suck. That was excellent.
Thanks.
wow~thanks!!!!
it works for my hero!
btw, do you know how can i set my location in this app?
my previous youtube app's front page showed the video according to my location(Hong Kong ) such as Most viewed, most discussed...etc...
but now seems to be connected to worldwide...
No idea about the localization. Everything changed is outlined above (ie I haven't touched it). I would guess that the application checks your locale to determine what to show since that's how other Google stuff works (GeneWidget for example). Maybe other versions of the apps works different from this one.
thanks for your reply!
actually i've tried several versions of Youtube.apk...
only some older versions could check my locale correctly, but, those are not high quality supported in 3G connection...
it's there any methods that can change the older versions youtube.apk to default always high quality??
not to be condescending, but a youtube that defaults to HQ was done like back in january...
http://alldroid.org/threads/14738-app-script-xUltimate-v1.2.4-**UPDATED-02-17-10**
and thats just to show that a patcher xeudoxus created already had it implemented by the end of january...i dont remember exactly how much further back it was actually released.
Wow~finally I did it too!
I followed your instruction and usee apktool to modify the older version YouTube.apk and it really work on my Hero
There was some differents as it didn't have PlayerActivity.smali, instead, i found YouTubeplayer.smali which is similar to it.
I just removed the whole line of ' if-ne v0, v1, :cond_0 ' and didn't change anything.
Really thanks for your instruction. I can now see the local high quality videos!
File is uploaded in case someone needs.
I tried to push the YouTube.apk to /system/app/YouTube.apk but it gives me an error about read only file system.
Does anyone know how to solve this?
Thanks.
crimsondr said:
I tried to push the YouTube.apk to /system/app/YouTube.apk but it gives me an error about read only file system.
Does anyone know how to solve this?
Thanks.
Click to expand...
Click to collapse
do:
adb remount
first.
gIMpSTa said:
do:
adb remount
first.
Click to expand...
Click to collapse
That worked. Thanks!
MYxdaUSERNAME said:
not to be condescending, but a youtube that defaults to HQ was done like back in january...
http://alldroid.org/threads/14738-app-script-xUltimate-v1.2.4-**UPDATED-02-17-10**
and thats just to show that a patcher xeudoxus created already had it implemented by the end of january...i dont remember exactly how much further back it was actually released.
Click to expand...
Click to collapse
Off topic: Not getting what you are trying to say and the link doesn't contain any details. Personally I don't really care if someone made a similar or identical mod before me. I'm not in for the attention. I'm in for the fun of it and then share stuff I think others will enjoy as well (including the know how). Also, this mod isn't exactly that advanced so anyone with some basic Dalvik experience could have done it independently just as I did.
On topic:
If you are getting messages about xml parser errors (that can just be dismissed my hitting back):
I've been getting this more and more myself both prior to applying my HQ mod and afterward. It's not related, not if you are using my mod anyway. What's changed in my mod is described in detail in this thread and it's not related to xml parsing. Several users of stock firmware have this issue as well, here are some examples:
http://www.google.com/support/forum/p/android/thread?tid=7520c38a6e2e4ce3&hl=en
http://www.google.com/support/forum/p/android/thread?tid=44b225740841f9d4&hl=en
http://www.droidforums.net/forum/te...ggestions/20880-connection-error-youtube.html
The solution seems to be to clear the YouTube data and cache in Manage Applications. Try this if you run into this issue.
Always HQ built into version 1.6.20
I just discovered that Youtube version 1.6.20 has this option built in already. It's in the settings menu. I pulled it from Paul's Desire rom and it works perfectly. It also has a HQ toggle button on the right side of the time slider.
gj13 said:
I just discovered that Youtube version 1.6.20 has this option built in already. It's in the settings menu. I pulled it from Paul's Desire rom and it works perfectly. It also has a HQ toggle button on the right side of the time slider.
Click to expand...
Click to collapse
Could you post the apk?
hey i do i go back to the regular setting theres alot of videos that dont have the high quality option im assuming so they wont even play for me
Aitese said:
Could you post the apk?
Click to expand...
Click to collapse
here: YouTube 1.6.20 (E)

Samsung RIL (Low level network info)

All,
I am attempting to obtain low level network info from RIL.java, from my Samsung SGH-I747. Per thread https ://groups.google.com/forum/?fromgroups=#!topic/android-platform/tVyNMnXtcEI,
Using OEM_REQUEST_RAW requests, I can bypass everything and make raw byte string requests to and from the radio.
- requests to ril: "> OEM_HOOK_RAW"
- responses from ril: "< OEM_HOOK_RAW"
By default however, you cannot see these responses to the log as byte[] types are ignored in method retToString (RIL.java)
Change to RIL.java:
} else if (ret instanceof byte[]) {
byte[] bytes = (byte[]) ret;
s = IccUtils.bytesToHexString(bytes);
Unfortunately, Samsung seems to have added a lot of code to RIL.java and there is no place to get the source. So I added this code in smali. (wasn't fun haha)
Code:
:cond_81
move-object/from16 v0, p2
instance-of v13, v0, [B
if-eqz v13, :cond_93
check-cast p2, [B
.end local p2
move-object/from16 v1, p2
check-cast v1, [B
.local v1, bytes:[B
invoke-static {v1}, Lcom/android/internal/telephony/IccUtils;->bytesToHexString([B)Ljava/lang/String;
move-result-object v10
.restart local v10 #s:Ljava/lang/String;
goto/16 :goto_4
.end local v1 #bytes:[B
.end local v10 #s:Ljava/lang/String;
.restart local p2
Before & After - No change
[email protected]:/ $ logcat -b radio|grep OEM
D/RILS ( 1937): [0007]< OEM_HOOK_RAW { what=1008 when=-2m37s688ms }
D/RILS ( 1937): [0008]> OEM_HOOK_RAW[010300060001]
D/RILS ( 1937): [0008]< OEM_HOOK_RAW { what=1008 when=-2m37s914ms }
D/RILS ( 1937): [0009]> OEM_HOOK_RAW[010300060001]
But there is no bytes written from the log, just OEM_HOOK_RAW { what=1008 when=-2m37s914ms }. Any ideas?
I'm also trying similar. I'm currently trying to enable QXDM logging on my Galaxy S3, but since Samsung took away the radiooptions command that's in AOSP, I'm having absolutely zero luck. Samsung's RIL looks to be considerably different, I found a repo of the code here: http://gitorious.org/replicant/hardware_ril_samsung-ril/trees/master.
I also tried my hand at doing it through the SDK and ran into issues since you must be able to get a Phone object in order to actually communicate with the RIL that is defined in RIL.java (at least from what I've seen). The problem is that the in order to get the defaultPhone, you have to run your application in the Phone process, which requires you to sign it with the same key as the Phone class, which seemed too bothersome to be practical.

[Q] Help defining values in PhoneNumberUtils.smali [SOLVED]

It seems to be a reoccurring problem across many roms, even some stock, that incoming calls without prefix (+47 etc) does not do lookup (and match) to contact stored with prefixes. Now there is an app called Prefixer wich can do alot with the subject, but it seems no app can actually manipulate the incoming call ID. Thus, after alot of ravaging through here and other forums, I've been led to the conclusion that this is bad/wrong values in the following file:
Framework.jar->classes/android/telephony/PhoneNumberUtils.smali
Now the values I was told to look for was :
Code:
.local v7, minMatchLen:I
const/4 v7, 0xb
.local v0, minMatchLen:I
const/4 v0, 0xb
And change the minMatchLen:I vaules to:
Code:
.local v7, minMatchLen:I
const/4 v7, 0x7
.local v0, minMatchLen:I
const/4 v0, 0x7
Now - When I extracted the PhoneNumberUtils.mali from my current rom (Gthrill V3 (CM10 mod), The corresponding values were:
Code:
.local v7, minMatchLen:I
const/16 v7, 0xb
.local v0, minMatchLen:I
const/16 v0, 0xb
What I'm really wondering here is - can someone elaborate what these lines define - and what the practical difference between "const/4" and "const/16" acually is?
const/16 allows for a bigger value than const/4
It's safe to lower it from 0xb (11) to 0x7 (7) and leave the const/16 alone.
If you have a const/4 and wanted to apply a larger value, chances are a smali compile will fail without changing the const/4 to const/16.
Thanks - cleared up alot Luckily I was "already at 16". And, it might explain why I got stuck in boot loop when I tried to change the values to const/4 v0, 0x7 ...(?)
Deleted.

[APP][MOD][TUT]Discussion: Plex w. Android TV UI for ANY DEVICE

So, I have a Nexus Player, and I absolutely LOVE the way the UI for Plex looks on it. It has a number of added categories and features, and overall, it's just really pretty, and highly preferable to the regular "TV" option in the Plex app.
Unfortunately, the good folks at Plex decided to reserve this only for Android TV...which sucks. I just bought a RikoMagic V5 Rk3288-based Android on a stick to replace my aging RK2066 device, and when it arrives, I'd like the same sexy experience as I have on the Nexus player.
I can already install the leanback launcher...so why not get the plex UI to go with it?
So that's what I did.
EDIT: LOL. So, instead of modifying the APK, it looks like we can just add the permission file it's checking for to /system/etc/permissions/ I've attached it...simply download, extract, copy to /system/etc/permissions, and reboot. Presto! Pretty plex.
I'll leave the other method simply because it's good to know how to do, and can be applicable to many other situations.
HOWEVER, there's an obvious problem. You either have to have purchased the app, or have a Plex Pass to use it. I have not explored the paid version of the app yet, just the Plex Pass one...but that will be done shortly. First I wanted to share my discovery.
Basically, the check for whether or not the device is an Android TV lives in \smali\com\plexapp\plex\application\PlexApplication.smali when you decompile the APK.
In this method:
Code:
.method public B()Z
.locals 2
invoke-virtual {p0}, Lcom/plexapp/plex/application/PlexApplication;->a()Z
move-result v0
if-eqz v0, :cond_0
invoke-virtual {p0}, Lcom/plexapp/plex/application/PlexApplication;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
const-string v1, "android.software.leanback"
invoke-virtual {v0, v1}, Landroid/content/pm/PackageManager;->hasSystemFeature(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_1
:cond_0
const/4 v0, 0x0
:goto_0
return v0
:cond_1
const/4 v0, 0x1
goto :goto_0
.end method
Here, the code is obfuscated, but the original method is called isAndroidTV. Either way, searching for "android.software.leanback" should get you into the method.
Now, all this is really doing is asking the system if it has the flag "android.software.leanback", so we could probably modify build.prop? to have that flag and be right with the world. But, I haven't tried that yet.
Instead, if we read through what the method is doing, we can see that if it finds "android.software.leanback", it goes to condit_1, which sets const v0 to 0x1, or a "yes" return. So, what if it fails? It runs to cond_0, which instead sets const_v0 to 0x0, or "no".
So, the obvious fix to this is to just make cond_0 return 0x1, or the following code:
Code:
.method public B()Z
.locals 2
invoke-virtual {p0}, Lcom/plexapp/plex/application/PlexApplication;->a()Z
move-result v0
if-eqz v0, :cond_0
invoke-virtual {p0}, Lcom/plexapp/plex/application/PlexApplication;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
const-string v1, "android.software.leanback"
invoke-virtual {v0, v1}, Landroid/content/pm/PackageManager;->hasSystemFeature(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_1
[B][U] :cond_0
const/4 v0, 0x1
[/U][/B]
:goto_0
return v0
:cond_1
const/4 v0, 0x1
goto :goto_0
.end method
That's it. Just flip the 0x0 to a 0x1 and recompile the apk. Due to it being a Play Store app, it's also necessary to resign with a test key so we can install it.
Here is a link to the final output that I was able to install on my 5.0.1 (lollipop) GPE ROM running on a HTC M8. At this time, I'm unsure whether it will A. Work on a non-lollipop ROM or B. Work on a ROM that doesn't allow test-key signed apps.
However, it is a working proof of concept, and could prove useful to others who use android devices as media center devices.
Also, attached is a screenshot of the POC, albeit looking poor on my phone.
Feel free to try the attached APK and let me know how it works for you. Mods - this is the free Plex Pass version - aside from changing the above .smali, I have not modified or circumvented any other security features (like making it work for everybody). You must have a Plex Pass account to use this.
Post2: Compatibility testing, screenshots.
So, I was able to successfully install the apk on a stock, unrooted Galaxy Tab 4 running android 4.4.2, so it looks like this should work for a lot of people. Screenshots attached. It looks beautiful on a tablet, and despite being made for TV, all touch input works properly.
digitalhigh said:
Post2: Compatibility testing, screenshots.
So, I was able to successfully install the apk on a stock, unrooted Galaxy Tab 4 running android 4.4.2, so it looks like this should work for a lot of people. Screenshots attached. It looks beautiful on a tablet, and despite being made for TV, all touch input works properly.
Click to expand...
Click to collapse
can you mod the non-plexpass version of plex to do this?
defconoi said:
can you mod the non-plexpass version of plex to do this?
Click to expand...
Click to collapse
Unfortunately, it doesn't look like they've pushed that UI to the non-pass version. More than likely, they'll roll it out to all users in the next update or the one after that - at least - that's how Plex usually does things.
When that happens, I'll *still* not be able to release it, as it's a paid version of the app. However, it's possible I could provide a tool to do all the work for people who do have it.
Digitalhigh,
I cannot thank you enough! love your work.
Rob.
I tried it on my xiaomi mibox mini which is running Android 4.4.2. The app starts in leanback mode and I can browse the contents but can't play anything
Sent from my MI NOTE LTE using Tapatalk

Categories

Resources