3

I want to know where exactly are stored the APNs that are added by the user on Android. I want to edit them manually using X-plore (or any other root file explorer).

I know that in /system/etc/apns-conf.xml are stored the APN that come preset with the device, but I'm looking for the XML file where the user added APN are stored instead.

2
  • 1
    For anyone else arriving here to find out how Android automatically picks up APNs, the APN preset configurations are now found in /etc/apns-conf.xml, and are linked to a SIM that is inserted by the mmc and mnc.
    – Bilko
    Apr 16, 2019 at 23:58
  • @Bilko /etc is a symlink to /system/etc. Both files are same. Oct 25, 2019 at 15:19

2 Answers 2

2

I think it depends on your ROM .I recently checked mine and are in the following folder:

/data/data/com.android.providers.telephony/databases/.(telephony.db). You can try opening this .db file as text with a suitable file explorer and see if you can find them. (These are apns in the ROM by default)

Edit

I created a test apn manually and did a search, I learnt that its actually stored here: /data/data/com.android.settings/shared_prefs/com.android.settings_preferences.x­ml

(This xml also contains a lot of information found in settings but if you use a keyword search to try and find your manual apn, it will be much faster)

Some of the carrier apns happen to be auomatically added when you insert a new sim card, corresponding to the country, that is why they are stored in telephony database,I reckon. I hardly enter these apns manually even when I change a SIM card.

2
  • 1
    +1 On Android 9 manually added APNs are only added to telephony.db, com.android.settings_preferences.x­ml doesn't exist. Oct 25, 2019 at 15:21
  • I rooted my phone running android 10 with Magisk and used the app SQLite Editor to add dun to my APN and bypass my hotspot limit. In the app I found the APN at: /data/user_de/0/com.android.providers.telephony/databases/telephony.db/carriers Once there I just searched for my specific carrier and edited the type field by adding dun.
    – Jay Suave
    Apr 22, 2021 at 9:26
2

When looking at a Pixel 3a device running Android 10 the location is data/user_de/0/com.android.providers.telephony/databases/telephony.db user_de is the _d_evice _e_ncryption related user directory, use user instead if the phone does not support this

Not strictly related to the question about the user provided storage location, but this might be useful for people landing here after a search:

When looking in TelephonyProvider there are 4 different locations with increasing precedence:

  • Default APNs: /system/etc/apns-conf.xml
  • OEM APNs: /oem/telephony/apns-conf.xml
  • OTA Update APNs: /data/misc/apns/apns-conf.xml
  • Product APNs: /product/etc/apns-conf.xml

Note: In Android 10 the system partition cannot be mounted read-write. Use a Magisk module to change the APNs or update the APN under /data/misc/apns/apns-conf.xml. This path is writable after an su.

The APNs are finally stored in database /data/user_de/0/com.android.providers.telephony/databases/telephony.db. Like mentioned above be flexible here about the user_de part.

Also take note that an ApnSourceService method was introduced in Android 10(?). This is a vendor specific implementation to lookup APNs. This is a not documented service. If this service is active all the XMLs will be ignored. Use a Magisk module to turn off this service if needed.

2
  • /data/user_de is correct, it's the Device Encrypted storage on devices with FBE support. Many configurations have moved from /data/user (/data/data) to this encrypted path. Dec 10, 2019 at 21:04
  • 1
    Thanks. I have improved the answer here.
    – k_o_
    Dec 11, 2019 at 23:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .