[MOD] [FIX] Remove roaming on home network - Elephone P8000

Disclaimer:
This fix is based on the work of wmn79, his thread concerning this issue can be found here: http://forum.xda-developers.com/goo...od-loose-roaming-r-mvno-home-network-t2969702
Backup your system!
This fix works for me and I share this with you. I am not responsible for any damage to your phone or any data loss you encounter.
Symptom:
When connecting to home mobile network you have to enable data roaming in order to get data working.
Cause:
Your mobile provider is using different MNC numbers which are not recognized by Android as a non roaming network.
Fix:
According to wmn79's thread we can fix this by modding the framework-res.apk of Android. He mentions in his thread to push the modified apk with custom recovery update.zip. As I want to stay on stock rom this is no solution for me and fortunately there is a way without custom recovery.
Root your phone. I am on stock 090915 (OTA) and it came pre-rooted. All I need to do was installing SuperSU from Playstore.
Copy framework-res.apk from /system/framework to your computer
Install apktool (http://ibotpeaches.github.io/Apktool/install/)
Install framework: "apktool if framework-res.apk"
Decompile framework-res.apk: "apktool d framework-res.apk"
Edit/Create Files in created framework-res folder (details below)
Compile framework-res.apk: "apktool b -c framework-res"
Copy the modded framework-res.apk (It is inside the framework-res/dist folder) to the Downloads folder of your phone. Do not copy it directly to the /system/framework folder!
Use your favorite file explorer (I use ES File Exporer), mount /system read/write and move the framework-res.apk from your Downloads folder to /system. Again, do not move it to /system/framework folder!
Inside the /system folder check and correct the permissions of the file, it should be rw-r--r-- and should belong to root:root.
Now you should move (do not use copy!) the file from the /system folder to /system/framework
Shortly after this is done on my phone several Google services and apps were killed, just for your information. They work again without problems after a reboot.
Reboot your phone
The process of moving the framework-res.apk to the /system/framework folder is for example in this video: https://www.youtube.com/watch?v=SbjQcFpt39k
So you know how to install the mod, but what is it about? When you decompiled the framework-res.apk there is a folder named "res" inside of the folder "framework-res". In this folder you have to create a new one with the mnc and mcc numbers from your apn settings. I describe this on the example of O2 in Germany. O2 has mcc 262 and mnc is 07. The folder to create is "values-mcc262-mnc07" inside this folder create a file named "arrays.xml". Actually I just copied the hole thing from another folder and edited it to the following contents:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="config_operatorConsideredNonRoaming">
<item>26203</item>
</string-array>
</resources>
The item consists of the mcc and mnc number of the network which can be used without roaming. In this example this is the former E-Plus network which is merged with the O2 network. E-Plus network has mcc 262 and mnc 03. I got the information regarding mcc and mnc numbers from this site: http://mcclist.com/mobile-network-codes-country-codes.asp
There can be more than one item in the string-array list.
I have done this, tested it and for me it's working perfectly. You can find my framework-res.apk attached if you are on O2 as well. If you are on a different network and got stuck on my explanation just give me the mcc and mnc numbers and I provide you with a framework-res.apk. As the framework-res.apk is tight to the ROM this will only work if you are on stock 090915.
Caution:
Using a framework-res.apk which is not for your ROM can end in a bootloop!
Cheers

I follow this fix and i have no more "R" on both sim "Virgin" and "Free" FR.

neonero said:
I follow this fix and i have no more "R" on both sim "Virgin" and "Free" FR.
Click to expand...
Click to collapse
I am happy I could help and appreciate the feedback.

Solution for Eragon-ROM users with carrier HoT (Austria) can be found here: http://forum.xda-developers.com/showpost.php?p=64570843&postcount=3438
The attached .zip contains all the changes that I performed to the framework-res.apk inside the res-folder, so If you use a different ROM and/or a different ROM version, you might just patch YOUR framework-res with the same files.
By the way, I also had to wipe cache/dalvik in recovery before the changes were detected by the ROM.

Is it possible to do this for P9000?

Qhris said:
Is it possible to do this for P9000?
Click to expand...
Click to collapse
yes it is
btw
. in 3 weeks i will have also a p9000
so developing will be ........

skeleton1911 said:
. in 3 weeks i will have also a p9000
so developing will be ........
Click to expand...
Click to collapse
:good: looking forward to getting my 9000 light as well.

thanks

Thanks very much - worked very fine for me with Telering.
folder "res/values-mcc232-mnc7"
arrays.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="config_operatorConsideredNonRoaming">
<item>23203</item>
<item>23204</item>
<item>23205</item>
<item>23207</item>
<item>23210</item>
<item>23214</item>
<item>23216</item>
</string-array>
</resources>

Does this still work? Any hope to put this into a magisk module?

Related

Questions About spn-conf.xml and Framework-res.apk, I'm Totally Frustrated....

Hi guys... I have couple questions and I'm totally frustrated because of them...
About spn-conf.xml:
I've examed every possible way to modify the file.. as author HTC Shawn Ku said:
Code:
<spnOverrides
numeric="MCC+MNC"
spn="SPN Name"/>
so I modify the file and it looks like following now:
Code:
<?xml version="1.0" encoding="utf-8"?>
<spnOverrides>
<spnOverride
numeric="46000" <!--chinese spn code-->
spn="Yanzi"/>
</spnOverrides>
I tried but did not work at all..
so I tried to delete tags <spnOverrides> and </spnOverrides>, or
Code:
<spnOverrides
numeric="46000" <!--chinese spn code-->
spn="Yanzi"/>
but they did not work at all...
So how can I modify the spn name?
About Framework-res.apk (from MoDaCo r3.1):
I want to modify framework-res.apk and I read a lot of posts talking about it.. However, I still do not know why every time after I flashed a modified framework-res.apk, my desire storage reduced 10mb-20mb.. right now only 30mb remains...
Also, when I use APKTool 1.3.1 to decompile and recompile immediately, the 2.7mb apk turned into 5.0mb... get bigger! That's weired...

Question about APN info from apns-conf.xml

I managed to get a system dump from a Samsung Acclaim which is the only Android phone available for my service provider (US Cellular/USCC.)
I found the apns-conf.xml file but I'm not sure what info I need from it to get added to the APNs available for XDAndroid. (I've attached the file.)
Also, wouldn't there be a way to just add this to my system.ext2?
heavymetalmage said:
I managed to get a system dump from a Samsung Acclaim which is the only Android phone available for my service provider (US Cellular/USCC.)
I found the apns-conf.xml file but I'm not sure what info I need from it to get added to the APNs available for XDAndroid. (I've attached the file.)
Also, wouldn't there be a way to just add this to my system.ext2?
Click to expand...
Click to collapse
the apn list provided is sooooooooooo small. Probably because the phone is only available in the US. Not worth looking at but if you wanted to add it to your system.ext2
then
Code:
mkdir mountfolder
sudo mount -o loop system.ext2 mountfolder
Add the apns-conf.xml to /system/etc
then
Code:
sudo umount mountfolder
babijoee said:
the apn list provided is sooooooooooo small. Probably because the phone is only available in the US. Not worth looking at but if you wanted to add it to your system.ext2
then
Code:
mkdir mountfolder
sudo mount -o loop system.ext2 mountfolder
Add the apns-conf.xml to /system/etc
then
Code:
sudo umount mountfolder
Click to expand...
Click to collapse
Well I went through it all but it didn't allow me to use USCC as my apn. Thanks for your help though Babijoee!
heavymetalmage said:
Well I went through it all but it didn't allow me to use USCC as my apn. Thanks for your help though Babijoee!
Click to expand...
Click to collapse
Well if the APN was provided within the apns-conf.xml it should auto-detect. Otherwise you can input it manually
babijoee said:
Well if the APN was provided within the apns-conf.xml it should auto-detect. Otherwise you can input it manually
Click to expand...
Click to collapse
Actually this is not correct the RUU_Bravo_hTC_Asia_WWE_1.19.707.7_Radio_32.36.00.28U_4.06.00.02_2_release_126179_signed rom has an apns-conf.xml that looks like this ..
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- This file contains fake APNs that are necessary for the emulator
to talk to the network. It should only be installed for SDK builds.
This file is not installed by the local Android.mk, it's installed using
a PRODUCT_COPY_FILES line in the sdk section of the toplevel Makefile.
-->
<!-- use empty string to specify no proxy or port -->
<!-- This version must agree with that in apps/common/res/apns.xml -->
<apns version="6">
<apn carrier="Android"
mcc="310"
mnc="995"
apn="internet"
user="*"
server="*"
password="*"
mmsc="null"
/>
<!--apn carrier="TelKila"
mcc="310"
mnc="260"
apn="internet"
user="*"
server="*"
password="*"
mmsc="null"
/-->
</apns>
And as you can see there's SFA in there that is useful however this rom has no problem configuring the APNS for all of the Asia networks... I have yet to figure out where the configuration is hiding or if it is actually downloaded from the internet using a generic Internet apn named "internet" ..
AsiaWWE-apns.xml
I finally found it .. it seems that the framework-res.apk contains an apns.xml with all the details in it. It would appear that the old /system/etc/apns-conf.xml is depreciated in favour of res/xml/apns.xml in the framework-res.apk file ..
I have attached the Asian WWE apns.xml definition file for everyone in this region ..
nice find will look into it when time lets me
babijoee said:
Well if the APN was provided within the apns-conf.xml it should auto-detect. Otherwise you can input it manually
Click to expand...
Click to collapse
I tried it once again with no luck. I think the issue must have to do with the network being CDMA.
heavymetalmage said:
I tried it once again with no luck. I think the issue must have to do with the network being CDMA.
Click to expand...
Click to collapse
I'll have to have a look at what sidewindr suggested. It could be the root of the problem.
so in my endless quest to play with apn settings, i tried to replace the apn.xml file in the framework-res.apk and when i loaded the new apk, it kept crashing my phone.apk. once i put the original back, it loaded everything up again no problems.
babijoee, do we have an easy way to edit the apns to our liking yet? for testing or whatever...

