Mac Address Getting Reset on Reboot - G4 Q&A, Help & Troubleshooting

I wiped /data/misc/ to get out of a recovery bootloop. Turns out that doing so breaks the wifi mac address in CM. I'm able to temporarily set my address in /data/wifi/misc/config:
Code:
echo "cur_etheraddr=XX:XX:XX:XX:XX:XX" > /data/misc/wifi/config
The problem is that when I reboot, that file goes back to 00:00:00:00:00:00.
Digging around CM kernel source showed me what files are important.
Code:
CONFIG_BCMDHD_FW_PATH="/system/etc/firmware/fw_bcmdhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/system/etc/wifi/bcmdhd.cal"
CONFIG_BCMDHD_CONFIG_PATH="/data/misc/wifi/config"
/system/etc/wifi/bcmdhd.cal is showing a good mac address.
I KDZ'ed back to stock and everything worked great there. As soon as I flashed CM14.1 again it didn't work. It isn't a problem with the build, since it was working until I wiped /data/misc/.
Does anyone know how to fix this? I'm curious what config says on a working device, so could someone tell me what it says for them? I want to know 1) if /data/misc/wifi/config exists and 2) if it shows a real mac address or a bunch of zeros. I can't get CM file manager to open the file, so here's how to do it in adb:
Code:
adb shell "su 0 cat '/data/misc/wifi/config'"
What files are in /data/misc/wifi?
I'm not really looking for a workaround, since I could add that first script to a startup script or something. I want a permanent fix that won't go away next time I flash a rom.
Sorry for the long post. Any help would be appreciated. I've spend hours on this already.

Hi!
I also use your workaround now and i automated it, so thanks for ending my pain for the moment, but i would also like to see a permanent fix for this. I tried every available stock rom and all available methods to aply it to bring back what cm seams to be depending on for setting the mac - but no success. To me this looks like a bug - not a very common one, but still a bug because the stock roms do not have any problem at all, only cm does.
br, Martin

theprogramguy said:
Does anyone know how to fix this? I'm curious what config says on a working device, so could someone tell me what it says for them? I want to know 1) if /data/misc/wifi/config exists and 2) if it shows a real mac address or a bunch of zeros.
.
Click to expand...
Click to collapse
I am on RR ROM which is CM based
What I can say is yes this file exists and yes it contains my real MAC address
theprogramguy said:
What files are in /data/misc/wifi?
.
Click to expand...
Click to collapse
[email protected]:/ # ls -la /data/misc/wifi
total 152
drwxrwx--- 4 wifi wifi 4096 2016-12-14 08:12 .
drwxrwx--t 32 system misc 4096 2016-12-04 19:44 ..
-rw-r--r-- 1 system wifi 32 2015-01-02 02:58 config
-rw-rw---- 1 system wifi 21 2015-01-22 07:44 entropy.bin
-rw-rw---- 1 system wifi 252 2016-11-17 15:05 hostapd.conf
-rw------- 1 system system 868 2016-11-14 08:33 ipconfig.txt
-rw------- 1 system system 29695 2016-12-13 11:04 networkHistory.txt
-rw-rw---- 1 wifi wifi 219 2015-01-22 07:44 p2p_supplicant.conf
drwxrwx--- 2 wifi wifi 4096 2015-01-22 07:44 sockets
-rw------- 1 system system 41 2016-11-17 14:54 softap.conf
drwxrwx--- 2 wifi wifi 4096 2015-01-02 02:58 wpa_supplicant
-rw-rw---- 1 wifi wifi 1647 2016-12-14 08:12 wpa_supplicant.conf
[email protected]:/ #
My first thought was that the mac address is generated from the misc partition but as far as I can see it seems to be not. At least I can't find a string matching my current mac.
interesting is that I searched the misc partition (I love Linux and the tool strings) and found my imei written in there..
Well as you wrote you haven't the problem on stock:
Do you cleaned out the WiFi config file before when testing stock? Afaik it should be cleaned out automatically though but just to be sure.. What happens when you delete that file on stock and reboot? Will it get regenerated?
You identified it that the ROM sources are the reason good. But I don't think you should look at the kernel sources only. Check the CM sources as well I believe here you will get better findings.
.

