Jump to content

Market Enabler Workaround


Guest HellSt0rm

Recommended Posts

Guest HellSt0rm

Disclaimer: Use on your own risk.

I have seen several places on the net, that people have trouble sometimes to access paid apps (countries where paid apps are not available).

And sometimes the market enabler app that is hosted on the net somewhere, does not work, or it force closes and/or reboots the phone.

I have now successfully found a way that works for me in order to access paid apps.

The code was not written by me, but I have altered a little segment in order to make it more reliable.

The segment that I changed used a little script trickery to find and parse the PID of the android market and kill that process (in order for the script to parse it's changes).

This worked with various results and sometimes not at all.

My change from the original code was to use the pkill command instead of the kill, ps, grep, tr and cut commands.

From this:

kill $(ps | grep vending | tr -s ' ' | cut -d ' ' -f2)
To this:
pkill vending
Not much of a change, but hey, it worked. And have worked for me ever since. I have tested this on a HTC Hero with a MoDaCo 3.2 rom. I'm not a 100% sure on how many roms or which ones that have busybox with the pkill included. So if this doesn't work on your phone, there might be two reasons. Either you don't have SU (root) or your missing busybox with pkill. Now for the whole script and instructions :) I used an app from MiroMind called GScript, it's an app to run shell scripts. There is both an free app (with ads) and a priced app (without ads). Here is a link to the Cyrket page for GScript Lite (free app with ads) http://www.cyrket.com/p/android/nl.rogro.GScriptLite/ We will make at least three scripts. 1) Current Market 2) Default Market 3) T-Mobile Us Market First one to check the values of your current market. Second one to change to your current market And a third one to change to a market with paid apps. For now I only have the values for the T-Mobile US market, and my current market (Telenor Norway). Fire up GScript -> Press the menu button -> Choose add script -> Name it Current Market Make sure that you have a check mark in the box with the text "Need SU?" (yes we need it ;)) In the big white field enter this code:
getprop gsm.sim.operator.numeric

getprop gsm.operator.numeric

getprop gsm.sim.operator.iso-country

getprop gsm.operator.iso-country

getprop gsm.sim.operator.alpha

getprop gsm.operator.alpha
Save the script and then run it. Write down the values that comes up on the screen (hint: if you touch the blue screen, the auto close wil stop). You need these values to make the next script. Example output from my own phone:
24201

24201

no

no


N Telenor
In the next script we will use the values from the last script to form a script to reset your market back to default. Make a new script, with SU, name it Default Market and enter the code and the values you wrote down. PS: Allways be a 100% sure that you write the commands down correctly, the wrong use of "rm" can be really bad.
setprop gsm.sim.operator.numeric ""

setprop gsm.operator.numeric ""

setprop gsm.sim.operator.iso-country ""

setprop gsm.operator.iso-country ""

setprop gsm.sim.operator.alpha ""

setprop gsm.operator.alpha ""

pkill vending

rm -rf /data/data/com.android.vending/cache/*
Hint: Add the values in between the quotation marks. remember to use the quotation marks also (essential if the value has a space in them). The values you wrote down is in the same order that you shall write them here. And if there did not come any value, but just blank, then don't fill in anything between the quotation marks. Just leave them as this "" Here is an example on how I wrote the output from the last script into this script:
setprop gsm.sim.operator.numeric "24201"

setprop gsm.operator.numeric "24201"

setprop gsm.sim.operator.iso-country "no"

setprop gsm.operator.iso-country "no"

setprop gsm.sim.operator.alpha ""

setprop gsm.operator.alpha "N Telenor"

pkill vending

rm -rf /data/data/com.android.vending/cache/*
This last script will make us able to change to the T-mobile US Market. Make a new script, with SU, name it T-Mobile US Market and enter this code:
setprop gsm.sim.operator.numeric "310260"

setprop gsm.operator.numeric "310260"

setprop gsm.sim.operator.iso-country "us"

setprop gsm.operator.iso-country "us"

setprop gsm.sim.operator.alpha "T-Mobile"

setprop gsm.operator.alpha "T-Mobile"

pkill vending

rm -rf /data/data/com.android.vending/cache/*

Run this script.

You can check if the values are in place with your "current market" script.

open your market and check if it has changed and let you see priced apps.

Usually I just change to the T-Mobile Market when I want a paid app or I want to update my paid apps. The rest of the time I'm on the default market. I do this because I'm uncertain on how this affects my mobile internet and how they see me and my phone. Don't want a bigger bill because I'm "roaming" T-Mobile, and that is why I also change the market away from my default market only when I have Wi-Fi access. (call me paranoid :P hehe, but we never know)

So if you don't have pkill, you can work around this by using a taskkiller and killing off market before you run your scripts.

In such cases you can also ommit the "pkill vending" part of the script.

You can also ommit the "rm" command if you clean out the android market cache manually each time you change market

Clean the cache after you have runned the script and killed the android market and before you open the market again.

You clean it out manually by going to settings -> applications -> manage applications -> Market and choose clear cache.

One last note:

GScript lets you add shortcuts on your homescreen to activate each of the scripts.

Do this by either long-pressing the home screen, press menu and choose "add to home" or the plus sign on the htc hero while you are on the home screen.

choose shortcut -> Gscript or GScript Lite -> and then choose the script you want on the home screen ;)

Edited by HellSt0rm
Link to comment
Share on other sites

I've found that wiping the dalvik-cache restore Market Enabler funktionality. Can just boot up in Amon RA reccovery mode and wipe>Dalvik-cache.

Link to comment
Share on other sites

Guest HellSt0rm

Good to know :)

Btw the makers of market-enabler has also changed from the grep command to the killall command, basically almost the same as this script only with killall instead of pkill.

And the market-enabler also has more options.

Link to comment
Share on other sites

  • 4 months later...

thanks for sharing this!

I was planning on using this in ASE but it doesn't seem to support running scripts as su yet so I'll use GScript for it :D

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.