[HOW TO] Add more wallpapers to TwWallpaperChooser

Although there are 26 wallpapers in TwWallpaperChooser.apk, only 5 are selectable. To add the missing wallpapers (or more) to the TwWallpaperChooser app, do the following:
1) Decompile TwWallpaperChooser.apk (apktool d TwWallpaperChooser.apk)
2) Make sure there are no errors, if so grab another copy of TwWallpaperChooser.apk
3) Edit the file res/values-hdpi/arrays.xml
4) Add wallpapers as new items (images should be in res/drawable-hdpi).
eg.
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="wallpapers">
<item>wallpaper_bliss</item>
<item>wallpaper_brown</item>
<item>wallpaper_cafe</item>
<item>wallpaper_canyon</item>
<item>wallpaper_cat2</item>
<item>wallpaper_circle</item>
<item>wallpaper_desert</item>
<item>wallpaper_field</item>
<item>wallpaper_flower</item>
<item>wallpaper_glass</item>
<item>wallpaper_grass</item>
<item>wallpaper_grass_new</item>
<item>wallpaper_light</item>
<item>wallpaper_motion</item>
<item>wallpaper_nexuswallpaper1</item>
<item>wallpaper_phasebeam</item>
<item>wallpaper_rock</item>
<item>wallpaper_secdesert</item>
<item>wallpaper_speedlight</item>
<item>wallpaper_secdesert</item>
<item>wallpaper_stars</item>
<item>wallpaper_street</item>
<item>wallpaper_street_lights</item>
<item>wallpaper_tree</item>
<item>wallpaper_venezia</item>
<item>wallpaper_zanzibar</item>
</string-array>
</resources>
5) Recompile TwWallpaperChooser.apk (apktool b TwWallpaperChooser TwWallpaperChooserNew.apk)
6) Extract new resources.arsc file from TwWallpaperChooserNew.apk (unzip TwWallpaperChooserNew.apk resources.arsc)
7) Rename TwWallpaperChooser.apk to TwWallpaperChooser.zip
8) Add new resources.arsc file to TwWallpaperChooser.zip (zip TwWallpaperChooser.zip resources.arsc)
9) Rename TwWallpaperChooser.zip to TwWallpaperChooser.apk
10) Put TwWallpaperChooser.apk back on phone.
works like charm! simple and easy instructions!!!
can i use this method to add in new wallpapers?
I have managed to extract the TwWallpaperChooser.apk using Android Commander. I have followed steps 1 and 2 but the directory in step 3 doesn't exist on my phone. Can someone help?
Transform said:
I have managed to extract the TwWallpaperChooser.apk using Android Commander. I have followed steps 1 and 2 but the directory in step 3 doesn't exist on my phone. Can someone help?
Click to expand...
Click to collapse
You can see the directory only after decompiling the apk. It is inside resources.arsc in the normal apk.
Sent from my GT-I9100 using Tapatalk 2
Ok so I got as far as step 8 in this guide:
HTML:
http://forum.xda-developers.com/showthread.php?t=1188389
where I moved the TwWallpaperChooser.apk from my device to the 'place-apk-here-for-modding' folder.
I then completed step 1 of the guide in this thread but I'm not sure where to go next...

[Tutorial] Decompile/Recompile APKs

Complete guide on how to Decompile/Recompile Apks with APKTOOL
This Tutorial is for Windows Only
Apktool and all .bat files outlined in this tutorial have been uploaded here for your convenience
Requirements
- 7zip / Winrar (or similar)
- Apktool - (Package link above)
Notes
- I use .bat file to make the whole process alot quicker ...
- Copying Apktool files (aapt.exe, apktool.bat, apktool.jar, baksmali.jar, zipalign.exe) into C:/windows will allow you to use the .bat files anywhere on your computer without the need for apktool in the same directory
Step 1 - First you need to install the framework files so the apktool can use them to decompile other apks in the rom that depend on the framework
- Make a text document and rename it "Install Framework.bat"
- Edit it with a txt editor and paste in this code
Code:
CMD /K apktool if framework-res.apk
- with your framework-res.apk in the folder run the Install Framework.bat file and it should output
Code:
Framework installed to: C:\Users\USER\apktool\framework\1.apk
Step 2 - Decompiling (we will be decompiling framework-res.apk in this tutorial)
- First make a copy of the apk you wish to decompile and name it backup.apk (this will be used later)
- Make a text document and rename it "Decompile.bat"
- Edit it with a txt editor and paste in this code (replace the "framework-res.apk" with the name of the apk you wish to decompile)
Code:
CMD /K apktool d framework-res.apk
- with your apk in the same folder run the Decompile.bat file and it create a folder that you can edit as you see fit
Step 3 - Recompiling (we will be Recompiling framework-res.apk in this tutorial)
- Make a text document and rename it "Compile.bat"
- Edit it with a txt editor and paste in this code (replace the "framework-res.apk" with the name of the apk you wish to recompile)
Code:
del almostdone.apk
CMD /K apktool b framework-res almostdone.apk
- Run the Compile.bat file and it create an apk called almostdone.apk (if you get errors you most likely made a change which broke the apk)
- Open both almostdone.apk and backup with 7zip or Winrar
- Drag all the contents of almostdone.apk except for AndroidManifest.xml into backup.apk and replace existing files
- Now make a text document and rename it "Zipalign.bat"
- Edit it with a txt editor and paste in this code (replace the "framework-res.apk" with the name of the apk you wish to recompile)
Code:
del framework-res.apk
zipalign.exe -v 4 backup.apk framework-res.apk
- Run the Zipalign.bat file and it create the finished apk
Nice one :good:, but i think very few takers in our forum. I was also thinking about posting on ROM Porting, but there are many guides already out there .
yeah ... seems so.... iv'e tryed porting myself ... never got it booting ...

