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
Hey everyone, I just posted this in the Vibrant forums, but its universal, anyone on Android that hates the carrier tab in the market, here's a solution!
Ok, so while I was re-theming the newest market update for myself, I was finally annoyed enough with the carrier tab/channel in the android market to find a way to disable it entirely.
Simple, SIMPLE change takes care of it.
Decompile Vending.apk, and open /com/smali/android/vending/AssetBrowserActivity.smali
look for the following line:
Code:
invoke-virtual {v5}, Lcom/android/vending/model/GetCarrierInfoResponse;->isCarrierChannelEnabled()Z
a couple of lines beneath that, comment out the following two lines:
Code:
if-eqz v5, :cond_4
if-eqz v2, :cond_4
And then immediately after you've commented those out, add the following:
Code:
goto :cond_4
So the final code in my Vending.apk looks like this:
Code:
invoke-virtual {v5}, Lcom/android/vending/model/GetCarrierInfoResponse;->isCarrierChannelEnabled()Z
move-result v5
# if-eqz v5, :cond_4
# if-eqz v2, :cond_4
goto :cond_4
And voila, no Carrier tab/channel anymore!
PLEASE NOTE! This will remove the carrier tab entirely, there is no way to browse the carrier channel using this method.
Anyway, hopes this helps someone else too.
Cheers everyone, =)
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.
Hello everyone!
First of all, thank you for the work put in this site. Been using it for months and you're just great.
Phone info:
I'm from Argentina, under PERSONAL carrier.
Device Moto G 2013 XT1032, Lollipop 5.1.1, Kernel 3.4.109-AOSP (alberto97's) Unlocked Bootloader, Rooted, Using TWRP 3.0.2-0, Xposed v.86, SuperSU v2.76.
One week ago I flashed "XT1032_Retail_US_51_Optimized_v1.0 5.1" over my Personal Argentina Retail stock 5.1 rom (it came with the phone), installed "AOSP-5.1.1-20150923-falcon-alberto97", Gapps Pico, and so on.
Now my incoming calls are not being recognized as contacts. Here in Buenos Aires, Argentina, the complete "international" number with area code and prefix (for mobile phones) is +54 9 11 X XXX XXXX. "54" Country, "9" Mobile, "11" Buenos Aires". Whatsapp gets and show numbers in that International format. Incoming calls and SMS arrive without the "9" for example "+54 11 X XXX XXXX" and my phone always recognized the contact. (It even recognized incoming calls and SMS If the number was stored like 11 X XXX XXXX, 0 11 15 X XXX XXXX, 11 15 X XXX XXXX (15 is mobile phone locally, but from mobile to mobile it's not required) and with one or two different formats.
The point is, after flashing 5.1 Retail US and 5.1.1 AOSP, the contacts are not recognized if they have the "9", (the way it shows on Incoming Calls and SMS) (but then, If i edit the contact number, Whatsapp doesn't recognize it for lacking that "9"). I refuse to have two different numbers for each contact, with and without the "9".
What I would like is the phone to recognize incoming calls WITHOUT the "9", when the contact is stored WITH that "9" between Area Code and the rest of the numbers. Or change the incoming calls format so it "reads" or "adds" the "9" between +54 and 11.
- I searched and searched for info and solutions but wasn't able to fix it.
- I deleted all my contacts, changed in default country code on Google Contacts, went back to Argentina and re-synced with phone, no luck.
- I tried editing ro.phone.min_match on build.prop to 7,8,9,10,11, (with and without deleting from phone and re-syncing contacts from google) no luck.
- I tried with Prefix app on Google Play, no luck.
-I tried understanding classes and searched Android Developers pages to see if I could get it working but my knowledge doesn't go that far (at least regarding Android).
- I opened "PhoneNumberUtils.smali" but didn't find this code to edit:
Code:
.local v7, minMatchLen:I
const/4 v7, 0xb
.local v0, minMatchLen:I
const/4 v0, 0xb
Some said to change that "b" value to "7" or another number, depending on my country number format. Nevertheless, isn't this the same as establishing a min match on build.prop?
So, I'm running out of imagination. I always try to find the answer/fix to avoid posting about issues but this is getting a bit hard.
TO-DO: I downloaded a 5.1 retail Argentina Personal stock rom. I will try to look for the "PhoneNumberUtils.smali" file and use it to replace the one on my phone to see if it works.
EDIT1:
I managed to get "PhoneNumberUtils.smali" from stock Personal Argentina retail 5.1 rom but the code I'm looking for isn't there neither.
EDIT2:
Found ".field static final MIN_MATCH:I = 0x7" at the beginning, was set to 0x7.
Found this code:
Code:
.method public static toCallerIDMinMatch(Ljava/lang/String;)Ljava/lang/String;
.registers 5 [B](Note by me: What's this number?)[/B]
.param p0, "phoneNumber" # Ljava/lang/String;
.prologue
.line 788
invoke-static {p0}, Landroid/telephony/PhoneNumberUtils;->extractNetworkPortionAlt(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
.line 792
.local v2, "np":Ljava/lang/String;
const-string v3, "gsm.sim.min.match"
invoke-static {v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
.line 793
.local v1, "minMatchProp":Ljava/lang/String;
invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v3
if-nez v3, :cond_19
.line 794
invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
.line 799
.local v0, "minMatch":I
:goto_14
invoke-static {v2, v0}, Landroid/telephony/PhoneNumberUtils;->internalGetStrippedReversed(Ljava/lang/String;I)Ljava/lang/String;
move-result-object v3
return-object v3
[B]
.line 796
.end local v0 # "minMatch":I
:cond_19
const/4 v0, 0x7[/B]
.restart local v0 # "minMatch":I
goto :goto_14
.end method
Apparently it's set to 0x7, so it should compare the last 7 digits, so theoretically it should be detecting the numbers as contacts, but it doesn't :/ .
Sorry for the long post. I tried to be as specific as possible but incorporating everything that I thought it would help.
Thanks again!!!