steadfasterX said:
[email protected]:/ # ls -la /data/misc/wifi
total 152
drwxrwx--- 4 wifi wifi 4096 2016-12-14 08:12 .
drwxrwx--t 32 system misc 4096 2016-12-04 19:44 ..
-rw-r--r-- 1 system wifi 32 2015-01-02 02:58 config
-rw-rw---- 1 system wifi 21 2015-01-22 07:44 entropy.bin
-rw-rw---- 1 system wifi 252 2016-11-17 15:05 hostapd.conf
-rw------- 1 system system 868 2016-11-14 08:33 ipconfig.txt
-rw------- 1 system system 29695 2016-12-13 11:04 networkHistory.txt
-rw-rw---- 1 wifi wifi 219 2015-01-22 07:44 p2p_supplicant.conf
drwxrwx--- 2 wifi wifi 4096 2015-01-22 07:44 sockets
-rw------- 1 system system 41 2016-11-17 14:54 softap.conf
drwxrwx--- 2 wifi wifi 4096 2015-01-02 02:58 wpa_supplicant
-rw-rw---- 1 wifi wifi 1647 2016-12-14 08:12 wpa_supplicant.conf
[email protected]:/ #
Click to expand...
Click to collapse
Here's mine. It seems practically the same just missing hostapd.conf. I think I've seen it here before though.
h811:/ # ls -la /data/misc/wifi
total 44
drwxrwx--- 4 wifi wifi 4096 2016-12-14 17:07 .
drwxrwx--t 39 system misc 4096 2014-12-31 19:21 ..
-rw-r--r-- 1 system wifi 32 2016-12-12 18:32 config
-rw-rw---- 1 system wifi 21 2016-12-13 03:15 entropy.bin
-rw------- 1 system system 166 2016-12-13 03:25 ipconfig.txt
-rw------- 1 system system 3814 2016-12-14 17:07 networkHistory.txt
-rw-rw---- 1 wifi wifi 237 2014-12-31 19:26 p2p_supplicant.conf
drwxrwx--- 2 wifi wifi 4096 2016-12-13 03:15 sockets
-rw------- 1 system system 49 2014-12-31 19:25 softap.conf
drwxrwx--- 2 wifi wifi 4096 2014-12-31 19:21 wpa_supplicant
-rw-rw---- 1 wifi wifi 949 2016-12-14 17:07 wpa_supplicant.conf
steadfasterX said:
My first thought was that the mac address is generated from the misc partition but as far as I can see it seems to be not. At least I can't find a string matching my current mac.
Click to expand...
Click to collapse
Maybe it matches the mac in /system/etc/wifi/bcmdhd.cal (macaddr=)? I found that I had a slightly different one there.
steadfasterX said:
You identified it that the ROM sources are the reason good. But I don't think you should look at the kernel sources only. Check the CM sources as well I believe here you will get better findings.
Click to expand...
Click to collapse
https://github.com/CyanogenMod/android_device_lge_g4-common/blob/cm-14.1/hwaddrs/getmac.c
I found this earlier and it shows CM mounting misc and doing something with /data/misc/wifi/config. I thought it was reading config, but it looks like it's actually writing it there after reading it from somewhere else in misc. That would explain why it gets reset. Do you understand where it's reading from? I'm having a hard time reading C.
Specifically this part:
Code:
int fd1, fd2;
char macbyte;
char macbuf[3];
int i;
fd1 = open("/dev/block/bootdevice/by-name/misc",O_RDONLY);
fd2 = open("/data/misc/wifi/config",O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
write(fd2,"cur_etheraddr=",14);
for (i = 0; i<6; i++) {
lseek(fd1,0x3000+i,SEEK_SET);
lseek(fd2,0,SEEK_END);
read(fd1,&macbyte,1);
sprintf(macbuf,"%02x",macbyte);
write(fd2,&macbuf,2);
if (i!=5) write(fd2,":",1);
}
It looks like our bluetooth mac is getting set in the same way later on.
I'm thinking about setting up a CM build environment again and playing with my own builds to try to see what's up.
steadfasterX said:
interesting is that I searched the misc partition (I love Linux and the tool strings) and found my imei written in there..
Click to expand...
Click to collapse
Nice. I just looked at what CM is reporting my IMEI as, to see if it got reset, but it looks good. I know that cell data is still working, so I'd expect my IMEI to be right.
steadfasterX said:
Well as you wrote you haven't the problem on stock:
Do you cleaned out the WiFi config file before when testing stock? Afaik it should be cleaned out automatically though but just to be sure.. What happens when you delete that file on stock and reboot? Will it get regenerated?
Click to expand...
Click to collapse
I didn't try that. I was in a hurry to get back to CM so I could set it up for daily use. I'll try doing stuff like that soon if we don't figure have anything else to go on. It's getting too late to do it here tonight.
Yesterday I tried to extract misc.img from the kdz but none of the tools I found were able to successfully do it. Something was corrupt. My plan was to look at it or flash it in fastboot and see if anything changes.

GOT IT!
It's actually pretty simple, but I've never done anything quite like this before.
Overview:
Make an img of misc
Edit it in a hex editor
Overwrite misc with the img
Reboot
You could do this entirely on your phone, but I'll walk you through doing it using adb on your computer.
1. Make an img of misc and pull it to your computer.
Code:
adb shell "su -c 'dd if=/dev/block/bootdevice/by-name/misc of=/sdcard/misc.img'"
adb pull /sdcard/misc.img
2. Edit misc.img in a hex editor (I used HexEdit on Windows)
Find the hex offset 3000. Now edit 3000-3005 with your wifi mac address. For example "00 90 3D F1 A2 31".
The bluetooth mac address appears to be stored at 4000, so you could set it there if you wanted/needed to.
3. Write the img
Code:
adb push misc.img /sdcard/misc_edited.img
adb shell "su -c 'dd if=/sdcard/misc_edited.img of=/dev/block/bootdevice/by-name/misc'"
4. Reboot
Code:
adb reboot
If it all works, it's okay to delete the img files we left in /sdcard
Code:
adb shell "rm /sdcard/misc*.img"

Makes totally sense! Just for your information the file in
/system/etc/wifi/bcmdhd.cal
contains a mac address but it is not the same as in the Wi-Fi config file
Thanks for sharing this walkthrough it will help others having the same issue

Thank you!!
You are a MF genius!!! I have the same problem but with an LG G3 Beat, and I wanted to know if this works the same with my device. Thank you bro!

Related

[Q] yaffs2 corruption (directory hardlinks pointing to parent)

Hi!
I am experiencing yaffs2 filesystem corruption on the data partition of my Desire.
The errors are always quite similar: Directory entries with empty names that point to the parent directory:
Code:
# ls -lia /data/data/com.android.providers.contacts/lib/databases
total 6
2006 drwxr-xr-x 1 10006 10006 2048 Apr 8 22:30
2006 drwxr-xr-x 1 10006 10006 2048 Apr 8 22:30 .
1737 drwxr-xr-x 1 1000 1000 2048 Apr 9 07:49 ..
It looks very similar to this report.
I've already tried several ROMs (most recently AceSMod007 and RevolutioN v3.0) but both use kernel 2.6.35.14-gingercakes-0.9-avs that maybe doesn't contain the fix.
Can anyone recommend a kernel that includes this patch?

Request for Bootloader image

Update: We have images, all images obtained for the partitions are uploaded here:
http://jellybean.dccontests.com/optimusg/
Partion 27 is recovery, and bootloader is partition 5.
I see from the AT&T thread that many people are getting their phones this weekend. If someone who gets the phone can send me an image of the bootloader I'd like to start getting a look at it.
If you need directions on how to do this, let me know. Currently I'm trying to figure out what the block devices are on the phone. If anyone knows this let me know, so I can direct someone (dbgeek) to get a dd of it.
Shelnutt2 said:
I see from the AT&T thread that many people are getting their phones this weekend. If someone who gets the phone can send me an image of the bootloader I'd like to start getting a look at it.
Click to expand...
Click to collapse
Bought mine 15 min ago at the AT&T store. How do I take an image?
dbgeek said:
Bought mine 15 min ago at the AT&T store. How do I take an image?
Click to expand...
Click to collapse
Nice.....have to wait...
Thank you for looking at this...hopefully it will be unlocked soon
Sent from my SGH-I897 using xda premium
I can walk you through it, but how much experience do you have with Linux/adb?
Sent from my cm_tenderloin using xda app-developers app
Shelnutt2 said:
I can walk you through it, but how much experience do you have with Linux/adb?
Sent from my cm_tenderloin using xda app-developers app
Click to expand...
Click to collapse
Sorry, but zero sums it up pretty well. I'm capable of navigating via DOS or UNIX commands if that helps in any way.
dbgeek said:
Sorry, but zero sums it up pretty well. I'm capable of navigating via DOS or UNIX commands if that helps in any way.
Click to expand...
Click to collapse
Go ahead and install the android sdk and adb, http://wiki.cyanogenmod.com/wiki/Howto:_Install_the_Android_SDK#Windows . Then root your phone, and install busybox.
Plug your phone into the computer, run adb devices in a command prompt. It should show your phone. Then run
Code:
adb shell
su
ls /dev
df
And post the output of the last two commands. I need to know a bit more about the phone so I can give you detailed steps and that will give me the info I need.
Sorry if anything is confusing, just let me know, I'm at work typing this
Does the ATT E970 have root? Answer my own question...Yes - method seems to work from Korean thread.
Code:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>adb devices
List of devices attached
LG-E970-604d4e7f device
C:\>adb shell
[email protected]:/ $ su
su
ls /dev
ls /dev
d1|[email protected]:/ $ ls /dev
alarm
android_adb
android_mbim
apr_apps2
ashmem
binder
block
bus
ccid_bulk
ccid_ctrl
console
cpu_dma_latency
cpuctl
device-mapper
diag
dsp_debug
full
fuse
gemini0
genlock
graphics
hsicctl0
hsicctl1
hsicctl2
hsicctl3
hw_random
i2c-0
i2c-3
i2c-4
input
ion
keychord
kgsl-3d0
kmem
kmsg
lge_dm_tty0
log
mdm
media0
media1
media2
mem
msm_aac
msm_aac_in
msm_acdb
msm_amrnb
msm_amrnb_in
msm_amrwb
msm_amrwb_in
msm_camera
msm_dsps
msm_evrc
msm_evrc_in
msm_idle_stats0
msm_idle_stats1
msm_idle_stats2
msm_idle_stats3
msm_mp3
msm_multi_aac
msm_qcelp
msm_qcelp_in
msm_rotator
msm_rtac
msm_sps
msm_vidc_dec
msm_vidc_dec_sec
msm_vidc_enc
msm_vidc_reg
msm_wma
msm_wmapro
mtp_usb
network_latency
network_throughput
nmea
null
pipes
pn544
ppp
psaux
ptmx
pts
qmi0
qmi1
qmi2
qseecom
ramdump_dsps
ramdump_lpass
ramdump_riva
ramdump_smem-dsps
random
rfkill
rmnet_mux_ctrl
rtc0
siI-8334
smd1
smd11
smd2
smd21
smd22
smd27
smd3
smd36
smd4
smd5
smd6
smd7
smd_cxm_qmi
smd_pkt_loopback
smd_sns_adsp
smd_sns_dsps
smdcntl0
smdcntl1
smdcntl2
smdcntl3
smdcntl4
smdcntl5
smdcntl6
smdcntl7
smdcntl8
smem_log
snd
socket
tgt
tpa_amp
tspdrv
tty
tty0
tty1
tty10
tty11
tty12
tty13
tty14
tty15
tty16
tty17
tty18
tty19
tty2
tty20
tty21
tty22
tty23
tty24
tty25
tty26
tty27
tty28
tty29
tty3
tty30
tty31
tty32
tty33
tty34
tty35
tty36
tty37
tty38
tty39
tty4
tty40
tty41
tty42
tty43
tty44
tty45
tty46
tty47
tty48
tty49
tty5
tty50
tty51
tty52
tty53
tty54
tty55
tty56
tty57
tty58
tty59
tty6
tty60
tty61
tty62
tty63
tty7
tty8
tty9
ttyGS0
ttyUSB0
tun
uinput
urandom
usbf
usb_accessory
usb_autorun
usf1
v4l-subdev0
v4l-subdev1
v4l-subdev2
v4l-subdev3
v4l-subdev4
v4l-subdev5
v4l-subdev6
v4l-subdev7
v4l-subdev8
vcs
vcs1
vcs63
vcsa
vcsa1
vcsa63
video0
video1
video100
video2
video3
video38
video39
wcnss_wlan
xt_qtaguid
zero
[email protected]:/ $ df
dfdf
/system/bin/sh: dfdf: not found
127|[email protected]:/ $ df
df
Filesystem Size Used Free Blksize
/dev 911.16M 64.00K 911.10M 4096
/mnt/asec 911.16M 0.00K 911.16M 4096
/mnt/obb 911.16M 0.00K 911.16M 4096
/system 1.46G 1.06G 411.00M 4096
/data 11.30G 1.64G 9.65G 4096
/persist 7.86M 4.09M 3.77M 4096
/cache 787.39M 13.39M 774.00M 4096
/persist-lg 7.86M 4.11M 3.75M 4096
/mpt 31.48M 4.04M 27.45M 4096
/factory 15.73M 4.04M 11.69M 4096
/sns 7.86M 4.05M 3.81M 4096
/tombstones 251.97M 4.15M 247.82M 4096
/firmware 63.95M 52.84M 11.11M 16384
/mnt/sdcard 11.30G 1.64G 9.65G 4096
/mnt/sdcard/external_sd 14.70G 128.00K 14.70G 32768
[email protected]:/ $
mbonus, thank you for the output, unfortunatly it doesn't show me what the storage memory block devices are. I'm looking for something along the lines of "mmcblk" or others, try the following as root (su) in adb and post the output:
Code:
cat /etc/vold.fstab
The thing here is I just have to figure out which block device/partition holds the bootloader, so you can dump it to the sdcard (or internal storage) and then send it my way. The vold.fstab file should contain what the block devices are. They might be in a subfolder of /dev .
Also when you are roor you should have a '#' instead of a '$' at the beginning of the line in the shell.
ok I'll give it another shot when I get home
Sent from my LG-E970 using xda app-developers app
Thanks for the preliminary work, guys. I really want LTE, so I can't do the new Nexus. The Optimus has mediocre software and the One X+ still apparently has mediocre battery life, so getting this thing opened up to new ROMs might tip me over to the "G".
I thought I had root, but I still get the $ in adb shell
Idk I like the lg rom so far it is very smooth just gonna root and delete some bloatware
Sent from my LG Optimus G
Glad to hear you like the ROM. I'm just going from reviews, so hopefully I'll also like it when I see it in person. I was really hoping the One X+ would be my next phone, but the battery life and heat generation may be a deal breaker.
Edit: Plus, I'm hoping we can open the G up and maybe use some of the development for the Nexus ... except with LTE!
Ilkinansr92 said:
Idk I like the lg rom so far it is very smooth just gonna root and delete some bloatware
Sent from my LG Optimus G
Click to expand...
Click to collapse
let us know how bloat removal goes and what method
mbonus said:
I thought I had root, but I still get the $ in adb shell
Click to expand...
Click to collapse
Well does the `cat /etc/vold.fstab` yielf anything? You *might* not need root access to read it. If it doesn't work, or says file not find, run
Code:
ls /etc/
I appreciate you being the guinipig here, just trying find some way to figure out what the block devices are, as I don't see them listed under /dev.
Ilkinansr92 said:
Idk I like the lg rom so far it is very smooth just gonna root and delete some bloatware
Sent from my LG Optimus G
Click to expand...
Click to collapse
mbonus said:
let us know how bloat removal goes and what method
Click to expand...
Click to collapse
^^this, and additionally what you decided to remove as well, if you don't mind, sir.
Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Mike>adb shell
[email protected]:/ $ su
su
[email protected]:/ # ls /dev
ls /dev
alarm
android_adb
android_mbim
apr_apps2
ashmem
binder
block
bus
ccid_bulk
ccid_ctrl
console
cpu_dma_latency
cpuctl
device-mapper
diag
dsp_debug
full
fuse
gemini0
genlock
graphics
hsicctl0
hsicctl1
hsicctl2
hsicctl3
hw_random
i2c-0
i2c-3
i2c-4
input
ion
keychord
kgsl-3d0
kmem
kmsg
lge_dm_tty0
log
mdm
media0
media1
media2
mem
msm_aac
msm_aac_in
msm_acdb
msm_amrnb
msm_amrnb_in
msm_amrwb
msm_amrwb_in
msm_camera
msm_dsps
msm_evrc
msm_evrc_in
msm_idle_stats0
msm_idle_stats1
msm_idle_stats2
msm_idle_stats3
msm_mp3
msm_multi_aac
msm_qcelp
msm_qcelp_in
msm_rotator
msm_rtac
msm_sps
msm_vidc_dec
msm_vidc_dec_sec
msm_vidc_enc
msm_vidc_reg
msm_wma
msm_wmapro
mtp_usb
network_latency
network_throughput
nmea
null
pipes
pn544
ppp
psaux
ptmx
pts
qmi0
qmi1
qmi2
qseecom
ramdump_dsps
ramdump_lpass
ramdump_riva
ramdump_smem-dsps
random
rfkill
rmnet_mux_ctrl
rtc0
siI-8334
smd1
smd11
smd2
smd21
smd22
smd27
smd3
smd36
smd4
smd5
smd6
smd7
smd_cxm_qmi
smd_pkt_loopback
smd_sns_adsp
smd_sns_dsps
smdcntl0
smdcntl1
smdcntl2
smdcntl3
smdcntl4
smdcntl5
smdcntl6
smdcntl7
smdcntl8
smem_log
snd
socket
tgt
tpa_amp
tspdrv
tty
tty0
tty1
tty10
tty11
tty12
tty13
tty14
tty15
tty16
tty17
tty18
tty19
tty2
tty20
tty21
tty22
tty23
tty24
tty25
tty26
tty27
tty28
tty29
tty3
tty30
tty31
tty32
tty33
tty34
tty35
tty36
tty37
tty38
tty39
tty4
tty40
tty41
tty42
tty43
tty44
tty45
tty46
tty47
tty48
tty49
tty5
tty50
tty51
tty52
tty53
tty54
tty55
tty56
tty57
tty58
tty59
tty6
tty60
tty61
tty62
tty63
tty7
tty8
tty9
ttyGS0
ttyUSB0
tun
uinput
urandom
usb
usb_accessory
usb_autorun
usf1
v4l-subdev0
v4l-subdev1
v4l-subdev2
v4l-subdev3
v4l-subdev4
v4l-subdev5
v4l-subdev6
v4l-subdev7
v4l-subdev8
vcs
vcs1
vcs63
vcsa
vcsa1
vcsa63
video0
video1
video100
video2
video3
video38
video39
wcnss_wlan
xt_qtaguid
zero
[email protected]:/ # df
df
Filesystem Size Used Free Blksize
/dev 911.16M 64.00K 911.10M 4096
/mnt/asec 911.16M 0.00K 911.16M 4096
/mnt/obb 911.16M 0.00K 911.16M 4096
/system 1.46G 1.06G 411.95M 4096
/data 11.30G 1.74G 9.55G 4096
/persist 7.86M 4.09M 3.77M 4096
/cache 787.39M 17.28M 770.11M 4096
/persist-lg 7.86M 4.11M 3.75M 4096
/mpt 31.48M 4.04M 27.45M 4096
/factory 15.73M 4.04M 11.69M 4096
/sns 7.86M 4.05M 3.81M 4096
/tombstones 251.97M 4.15M 247.82M 4096
/firmware 63.95M 52.84M 11.11M 16384
/mnt/sdcard 11.30G 1.74G 9.55G 4096
/mnt/sdcard/external_sd 14.70G 9.28M 14.69G 32768
[email protected]:/ # cat /etc/vold.fstab
cat /etc/vold.fstab
# Copyright (c) 2011, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Code Aurora Forum, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# LGE_CHANGE For MTP
dev_mount sdcard2 /mnt/sdcard/external_sd auto /devices/platform/msm_sdcc.3/mmc_
host
[email protected]:/ #[COLOR="Silver"]
[SIZE=1]---------- Post added at 08:14 PM ---------- Previous post was at 08:13 PM ----------[/SIZE]
[/COLOR]Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Mike>adb shell
[email protected]:/ $ su
su
[email protected]:/ # ls /etc/
ls /etc/
DxHDCP.cfg
NOTICE.html.gz
OperatorPolicy.xml
UserPolicy.xml
amazon-kindle.properties
apns-conf.xml
apns_kr_mpdn.xml
apns_lgu_mpdn.xml
audio_effects.conf
bluetooth
capability.xml
dbus.conf
dcm_settings.xml
dhcpcd
efs.txt
es310.bin
event-log-tags
factory_reset_magic
fallback_fonts.xml
featureset.xml
firmware
format_first.sh
fota
gps.conf
hosts
init.goldfish.sh
init.lge_dut.bt.sh
init.qcom.bt.sh
init.qcom.coex.sh
init.qcom.efs.sync.sh
init.qcom.fm.sh
init.qcom.ftm_module.sh
init.qcom.ftm_module_out.sh
init.qcom.mdm_links.sh
init.qcom.modem_links.sh
init.qcom.post_boot.sh
init.qcom.sdio.sh
init.qcom.thermald_conf.sh
init.qcom.wifi.sh
init.wlan-on-off.sh
last_kmsg_backup.sh
logger_events.sh
logger_kernel.sh
logger_main.sh
logger_packet.sh
logger_radio.sh
logger_system.sh
logging_android.sh
logging_android_apart.sh
logging_kernel.sh
logging_kernel_apart.sh
logging_prepare.sh
mQ128-v44se.dls
media_profiles.xml
mkshrc
mts_mask
nfcee_access.xml
null_page
omadm
permissions
ppp
qosmgr_rules.xml
readahead_list.txt
save_kernel_log.sh
security
settings.xml
snd_soc_msm
system_fonts.xml
telephony.xml
thermald.conf
updatecmds
usf_post_boot.sh
vold.fstab
wfdconfig.xml
wifi
wiperconfig.xml
[email protected]:/ #
---------- Post added at 08:17 PM ---------- Previous post was at 08:14 PM ----------
mbonus said:
I thought I had root, but I still get the $ in adb shell
Click to expand...
Click to collapse
i'm such a newb, I didn't notice the phone had a superuser dialog box open requesting approval.
Okay the vold.fstab gave me a bit more info that I needed. Post the output of 'ls /devices/platform/' please. Again I do apologise for all the commands but this is set up a bit different than my heroc or touchpad, so just having to work through things through you, I do appreciate it though!
Also you can use the
Code:
[/code ] tags to post things in code boxes.
Sent from my cm_tenderloin using xda app-developers app
Shelnutt2 said:
Okay the vold.fstab gave me a bit more info that I needed. Post the output of 'ls /devices/platform/' please. Again I do apologise for all the commands but this is set up a bit different than my heroc or touchpad, so just having to work through things through you, I do appreciate it though!
Also you can use the
Code:
[/code ] tags to post things in code boxes.
Sent from my cm_tenderloin using xda app-developers app[/QUOTE]
Hey Shelnutt, thanks for jumping on this so early. Really thinkin about making this my next device and getting the bootloader unlocked will seal the deal.
Based on what you've seen so far, do you think any progress can be made?
I'd be willing to get the device and be a guinea pig as well....
Click to expand...
Click to collapse

Where is stored the raw file for the User Dictionary of HTC Sense Input keyboard ?

Hello.
Where is stored the raw file for the User Dictionary of HTC Sense Input keyboard ? It's obviously not the classic /data/data/com.android.providers.userdictionary/databases/user_dict.db ... because I wiped the file, rebooted, and HTC SI still kept memories of some words. After using backup restaure tools like UDM, HTCSI also can't see new words.
Thanks.
State of art:
For every one: the classic user dictionary is in /data/data/com.android.providers.userdictionary/databases/user_dict.db as SQLite3 . It's very easy to extract:
echo "SELECT word FROM words;" | sqlite3 /data/local/tmp/user_dict.db | sort | uniq | sed ':a;N;$!ba;s/\n/\|/g' > /data/local/tmp/PersonalDictionary.htcudb
providing you have SQLite3 somewhere in your PATH.
The base HTC IME dictionary is here: /data/data/com.htc.sense.ime/app_db/dlm_export
The SD backup is not on emulated (I have asked for emulated SD from internal memory), but on real physical external SD:
/storage/ext_sd/.data/HTC_IME/PersonalDictionary
The method to find the two last files were:
- touch /data/local/tmp/plop
- make a change in the dic, or a backup
- find /storage/ext_sd/ -newer /data/local/tmp/plop
or
- find /data/data -newer /data/local/tmp/plop
You have to re-touch the plop each time.
Once /data/data/com.android.providers.userdictionary/databases/user_dict.db is exported into /data/local/tmp/PersonalDictionary.htcudb, two things are possible:
- copy the file into /storage/ext_sd/.data/HTC_IME/PersonalDictionary, and make a manual import from HTC Sense Input dictionary manager
- attach the file to an email, and open the attachement from HTC-Mail, what will restaure the attached backup.
I have found the following command to ask for restauring the backup:
Code:
am start -a android.intent.action.VIEW -d "content:" -t "application/ime-config" -n com.htc.sense.ime/.ui.RestoreUDB -f "0x00080001"
But I do not get the confirmation toast. Because I don't find where the cache file is stored by HTC-Mail, for IME. Since I run stuff from scripts, that command does not work as is; in my case, I have to run it in this context:
Code:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
adb connect 127.0.0.1
adb shell id
adb shell su -c id
adb shell su -c am start [...]
otherwise I get a nasty error about permission issues:
Starting: Intent { act=android.intent.action.VIEW dat=content: typ=application/ime-config flg=0x80001 cmp=com.htc.sense.ime/.ui.RestoreUDB }
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=content: typ=application/ime-config flg=0x10080001 cmp=com.htc.sense.ime/.ui.RestoreUDB } from null (pid=29007, uid=2000) requires com.htc.permission.APP_DEFAULT
Click to expand...
Click to collapse
Work for an other day:
- try to construct the am start call for backup restauration from SD (previous line was for email attachement) => give up
- find how to export and rebuild (via script) /data/data/com.htc.sense.ime/app_db/dlm_export
- find if this dictionary is gaining, or loosing any word => stats now on way: cron is recording daily the size of files
- remove dups from /data/data/com.android.providers.userdictionary/databases/user_dict.db (clean PROVIDER file)
- during export, I want to inject Contact details (first name, name, town name)
*** *** ***
The base problem I have is that HTC Sens keyboard is very good, for daily use, but randomly looses settings, and parts of the dics (some times words added the last days; some times 98% of it, only keeping 10 or 15 words).
I want to monitor the IME dic, and produce a system alert when this dic is found to have lost words, and after user confirmation, restaure the IME dic (with an older version of the file, or by rebuilding it).
Some other files may be interesting, in the same folder: mdb_contact_name seem to be a raw text version of com.android.providers.userdictionary/databases/user_dict.db . stm_dump is also very large. IME dictionary has a concept of alias (and auto-replace); but I don't know where this is stored. I also wonder where the word usage statistics are stored (for suggestions).
The big minus I found in this keyboard is that suggestions are always limited to 3 words on the first line (the one always available) (in portrait); Gingerbread and Hackers offer up to 12 words: as much as they can print on screen. Also, suggestions only include literal words: words with letters only; it never suggests words with numbers (unless I already typed one in currect word) or punctuation (statistics show that some words are very often followed by question mark, comma, or full stop).
Now that I am used to the height of HTC Sens keyboard, I make many typos with smaller boards; but smaller boards leave much more screen space for chat. Sens is very good for writing emails; but instant messaging like Skype and Yahoo use too much screen space, and smaller kbd would leave more chat history visible. But Sens has a better word prediction for intuitive chat ...
***
Recoding daily stats of files:
Code:
find /data/data/com.htc.sense.ime/app_db/dlm_export.history -mtime 0 | grep "e" || {
for i in dlm_export mdb_contact_name stm_dump
do
{ echo -n "$(date +%Y-%m-%d_%H-%M-%S) : " ; ls -l /data/data/com.htc.sense.ime/app_db/$i | awk '{print $4}' ; } >> /data/data/com.htc.sense.ime/app_db/${i}.history
done
This code will work even with non existing history. Then wait history is 1D old .... I have found that one history per file is easier to re-read than one for all. Injecting date this way date +%Y-%m-%d_%H-%M-%S ; echo -n " : " used to introduce an undesired NL..
Proof that stupid dictionary bugs:
Code:
-rw------- 1 root root 0 2016-01-24 23:40 dlm_export
-rw------- 1 root root 1274 2015-09-02 10:15 kdb_0c09.cfg
-rw------- 1 root root 1274 2016-01-24 02:29 kdb_0c0c.cfg
-rw------- 1 root root 1281 2014-10-08 14:56 kdb_0d03.cfg
-rw------- 1 root root 1250 2015-12-20 18:18 kdb_0d09.cfg
-rw------- 1 root root 1250 2016-01-24 23:48 kdb_0d0c.cfg
-rw------- 1 root root 28902 2016-01-25 17:01 mdb_contact_name
-rw------- 1 root root 20 2016-01-25 17:01 sc_mdb_contact_name
-rw------- 1 root root 0 2016-01-24 23:40 stm_dump
-rw------- 1 root root 0 2016-01-25 17:01 tc_mdb_contact_name
-rw------- 1 root root 83251 2016-01-29 20:01 dlm_export
-rw------- 1 root root 1274 2015-09-02 10:15 kdb_0c09.cfg
-rw------- 1 root root 1274 2016-01-29 07:30 kdb_0c0c.cfg
-rw------- 1 root root 1281 2014-10-08 14:56 kdb_0d03.cfg
-rw------- 1 root root 1250 2015-12-20 18:18 kdb_0d09.cfg
-rw------- 1 root root 1250 2016-01-29 19:48 kdb_0d0c.cfg
-rw------- 1 root root 28954 2016-01-29 20:57 mdb_contact_name
-rw------- 1 root root 20 2016-01-29 20:57 sc_mdb_contact_name
-rw------- 1 root root 225751 2016-01-29 09:57 stm_dump
-rw------- 1 root root 0 2016-01-29 20:57 tc_mdb_contact_name
-rw------- u0_a39 u0_a39 145060 2016-02-04 23:44 dlm_export
-rw------- root root 29 2016-02-05 01:01 dlm_export.history
-rw------- u0_a39 u0_a39 1274 2015-09-02 10:15 kdb_0c09.cfg
-rw------- u0_a39 u0_a39 1274 2016-02-04 21:20 kdb_0c0c.cfg
-rw------- u0_a39 u0_a39 1281 2014-10-08 14:56 kdb_0d03.cfg
-rw------- u0_a39 u0_a39 1250 2015-12-20 18:18 kdb_0d09.cfg
-rw------- u0_a39 u0_a39 1250 2016-02-05 00:32 kdb_0d0c.cfg
-rw------- u0_a39 u0_a39 29036 2016-02-05 00:32 mdb_contact_name
-rw------- root root 57 2016-02-05 01:01 mdb_contact_name.history
-rw------- u0_a39 u0_a39 20 2016-02-05 00:32 sc_mdb_contact_name
-rw------- u0_a39 u0_a39 225751 2016-02-04 16:07 stm_dump
-rw------- root root 59 2016-02-05 01:01 stm_dump.history
-rw------- u0_a39 u0_a39 0 2016-02-05 00:32 tc_mdb_contact_name
Clearly: dlm_export and stm_dump were empty 2 weeks ago. Due to the nature of cheap backup, I was wondering if by huge hasard, those files were empty due to rsync glitches (if wifi is lost during file transfert, and glitch occurs while working on THIS file ... one chance in a trillion): such a glitch may produce an empty file; one, and ONE ONLY. Not two: rsync can't have corrupted dlm_export AND stm_dump at the same time. Thus, they are both empty due to a HTC Sens bug. The one that often makes the IME forget about second lang, and no vibrator.
Nobody knows if the loss of content of dlm_export could be related to HTC Sense keyboard issues ?

init.d on 5X

I was wondering where init.d might be located on 5X? Not able to find it in /system/etc/ like most devices.
Basically trying to include a new init.d script but not sure where to put it.
Thanks in advance!
catharsis724 said:
I was wondering where init.d might be located on 5X? Not able to find it in /system/etc/ like most devices.
Basically trying to include a new init.d script but not sure where to put it.
Thanks in advance!
Click to expand...
Click to collapse
Try placing in /su/su.d/ if you're rooted with superSU
Sent from my SHIELD Tablet K1 using Tapatalk
Exile1975 said:
Try placing in /su/su.d/ if you're rooted with superSU
Sent from my SHIELD Tablet K1 using Tapatalk
Click to expand...
Click to collapse
Might not have that because I have systemless phh Superuser.
Code:
bullhead:/ # ls
...
drwxr-xr-x 3 0 2016-11-28 00:38 res
drwx------ 2 0 2016-11-07 18:55 root
drwxr-xr-x 3 4.0K 2016-11-28 11:20 sbin
lrwxrwxrwx 1 21 2016-11-28 00:38 sdcard -> /storage/self/primary
-rw-r--r-- 1 758 2016-11-28 00:38 seapp_contexts
-rw-r--r-- 1 68 2016-11-28 00:38 selinux_version
-rw-r--r-- 1 203K 2016-11-28 00:38 sepolicy
-rw-r--r-- 1 11K 2016-11-28 00:38 service_contexts
drwxr-xr-x 4 80 2016-11-28 11:20 storage
dr-xr-xr-x 13 0 1971-01-18 11:50 sys
drwxr-xr-x 17 4.0K 2016-11-27 15:50 system
...

mbcache.db files is almost 4GB!

I have Kodi installed and been having problem with "low storage" and continuous hangs on the system. It is rooted.
I was checking file sizes and noticed that this one is suspiciously quiet large:
/data/data/com.amazon.tv.launcher/databases/mbcache.db
[email protected]:/data/data/com.amazon.tv.launcher/databases # ls -l
-rw-rw---- amz_a46 amz_a46 20480 2016-12-18 16:29 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-18 16:29 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 3998175232 2016-12-18 16:32 mbcache.db
-rw------- amz_a46 amz_a46 65536 2016-12-18 16:32 mbcache.db-shm
-rw------- amz_a46 amz_a46 524288 2016-12-18 16:32 mbcache.db-wal
On a system that has total 5GB this seems troubling.
Not sure where is the problem. How to fix this?
I have the same exact problem! Rooted aftv1, this has happened first time few weeks ago, it took some time to find this file and delete it. two days ago I found it already grown again to 4gb.
Tried to change file permission but it's still growing.
Any help from the experts would be really appreciated.
Is it safe to delete mbcache.db?
blurp76 said:
I have the same exact problem! Rooted aftv1, this has happened first time few weeks ago, it took some time to find this file and delete it. two days ago I found it already grown again to 4gb.
Tried to change file permission but it's still growing.
Any help from the experts would be really appreciated.
Click to expand...
Click to collapse
Thanks for your reply.
Yes, I deleted it, back it is growing back. What is weird is this only been happening recently, and I have not done any changes to my FireTV 1. i am wondering if Amazon launcher has changed and expected all users to have updated their firmwares to something more recent that what I have.
I hope someone would be able to help us figure this out.
sneezing_corgi said:
Is it safe to delete mbcache.db?
Click to expand...
Click to collapse
Yes, safe to delete, but it grows back.
blacknwhite77 said:
I have Kodi installed and been having problem with "low storage" and continuous hangs on the system. It is rooted.
I was checking file sizes and noticed that this one is suspiciously quiet large:
/data/data/com.amazon.tv.launcher/databases/mbcache.db
[email protected]:/data/data/com.amazon.tv.launcher/databases # ls -l
-rw-rw---- amz_a46 amz_a46 20480 2016-12-18 16:29 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-18 16:29 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 3998175232 2016-12-18 16:32 mbcache.db
-rw------- amz_a46 amz_a46 65536 2016-12-18 16:32 mbcache.db-shm
-rw------- amz_a46 amz_a46 524288 2016-12-18 16:32 mbcache.db-wal
On a system that has total 5GB this seems troubling.
Not sure where is the problem. How to fix this?
Click to expand...
Click to collapse
Did you figure this out? I wonder if it's Photos coming from amazon...4GB seems extreme but if it were left unattended maybe. First try going into settings>manage apps>photos and clear cache then check the to see if mbcache reduced in size. If so then there's your issue. Set your screensaver to something else or maybe turn it off. Let me know how you make out. I might be able to help
KLit75 said:
Did you figure this out? I wonder if it's Photos coming from amazon...4GB seems extreme but if it were left unattended maybe. First try going into settings>manage apps>photos and clear cache then check the to see if mbcache reduced in size. If so then there's your issue. Set your screensaver to something else or maybe turn it off. Let me know how you make out. I might be able to help
Click to expand...
Click to collapse
Hi Klite75,
I checked photos app and there is not much data there, around 5M, I cleared the cache but nothing affected the mbcache. I also checked the screensaver and found that I have it off, and "never" run.
What is weird is that the FireTV has been off since yesterday, but when I checked the mbcache.db file through adb from my PC I found that it was accessed some 30 minutes ago?!!! Who is accessing this file while the FireTV off?
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 64180224 2016-12-20 18:17 mbcache.db
-rw------- amz_a46 amz_a46 32768 2016-12-20 18:17 mbcache.db-shm
-rw------- amz_a46 amz_a46 11317672 2016-12-20 18:17 mbcache.db-wal
blacknwhite77 said:
Hi Klite75,
I checked photos app and there is not much data there, around 5M, I cleared the cache but nothing affected the mbcache. I also checked the screensaver and found that I have it off, and "never" run.
What is weird is that the FireTV has been off since yesterday, but when I checked the mbcache.db file through adb from my PC I found that it was accessed some 30 minutes ago?!!! Who is accessing this file while the FireTV off?
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 64180224 2016-12-20 18:17 mbcache.db
-rw------- amz_a46 amz_a46 32768 2016-12-20 18:17 mbcache.db-shm
-rw------- amz_a46 amz_a46 11317672 2016-12-20 18:17 mbcache.db-wal
Click to expand...
Click to collapse
Fire tv doesn't really turn off.
I checked mine (aftv1 rooted running OS5) & mbcache is filling up--about 32 MB.
If I had to wager a guess Id say theres an app thats downloading lots of data.
I did a little search but came up with nada
If I had time to wait around I might sit tight, maybe someone has a solution...
Otherwise do a factory reset and see if it happens again.
KLit75 said:
Fire tv doesn't really turn off.
I checked mine (aftv1 rooted running OS5) & mbcache is filling up--about 32 MB.
If I had to wager a guess Id say theres an app thats downloading lots of data.
I did a little search but came up with nada
If I had time to wait around I might sit tight, maybe someone has a solution...
Otherwise do a factory reset and see if it happens again.
Click to expand...
Click to collapse
Would it be possible for me to track the network connections the FireTV has, and which ones are being active? Maybe that would give me a clue which app is doing that. But I have no idea how to do such network monitoring.
blacknwhite77 said:
Would it be possible for me to track the network connections the FireTV has, and which ones are being active? Maybe that would give me a clue which app is doing that. But I have no idea how to do such network monitoring.
Click to expand...
Click to collapse
Anything's possible, unfortunately off the top of my head I dont have a method. Long shot youd have one but years ago I'm pretty sure I could keep tabs on that when I had DDWRT installed on my router.
***speaking of my fuzzy memory (read lots of stuff here) and Im about 80% certain someone posted here that was able to track specific network activity, though he didn't share his method. Don't think anyone asked.
Sorry. I've come to the conclusion that if I spend too much time struggling with android, the easiest thing to do is nuke it--factory reset. You can make a backup 1st so if the issue reappears you just go back and your data will be there.
Between last night and this morning, I did not switch on the FireTV and to my knowledge all applications are (forced quit).
But I see the the mbcache.db file has increased from 64M to 88M. There is definitely something going on that is not right.
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 64180224 2016-12-20 18:17 mbcache.db
-rw------- amz_a46 amz_a46 32768 2016-12-20 18:17 mbcache.db-shm
-rw------- amz_a46 amz_a46 11317672 2016-12-20 18:17 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-19 19:43 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-19 19:43 cmsapi.db-journal
-rw-rw---- amz_a46 amz_a46 88875008 2016-12-21 07:43 mbcache.db
-rw------- amz_a46 amz_a46 65536 2016-12-21 07:43 mbcache.db-shm
-rw------- amz_a46 amz_a46 524288 2016-12-21 07:43 mbcache.db-wal
I have spare ddwrt router that I can program as a switch and have it sit in between the FireTV and the 1st router. But I don't know how to monitor all traffic going through this 2bd ddwrt router. Any help is appreciated.
I did chmod on the file to 0.
So far it has not accumulated any more data, hopefully that solves the issue.
Code:
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-21 19:34 cmsapi.db-journal
---------- root root 0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46 amz_a46 294912 2016-12-22 21:07 mbcache.db-shm
-rw------- amz_a46 amz_a46 17271072 2016-12-22 21:07 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-21 19:34 cmsapi.db-journal
---------- root root 0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46 amz_a46 294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46 amz_a46 828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-21 19:34 cmsapi.db-journal
---------- root root 0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46 amz_a46 294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46 amz_a46 828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-21 19:34 cmsapi.db-journal
---------- root root 0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46 amz_a46 294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46 amz_a46 828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-21 19:34 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-21 19:34 cmsapi.db-journal
---------- root root 0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46 amz_a46 294912 2016-12-23 09:51 mbcache.db-shm
-rw------- amz_a46 amz_a46 828152 2016-12-23 09:51 mbcache.db-wal
[email protected]:/data/data/com.amazon.tv.launcher/databases # ll
-rw-rw---- amz_a46 amz_a46 20480 2016-12-23 12:38 cmsapi.db
-rw-rw---- amz_a46 amz_a46 12824 2016-12-23 12:38 cmsapi.db-journal
---------- root root 0 2016-12-22 23:33 mbcache.db
-rw------- amz_a46 amz_a46 294912 2016-12-23 12:39 mbcache.db-shm
-rw------- amz_a46 amz_a46 524288 2016-12-23 12:39 mbcache.db-wal
blacknwhite77 said:
I did chmod on the file to 0.
So far it has not accumulated any more data, hopefully that solves the issue.
Click to expand...
Click to collapse
I too started running into the out of storage space problem a few weeks ago and arrived at the large mbcache.db and mbcache.db-wal files. I SCP'd them off of the firetv to look at offline, and they are SQLite database files that seem to cache all of the app/media metadata information that is pulled down from amazon (name/description/links to images and background images/etc).
Some sample snippets from the database:
Code:
$strings -a mbcache.db | head -n1
SQLite format 3
$strings -a mbcache.db | egrep ^text | head -n10
textOFields of Battle
textMBest of Movies
textPRecently Added TV
textJTrending TV
textZOriginal & Exclusive Movies
textSRecommended Drama TV
textaRecommended Science Fiction Movies
textNElection Movies
textWTop Movies & TV on Prime
textWAmazon Original Comedies
Note: XDA wouldn't let me post links, but I wanted to demonstrate above that the database also calls images/background images via http for items in the launcher.
I don't think removing the permissions that make these files writable is necessarily the correct fix though, or at least if you still plan on using the stock Amazon launcher, which many of us do. When this file is not writable (chmod 0), several of the menu items (home/prime/tv/movies/etc) will not populate with anything and get stuck on a loading screen and remain empty. The device needs to be able to pull down metadata and write to the mbcache files for items to populate in these menus.
After I removed the files and rebooted the firetv, the new mbcache file created was about 5mb. I'll need to do some monitoring to see how often this file is written to and how quickly it grows, but I suspect what is happening is this file is append only and continues to grow as new items are added to the amazon library online and are cached locally on the firetv. If that is the case, it makes me wonder if it was an oversight in the firmware coding to not set a max file size and clean/purge old cached items. If it's a slow increase of ~5mb per day or so, that might explain why it took so long to finally exhaust all available free space on the firetv and only recently started becoming an apparently issue for us.
I'm currently running 51.1.6.3. I'm going to monitor/test for a few days on this firmware, and then I'm going to flash the latest pre-rooted stock 5.2.1.1 and see if there's any difference. If there is nothing in the firmware to limit the size that this file can grow to or purge old cached items out, then it might need to be a file that needs to be manually removed by users at some regular interval (1-12 months) or something.
For anyone not using the amazon launcher (firedtvlauncher or similar), then the chmod 0 solution will probably be fine. My comments are really more aimed at retaining stock amazon launcher functionality while addressing the file size issue.
This is just after some preliminary troubleshooting and will need to do some further monitoring/testing, but hope this info helps for anyone else running into the problem.
entropyaz said:
I too started running into the out of storage space problem a few weeks ago and arrived at the large mbcache.db and mbcache.db-wal files. I SCP'd them off of the firetv to look at offline, and they are SQLite database files that seem to cache all of the app/media metadata information that is pulled down from amazon (name/description/links to images and background images/etc).
Some sample snippets from the database:
Code:
$strings -a mbcache.db | head -n1
SQLite format 3
$strings -a mbcache.db | egrep ^text | head -n10
textOFields of Battle
textMBest of Movies
textPRecently Added TV
textJTrending TV
textZOriginal & Exclusive Movies
textSRecommended Drama TV
textaRecommended Science Fiction Movies
textNElection Movies
textWTop Movies & TV on Prime
textWAmazon Original Comedies
Note: XDA wouldn't let me post links, but I wanted to demonstrate above that the database also calls images/background images via http for items in the launcher.
I don't think removing the permissions that make these files writable is necessarily the correct fix though, or at least if you still plan on using the stock Amazon launcher, which many of us do. When this file is not writable (chmod 0), several of the menu items (home/prime/tv/movies/etc) will not populate with anything and get stuck on a loading screen and remain empty. The device needs to be able to pull down metadata and write to the mbcache files for items to populate in these menus.
After I removed the files and rebooted the firetv, the new mbcache file created was about 5mb. I'll need to do some monitoring to see how often this file is written to and how quickly it grows, but I suspect what is happening is this file is append only and continues to grow as new items are added to the amazon library online and are cached locally on the firetv. If that is the case, it makes me wonder if it was an oversight in the firmware coding to not set a max file size and clean/purge old cached items. If it's a slow increase of ~5mb per day or so, that might explain why it took so long to finally exhaust all available free space on the firetv and only recently started becoming an apparently issue for us.
I'm currently running 51.1.6.3. I'm going to monitor/test for a few days on this firmware, and then I'm going to flash the latest pre-rooted stock 5.2.1.1 and see if there's any difference. If there is nothing in the firmware to limit the size that this file can grow to or purge old cached items out, then it might need to be a file that needs to be manually removed by users at some regular interval (1-12 months) or something.
For anyone not using the amazon launcher (firedtvlauncher or similar), then the chmod 0 solution will probably be fine. My comments are really more aimed at retaining stock amazon launcher functionality while addressing the file size issue.
This is just after some preliminary troubleshooting and will need to do some further monitoring/testing, but hope this info helps for anyone else running into the problem.
Click to expand...
Click to collapse
Thank you very much!
Yes, I suspected the file has to do with Amazon launcher caching media, but did not have the proper skills to investigate the file, you did an excellent job there.
I have been thinking about flashing to a newer firmware but I dont want to lose root. It is a first gen firetv so it might also start to slow down with new firmware.
You are correct about the "no movies loaded" at the start screen after I chmod permissions, but so far this was the only thing that worked. I already tried to remove the file but it starts piling up really quickly, I am sure Amazon started allowing higher resolution media which eats memory quicker (maybe a way to slow down devices and forces people buying the next gen).
Anyways, keep us informed on what you find and come up with as a solution.
My best guess is that it has to do with FW 5.2.4.0 & all the changes it brings. Specially on the server side of things. This just started to happen as this changes took place.
http://www.aftvnews.com/fire-tv-update-5-2-4-0-was-halted-due-to-appstore-server-load-concerns/
As for the mbcache.db & related files being reconstructed very quickly even after being deleted I think it's related to this new FW 5.2.4.0 GUI "feature" (auto-playing video and audio on home screen interface) which we on older FW have no way of controlling. And there for this cache repopulate themselves in days. When we have never been affected by this for years of our devices usage.
http://www.aftvnews.com/how-to-disa...dio-on-the-new-fire-tv-home-screen-interface/
This is all my assumption, but I think it's no coincidence that for the most part FireOS 3 devices on really old FW are the worst affected. Newer FW handles this cache's better since Amazon knew their cache needs where increasing with each update & new features & GUI changes.
One of my FTV1's is @ the latest PreRooted Rom. That MBCache.db is @ 18.6 MiB after a week of usage. This is why I think age of FW has to do with outdated handling of the MBCache.db & other cache files in my opinion.
Bottom line, the older FW you have on your FTV1 the more likely to have this "out of space" due to MBCache.db problems.
I dealt with this issue back in early December or so. I deleted the mbcache.db and freed up GBs of space. Of course it has grown to GBs of space again, so I just deleted it again. Well not sure what was different from last time to this time, but I noticed my TV went blank; I couldn't get the AFTV to display anything. Pressed all the buttons, turned my TV on and off, cycled inputs, just figured it was a glitch. So, I finally tried the force reset, by holding the Home and Play buttons. To my surprise it actually rebooted, so I felt better. It showed the Amazon splash screen and my Boot recovery options, but when it got fully loaded, the TV screen was blank again. I tried to run kodi using my press Home button twice shortcut, but it didn't work.
I keep checking the database to see if it is growing, but it seems to be stuck at 5536. I'm curious, is it safe to delete the other file databases in the databases folder? I'm curious if one of them became corrupted or got out of sync with the mbcache.db when I deleted it.
Modify_inc said:
I dealt with this issue back in early December or so. I deleted the mbcache.db and freed up GBs of space. Of course it has grown to GBs of space again, so I just deleted it again. Well not sure what was different from last time to this time, but I noticed my TV went blank; I couldn't get the AFTV to display anything. Pressed all the buttons, turned my TV on and off, cycled inputs, just figured it was a glitch. So, I finally tried the force reset, by holding the Home and Play buttons. To my surprise it actually rebooted, so I felt better. It showed the Amazon splash screen and my Boot recovery options, but when it got fully loaded, the TV screen was blank again. I tried to run kodi using my press Home button twice shortcut, but it didn't work.
I keep checking the database to see if it is growing, but it seems to be stuck at 5536. I'm curious, is it safe to delete the other file databases in the databases folder? I'm curious if one of them became corrupted or got out of sync with the mbcache.db when I deleted it.
Click to expand...
Click to collapse
Same here. What I thought was the solution (changing permissions on the file) actually messed up my FireTV. I can't even power the FireTV on from my remote, I have to pull the plug and replug, and even then I get to the loading movies/...etc screen with spinning wheel for ever, remote doesn't do anything.
I am wondering if it is time to load a ROM or something that has the newest firmware bits but keep root.
Or maybe simply move on and buy a FireTV 2.
I too have been having this low memory issue. I'm on quite an old firmware and also having an issue with the FireTv randomly rebooting to recovery (CWM). I don't even have much installed on my system. I have a simple Kodi (No library content on it), Netflix, YouTube, and Total Commander and I still consistently run out of space. At most, I've only been able to keep about .5 gig free. When I get home tonight I will check the size of these files and see how much it frees up. I think it is time to take the plunge and install TWRP then the latest pre-root. I don't think I can keep firestarter running after that though. :/
Might be useful to just write a small script that runs at boot to delete the file and force it to start over.
mattvirus said:
Might be useful to just write a small script that runs at boot to delete the file and force it to start over.
Click to expand...
Click to collapse
The only thru solution is to upgrade FW to FireOS 5. Since the cache file will quickly rebuild itself.

Categories

Resources