[HOW TO] MOD Files with APKTool

APKTool.zip (with Signed Files & Tools) has these files inside...
_____________________________________________________
! SGS3 (TMobile) Signed Files - framework-res (4.1.1)
! SGS3 (TMobile) Signed Files - SystemUI (4.1.1)
! Instructions + Info.txt
! Tool - 7-Zip v9.20 installer.exe
! Tool - Notepad++ 6.2.3 installer.exe
aapt.exe (from Android SDK Files {adt-bundle-windows-x86\sdk\platform-tools}) Android SDK
apktool.jar (APKTool v1.5.1 - Newest Release 12-28-2012) APKTool
*** Works on Windows x86 32 bit (NOT Tested on 64 bit)
Must have installed on Windows
__________________________
Java {I use Java Runtime Environment 1.7.0.10} Java 32bit
Notepad++ {Editing tool}
7-Zip (or WinRAR)
! Instructions + Info on Post #2
Download : APKTool.zip
Other Similar Helpful Links (that relate)...
Link #1- [How To] Use and install APKtool (v6ser)
Link #2- [How To} Setup use APKtool (RMarkwald)
Update: I check on this thread only once a week to answer questions. So be patient.
! Instructions + Info
NOTES
__________________________________________________________________
*** to "ADD Back SIGNED Files", open up newly created .apk with 7-Zip (or WinRAR) and add in (META-INF folder + AndroidManifest.xml)
.apk NEED'S to be SIGNED, .jar DOESN'T
Doesn't matter which set is used, as long as they are a MATCHING SET. (META-INF folder + AndroidManifest.xml)
APKTOOL LINES Explained
__________________________________________________________________
LINE apktool if framework-res.apk (Creates this file... C:\Documents and Settings\{your username}\apktool\framework\1.apk)
-that created "1.apk" file has "resources.arsc" inside.
-It's only Needed to run 1st time to register file with APKTool
LINE apktool d {file name} (De-Compiles to {file named folder -".apk" or +".out"})
LINE apktool b {folder name} (Compiles to {folder name}\dist)
Instructions : How to Use Apktool
__________________________________________________________________
1. Extract the "APKTool.zip" file to C:\ so that it looks this C:\APKTool
2. Extract "framework-res.apk" from your ROM's "system\framework" folder & put file into C:\APKTool
3. Copy any file(s) to edit to your C:\APKTool folder {xxx.apk, xxx.jar}
4. In Windows, get to your CMD box (in WinXP - Start Menu - Run - CMD)
CD:\apktool
apktool if framework-res.apk
{Example #1 - Editing framework-res.apk}
________________________________________
apktool d framework-res.apk
...{edit file(s) with Notepad++}
apktool b framework-res
...{add back SIGNED Files}
{Example #2 - Editing SystemUI.apk}
___________________________________
apktool d systemui.apk
...{edit file(s) with Notepad++}
apktool b systemui
...{add back SIGNED Files}
{Example #3 - Editing android.policy.jar}
_________________________________________
apktool d android.policy.jar
...{edit file(s) with Notepad++}
apktool b android.policy.jar.out
{Example #4 - Editing services.jar}
___________________________________
apktool d services.jar
...{edit file(s) with Notepad++}
apktool b services.jar.out
5. Finished !
I created this thread, as to not clutter up a ROM that I posted. Now I can help others who use it here!
ktmdave7 said:
APKTool.zip (with Signed Files & Tools) has these files inside...
_____________________________________________________
! SGS3 (TMobile) Signed Files - framework-res (4.1.1)
! SGS3 (TMobile) Signed Files - SystemUI (4.1.1)
! Instructions + Info.txt
! Tool - 7-Zip v9.20 installer.exe
! Tool - Notepad++ 6.2.3 installer.exe
aapt.exe (from Android SDK Files {adt-bundle-windows-x86\sdk\platform-tools}) Android SDK
apktool.jar (APKTool v1.5.1 - Newest Release 12-28-2012) APKTool
*** Works on Windows x86 32 bit (NOT Tested on 64 bit)
Must have installed on Windows
__________________________
Java {I use Java Runtime Environment 1.7.0.10} Java 32bit
Notepad++ {Editing tool}
7-Zip (or WinRAR)
! Instructions + Info on Post #2
Download : APKTool.zip
Other Similar Helpful Links (that relate)...
Link #1- [How To] Use and install APKtool (v6ser)
Link #2- [How To} Setup use APKtool (RMarkwald)
Click to expand...
Click to collapse
Thanks for this. Maybe people will stop demanding so much and start to experiment and learn themselves....
Thanks, I've been having trouble using apkmanager and needed to get a good setup with apktools for editing framework. I'll give this a go and a very special thanks for the instructions!
Noellenchris
Ok, for me I have to type apktool.jar d framework-res.apk and then I edited \values\arrays.xml and when I type apktool.jar b framework-res it created a build/apk folder but it is empty... Any ideas? I was trying jovy's tethering mod. I also ran aptool.jar if framework-res.apk first and verified the user folder was created with a file called 1.apk. Probably a noob question and I apologize in advance.
I have also previously reinstalled JRE for both normal and x64 versions plus ensured they are added to my path environment. I also added a JAVA_HOME entry and added the path in the values to my JRE path. Hmmm....that's about it I guess for now.
Thanks
dude thanks so much.
i needed someone to hold my hand through this. ill try it once im off work.
when I use this tool on (Windows XP 32bit), I get "Build" folder, when it tries to Compile (and it can be empty, if it tried to compile and got interrupted, or possibly a error)
I usually delete these 2 folders (build + dist)... (if they are there) right before a Re-compile.
\build = project folder of Re-compiling.
\dist = project Newly created .apk (or .jar) file goes.
Working with APKTool is easy... but you learn the most by using a lot and testing it yourself. I try many different methods and recheck the file if did 1 way, then I try another way and see if any thing is changed by another method (lots of comparing and confidence builds this way) Something that is tuff to explain in Text and in Instructions, but eventually, you have confidence in file comparisons and makes sense then.
*** Sometimes I see different Text words, that seam like could be error (but to me Error text, is when the CMD box filles with much extra TEXT and you can tell it messed up... NOT just 1 text line of code)
noellenchris said:
Ok, for me I have to type apktool.jar d framework-res.apk and then I edited \values\arrays.xml and when I type apktool.jar b framework-res it created a build/apk folder but it is empty... Any ideas? I was trying jovy's tethering mod. I also ran aptool.jar if framework-res.apk first and verified the user folder was created with a file called 1.apk. Probably a noob question and I apologize in advance.
I have also previously reinstalled JRE for both normal and x64 versions plus ensured they are added to my path environment. I also added a JAVA_HOME entry and added the path in the values to my JRE path. Hmmm....that's about it I guess for now.
Thanks
Click to expand...
Click to collapse
Found my issue, my edit on the arrays.xml was bad, I kept forgetting to add a /> at the end of the edit. duh. Glad it didn't compile and I ended up with some crazy errors on my phone... Lesson learned.
Noellenchris
I cant delete files from folder-apktool after decompile, compile, give permission but dont cant delete.I on win 8.How delete
very useful. Thanks!

Categories

Resources