Related
I know of three ways to disable/freeze unwanted apps:
Using the command pm disable PACKAGE_OR_COMPONENT
Titanium Backup Pro
Disable the app through the built-in Application Manager (does not work for all apps)
Here's some details I could find about pm disable: http://www.kpbird.com/2013/05/android-shell-command-pm-package-manager.html
But my question to the community: When an app is disabled/frozen by any of these methods, what keeps track of these? Where is this data stored?
If nobody can answer my question above, then I have a different question: Are there any apps/commands that would allow you to view/log filesystem changes on-the-fly? (goal with this: start this "watcher" app, then disable an app using pm, and figure out what changed).
Thanks!
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Aou said:
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Click to expand...
Click to collapse
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
jetlitheone said:
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
Click to expand...
Click to collapse
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Aou said:
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Click to expand...
Click to collapse
Yeah I know what you mean I don't know it might be possible. Only thing I know of is applications that run bash scripts on boot up. But not of running one via a flashable zip in recovery
Sent from my SGH-I337 using Tapatalk 4 Beta
Based on some of the flashable zips out there, I think it's possible to use busybox to execute a bash script. I came up with a little bit of crappy psuedocode for what needs to happen:
Code:
set foundFlag = 0
if (file exists: /system/app/<app>.apk) do:
for (each line of package-restrictions.xml) do:
if ( line = <pkg name="com.wssyncmldm" enabled="1" /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
set foundFlag = 1
else do:
echo line into newfile
end if
end for
if (foundFlag != 1) do:
for (each line of package-restrictions.xml) do:
if ( line = <preferred-activities /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
echo <preferred-activities /> into newfile
else do:
echo line into newfile
end if
end for
end if
move newfile -> package-restrictions.xml
end if
The above would need to be repeated 3 times for the 3 apk's that need to be disabled.
.
ok,
i tried to update earlier, and the first update went through, but part 2 did not. i tried to go back to 100% stock and relock my phone, and i get this error: no valid piv block in SP for system piv validation failed (system) relock failure. and now it tells me there are no updates available, someone please help me moto x xt1060
Couple things, what build number (KXA21.12-L1.26, KXA21.12-L1.26-3, KXA21.12-L1.26-4, other) and what did you do or believe you had to do to return to stock? Were you previously running a custom recover (ie: TWRP)?
KXA21.12-L1.26-1, I was running twrp, flashed factory recovery, first update went through, second did not, then I flashed system and all, now I cannot get it to lock and it does not show an update available
The other thread has the solution, download the latest 4.4.4 rom from moto site, edit the xml file to NOT wipe your phone, use RSD lite to flash the phone, update as normal through settings.
Google this: VZW_XT1060_4.4.4-KXA21.12-L1.26_CFC_1FF.xml.zip
unzip and edit xml file,
remove these:
<step operation="getvar" var="max-download-size" />
<step operation="erase" partition="userdata" />
<step operation="erase" partition="customize" />
save file
boot to bootloader, start RSD lite, browse to the xml file and start it
I don't ever see an XML file, and I have never been able to get rsd to work, can you explain rsd to me
superkeest said:
The other thread has the solution, download the latest 4.4.4 rom from moto site, edit the xml file to NOT wipe your phone, use RSD lite to flash the phone, update as normal through settings.
Google this: VZW_XT1060_4.4.4-KXA21.12-L1.26_CFC_1FF.xml.zip
unzip and edit xml file,
remove these:
<step operation="getvar" var="max-download-size" />
<step operation="erase" partition="userdata" />
<step operation="erase" partition="customize" />
save file
boot to bootloader, start RSD lite, browse to the xml file and start it
Click to expand...
Click to collapse
loganehaynes said:
I don't ever see an XML file, and I have never been able to get rsd to work, can you explain rsd to me
Click to expand...
Click to collapse
You need to extract the archive, the xml file is inside the zip. I have taken the liberty of performing the google search for you:
http://motofirmware.center/files/file/47-vzw_xt1060_444-kxa2112-l126_cfc_1ffxmlzip/
I assure you that there is an xml file in the archive that you will download.
And heres how to use RSD lite:
http://wccftech.com/steps-to-restore-moto-x-to-stock-firmware-with-rsd-lite-att-sprint-t-mobile-us-cellular-verizon/
Thank you, I will try it as soon as I can
RSDLite is the easy way, but you can fastboot flash all the partitions if you cannot get RSDLite working. I RSD'd back to KXA21.12-L1.26 and it ran through all the updates just fine. Here is a link to a zip with RSDLite and the Motorola USB driver required (CLICK HERE).
FYI... Moto didn't put an XML to use with RSDLite into some of the newer SBF/FXZ they had on the dev image site.
They did include a flash.bat which calls fastboot, and includes their tweaked version of fastboot inside the SBF/FXZ download.
Thank You
thank you all for your help! at the moment, my android is upgrading, optimizing app 24 of 73! if you were here, we would open a jar of shine and celebrate!
Edit: Considering all the complex processes that I've done, I'm willing to do some series of steps again with the gathered knowledge, but I still need some guidance.
Actual status: Losing my mind (not fixed)
Here's the info of my current problem:
I have a XT1563, cid12 (cl)
Working perfectly until android 6.0 OTA. After restart, in the wifi screen loading bar is constantly present and switches itself off after a couple of seconds of activated. Network list is empty, mac address appears as 02:00:00:00:00:00 in wifi details and status of the phone.
Sent it to support and they 'updated the software', when I got it back wifi was working, but when I installed sd and sim cards back it stopped working.
The most relevant logcat message that appears to be the main one is from WifiStateMachine:
Code:
WifiStateMachine: Fail to set up pno, want false now false
WifiStateMachine: Failed to load driver
Things I've done
Most of this steps have been tried with clean installs and removing sd/sim cards
Network Reset
Factory Reset
Flash different stock roms (currently on 6.0.1 MPD24.107-52)
Flashed ultra kernel R2, R3 and squid kernels 14, 15, 15 oc, 15b
Used twrp 2.8.7 and 3.0.0-r2
Used rsd to flash official firmware for my carrier (RETLA-ENTEL_6.0_MPD24.65-25.1)
Flashed CM 12 and CM 13 unofficial
Installed SuperSU and Busybox
Changed owners and permits in persist/
Copied new persist from different sources
Hex edited .bin file in persist/
downloaded WCNSS_wlan_dictionary.dat and put it in persist to comply with symlink in prima/
fastboot oem install [2 of my carriers; entel, claro]
Replaced WCNSS files in persist with the ones available the motorola repo
Copied WCNSS factory file to prima/ folder
Copied WCNSS_qcom_cfg.ini to /data/misc/wifi
went crazy with 776 permissions
Even after flashing stock with RSDLite, bootloader show the modified status as 3 when I think it should be 2. This has led me to think that something is in the file system that android does not like but is not being fixed by RSD nor clean wipes.
From what I understand, the only thing that could be surviving full flashes and wipes are contents in persist/ and modifications to the root of the system, like busybox and superSU. I've not been able to find any way of cleaning the root of the phone and I imagine that's really dangerous.
TL;DR Wifi driver is not loading, persist folder is ok and clean flash does not fix it.
Possibly relevant logcat entries:
E WifiService: Invoking mWifiStateMachine.setWifiEnable
D WifiStateMachine: setting operational mode to 1
E WifiHW : User build,dont Start logging service.
E WifiService: Invoking mWifiStateMachine.setWifiEnabled
E WifiStateMachine: Failed to load driver
D WifiStateMachine: setWifiState: unknown state
Info for nerds:
Source code of WifiStateMachine.java containing the error message:
Code:
public boolean processMessage(Message message) {
switch (message.what) {
case CMD_START_SUPPLICANT:
[B]if (mWifiNative.loadDriver())[/B] {
// Code for loading supplicant
} else {
loge("Failed to load driver");
}
break;
# More code
}
}
WifiNative.java cointains the class being instantiated where the evaluation calls a empty abstract method:
Code:
public native static boolean loadDriver();
I'm having problems for identifying where this class is being extended for this method to actually do something. If anyone knows please leave a comment.
Wifi problems and fixes
I've still not found a solution for myself, but I figured I still can give some tips for people with problems, especially considering how confusing is to get information about this.
This is a work in progress. I would gladly receive corrections and new info.
Before anything, do a backup. Even if your wifi does not work, it can save you from a lot of problems. Remember to backup the persist folder, a lot of automated recoveries don't make a backup of that folders because it's supposed to survive flashes but there's ways in which you can do it by mistake. It also helps a lot with bug hunting.
Things you should have already tried:
Plane mode on, reboot, wifi on and plane mode off
Network settings reset in android and reboot
Rebooted to safemode (longpress in power off when turning phone off]
Factory reset in android
Removal of SD and SIM cards
Factory reset in recovery
Flash Stock ROM in RDSlite
Unlock bootloader
Activate developer mode and set usb debug on
Installed custom recovery
Clean Flash stock ROM trough fastboot
Flash custom Kernels
Things you need:
adb and fastboot
usb drivers for the phone
Optional Text editor that preserves text format (avoid notepad and MS word)
Optional Busybox for extended commands in android shell (root required)
Optional If you're in windows and want to mess with adb: A decent console to work with.
Option A: cash with cmder
Install cmder
Install NodeJs
Install cash tipping in cmd npm install cash-global -g (after NodeJs)
Option B: babun
http://babun.github.io/
optional Open text editor for easy copy-paste of long paths and commands
optional Hex editor if you want to edit .bin files. I use XVI32
Useful console commands (In windows you need one of the optional shells described above)
List files and folders
Code:
ls -la [path to list]
Find file/folder in linux (and android shell)
Code:
find / -iname '*[word you're looking]*'
* are 'wildcards', they allow for matching any text (or no text at all)
you can add, before -iname, -type f (for files) or -type d (for folders)
Symlink
It's an alternative of copying files. this allows you to simulate having a file in two different places, but really all paint to one. Modifications in this source are going to affect all the links, so it's easier to configure. Android does this a lot.
Code:
ln -s [path to] [from]
Copy files and folders
Code:
cp [-R if you want to move folders] [path to source] [path to target]
logcat for essential wifi messages (short-colored) If someone know more, please let me know
Code:
adb logcat -v brief -v color WifiSerice:V WifiHW:V WifiStateMachine:V FileUtils:V QSEECOMAPI:V *:S
change owners and permissions
the flag -R makes the command work for files and subfolders
Code:
chown user:group [path to file or folder]
chmod [num of user][num of group][num of all] [path to file or folder] [SIZE="2"](e.g. chmod 660 /persist/WCNSS_qcom_wlan_nv.bin)[/SIZE]
grep
This one is awesome; It's for filtering the results of any command, so you can use it for filtering.
Code:
[command you want to filter] | grep -i [term you're looking for]
For example, [adb logcat] gives you a huge list of messages, but [adb logcat | grep -i wifi] gives you just the lines that contain 'wifi'
From my experience, this are the common folders related to wifi configs:
Code:
/persist/
/system/etc/firmware/wlan/prima/
/system/etc/wifi/
/data/misc/wifi/
Command list for do a full clean flash:
please note that system.img_sparsechunk can vary in number according to ROM, but I've put 9 in here because failed commands don't write to phone
note: fastboot flash partition gpt.bin works perfectly when used first, but for me it's failing when I erase system and boot first.
Code:
fastboot erase system -w
fastboot erase boot
fastboot erase fsg
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash modem NON-HLOS.bin.
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot erase customize
fastboot erase clogo
fastboot reboot (or reboot-bootloader)
Important: Every time you flash, do a clean wipe. In fastboot this usually means using erase system -w and erase boot before flashing.
Be aware that for getting the logcat your phone must be booted to android OS.
Be aware that for copying and modifying important files you must access the phone's shell either in recovery mode or switching to root with the command (su) that's only accesible if you're rooted.
Ok. If you made it this far you're probably losing your mind. To debug this, especially if you're going to post asking for help, get the catlog of your phone and/or a precise description to look for clues to your problem (I have a command ready for you above).
Here's some common solutions I've found while trying to solve my own problem: (Credits to the authors of the solutions)
Bad permissions/users
These appear to be correct or usable permissions for relevant files. Consider that there's a lot of fragmentation in this info so they might be wrong.
Confirmation of these would be great:
Code:
-rwxrwx--- wifi wifi /system/etc/wifi
-rw-rw---- wifi wifi /system/etc/wifi/wpa_supplicant.conf
-rwxrwx--- wifi wifi /data/misc/wifi
-rwxrwx--- wifi wifi /data/misc/wifi/sockets
-rw-rw---- wifi wifi /data/misc/wifi/wpa_supplicant.conf
-rw-rw---- system:wifi /data/misc/wifi/WCNSS_qcom_cfg.ini
-rw-rw---- wifi wifi WCNSS_qcom_wlan_nv.bin
-rw-rw---- root root WCNSS_wlan_dictionary.dat
-rwxrwx--- is 770, -rw-rw---- is 660
Is reported in some places that the parent folder of wpa_supplicant.conf should be -rw-rw---- wifi wifi
Missing or badly configured wpa_supplicant.conf
The solution is place a new copy of the file in the correct folders. If someone has a 'oficial' source or more info let me know
I remember reading that some people had success deleting the file so the SO rebuilds it. Do it to your discretion and remember to backup
Missing WCNSS files
These files are essential and must be in the correct paths for wifi drivers to load.
There's a lot of different sources for this files, but from my experiencie they don't change a lot (last commits are more than one year old).
Files in oficial source repository from motorola
These posts have info and files
http://forum.xda-developers.com/showthread.php?t=2589790
http://forum.xda-developers.com/showpost.php?p=48861415&postcount=19
Paths of relevant files. Please consider that not just because it's here means you need it
Code:
/persist/WCNSS_qcom_wlan_nv.bin
/persist/WCNSS_qcom_wlan_factory_nv.bin
/persist/WCNSS_qcom_wlan_dictionary.dat
/system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini
/system/etc/firmware/wlan/prima/WCNSS_cfg.dat
/system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin
/system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_dictionary.dat
/system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_factory_nv.bin
/data/misc/wifi/WCNSS_qcom_cfg.ini
/data/misc/wifi/wpa_supplicant.conf
Missing /persist/drm/widevine and/or /persist/prov
Check this two posts:
http://forum.xda-developers.com/showthread.php?t=2589790
http://forum.xda-developers.com/showpost.php?p=48861415&postcount=19
In there you can find backups to get the folders, restore them to /persist/ and check permissions.
Bad MAC address in WCNSS_qcom_wlan_nv.bin
Sometimes the file WCNSS_qcom_wlan_nv.bin needs to be updated with the correct mac address.
Since it's a .bin file, it cannot be changed with a text editor. You need to use a hex editor (XVI32 link is in 'things you need' above).
The mac address starts at 'A' (since is hex) or, more simply, after 10 'cells'. Be aware that in this editor changes get 'inserted' instead of modified, so you have to delete the initial 6 addresses of the old mac.
Put the file back, and check permissions. There's two copies of this file: one in /persist/ and another in /system/etc/firmware/wlan/prima/ change one or both according with your situation
Some logcat messages and details about them
For getting more messages about wifiHW you need a userdebug build like CyanogenMod. Stock roms don't log wifiHW.
Code:
WifiStateMachine: failed to load driver
WCNSS_qcom_cfg.ini and/or WCNSS_cfg.dat is missing somewhere. In my case this was missing from /system/etc/wifi.
Code:
wcnss_service: CAL file not found
This refers to the calibration file. The source of wcnss-service.c defines this file as "WCNSS_qcom_wlan_cal.bin" in the path "/data/misc/wifi/WCNSS_qcom_wlan_cal.bin". however, source show that CAL file is not used if the factory file is present. Source in link gives this address '"/data/misc/wifi/WCN_FACTORY" which is weird because from posts in xda this file has the name "CNSS_qcom_wlan_factory_nv.bin" I'll update if I have more info
Info for nerds:
How android Wifi works:
https://community.freescale.com/docs/DOC-93603
source code for wifi opt framework - android 6.0.1 r22
source code for wifi qcom framework - android 6.0.1 r22
you need hex editor to edit those .bin files.www.droidrzr.com/topic/65438-how-to-change-your-mac-address-xt926/
forum.xda-developers.com/nexus-4/help/nexus-4-mac-changer-spoofing-t2180809/page3
Thank you for your answer!
I'll make the edit in the file but I'll take a while to report back on the results because it's already too late in here.
Considering this, would it make sense for a nonmatching mac address show up as 02:00:00:00:00 in the wifi details screen?
RoDeltaLambda said:
Thank you for your answer!
I'll make the edit in the file but I'll take a while to report back on the results because it's already too late in here.
Considering this, would it make sense for a nonmatching mac address show up as 02:00:00:00:00 in the wifi details screen?
Click to expand...
Click to collapse
Yes, your Mac address is fine, just checked I also have the same
try this and report if its working
1. Put the phone into airplane mode.
2. Restart the phone.
3. Turn on WiFi.
4. Connect to the WiFi network.
5. Turn off airplane mode.
bablu048 said:
Yes, your Mac address is fine, just checked I also have the same
try this and report if its working
1. Put the phone into airplane mode.
2. Restart the phone.
3. Turn on WiFi.
4. Connect to the WiFi network.
5. Turn off airplane mode.
Click to expand...
Click to collapse
I've tried those steps and it's not working.
Logcat shows "WifiStateMachine: Failed to load driver" in each attempt.
I will update the .bin modifications results in a couple of minutes
bablu048 said:
you need hex editor to edit those .bin files.www.droidrzr.com/topic/65438-how-to-change-your-mac-address-xt926/
forum.xda-developers.com/nexus-4/help/nexus-4-mac-changer-spoofing-t2180809/page3
Click to expand...
Click to collapse
I have tried the modifications to no avail.
Steps I did:
get the wifi mac address from the recovery logs
adb pull the files on recovery with persist mounted
hex edited the lines taken from the screenshot on your second link (Both _factory_nv.bin and _nv.bin
adb pushed lines back to mounted persist on recovery
cleaned data/cache/dalvik
rebooted to system
Is there something in the /data/ folder that could be causing the issue? Now both files show back at -rw-r--r-- permissions with root:root owner. I'll try again without wiping data this time and post the report.
RoDeltaLambda said:
I have tried the modifications to no avail.
Click to expand...
Click to collapse
I think this thread solved the problem just by replacing the files from another device forum.cyanogenmod.org/topic/84876-wifi-failure-after-cm11-install-still-present-after-restore-from-backup/
bablu048 said:
I think this thread solved the problem just by replacing the files from another device forum.cyanogenmod.org/topic/84876-wifi-failure-after-cm11-install-still-present-after-restore-from-backup/
Click to expand...
Click to collapse
I have tried the steps in that topic, copying the exact same files in /persist and /prima. Problem still persists
From that topic I've learned that at flash time the files from persist are taken out and sent to system folders. I will try to reflash now with the new files and permissions set up
After the actions of my last post and before the new flash, I scanned the results of adb logcat *: D | grep Wifi
Here are some entries that could be of interest:
more possibly relevant logcat entries:
Code:
[SIZE="2"][I]Initially country code appears to be empty:[/I][/SIZE]
I WifiService: WifiService trying to set country code to with persist set to true
WifiService: Client connection lost with reason: 4
I WifiService: WifiService trying to set country code to cl with persist set to true
E WifiService: Invoking mWifiStateMachine.setWifiEnable
D WifiStateMachine: setting operational mode to 1
E WifiHW : User build,dont Start logging service.
E WifiService: Invoking mWifiStateMachine.setWifiEnabled
E WifiStateMachine: Failed to load driver
D WifiStateMachine: setWifiState: unknown state
RoDeltaLambda said:
I have tried the steps in that topic, copying the exact same files in /persist and /prima. Problem still persists
From that topic I've learned that at flash time the files from persist are taken out and sent to system folders. I will try to reflash now with the new files and permissions set up
Click to expand...
Click to collapse
I've fully flashed the device with RSD and problem still persist.
Eager to hear some more ideas.
I noticed that in system/etc/firmware/prima, adding to the files I copied, there's one symlink: WCNSS_wlan_dictionary.dat -> /persist/WCNSS_wlan_dictionary.dat
This file is not present in my persist folder (nor the rest of the files in the phone, based on adb shell find . -name WCNSS_wlan_dictionary.dat). I imagine this could clearly cause a problem with the wifi driver looking for a file that does not exist.
Someone has a reliable source where I could get this file? I can try to delete it to see if the SO tries to rebuild something, but I would prefer the safest option first.
have you tried flashing back stock recovery then do a factory reset from there?
copy WCNSS_qcom_wlan_factory_nv.bin to your SD card. Use your filemanger to copy this file to /prima. Reboot
Activate wi-fi, the you'll find your mac adress under Settings > About Phone > Status > Wi-fi MAC Adress
Open WCNSS_qcom_wlan_factory_nv.bin on your phone or PC with a hex editor and type your mac adress inside that file and save it.
File attached just remove .txt
The file is from xt1562
bablu048 said:
copy WCNSS_qcom_wlan_factory_nv.bin to your SD card. Use your filemanger to copy this file to /prima. Reboot
Activate wi-fi, the you'll find your mac adress under Settings > About Phone > Status > Wi-fi MAC Adress
Open WCNSS_qcom_wlan_factory_nv.bin on your phone or PC with a hex editor and type your mac adress inside that file and save it.
File attached just remove .txt
The file is from xt1562
Click to expand...
Click to collapse
Thank you for the file and the instructions. I've checked the diff with 3 different sources:
Meninblack007 - vendor
huawei_msm8916
google android source code
All match, so I'll asume this is a universal file without modifications.
Moving this file to persist/ folder made no difference
I've also tried taking the files from motorola official github repo, copy them to persist/ and flash. Without success this far.
I'll send factory_nv.bin to prima folder and report back
flash the firmware through rsd lite, lock the bootloader and take it again to service center.
I am out of ideas and also Google searches.. I'll keep looking and report if I find anything else.
bablu048 said:
copy WCNSS_qcom_wlan_factory_nv.bin to your SD card. Use your filemanger to copy this file to /prima. Reboot
Activate wi-fi, the you'll find your mac adress under Settings > About Phone > Status > Wi-fi MAC Adress
Open WCNSS_qcom_wlan_factory_nv.bin on your phone or PC with a hex editor and type your mac adress inside that file and save it.
File attached just remove .txt
The file is from xt1562
Click to expand...
Click to collapse
I've copied the file between the locations trough adb shell and there's no noticeable difference.
MAC address does not appear either in this screen:
I'll post this image and the versions of the phone in the OP
did u try ultra kernel?
i have same problem.
i flash ultra kernel(r3), and my wifi work fine.
jalal-jap said:
did u try ultra kernel?
i have same problem.
i flash ultra kernel(r3), and my wifi work fine.
Click to expand...
Click to collapse
Yes I've tried.
Flashed ultra kernel R2, R3 and squid kernels 14, 15, 15 oc, 15b
Click to expand...
Click to collapse
Considering all the changes I've done, it was a good idea to try again.
I've tried the last release of squid kernel, since the dev of ultra kernel recommended this one for 6.0.1.
Installed the kernel, wiped cache/dalvik and rebooted without success. Logcat is still showing failure at loading drivers.
The main problem I'm having is that the failure point is not correctly specified, so now I'll try to dig deeper into logcats to see if I pinpoint the source of the issue. If anyone can let me know about some complementary logs, I would be super grateful.
I've installed CM to have a userdebug build, in order to debug more in detail thanks to the logs of wifiHW.
After fixing an error of missing WCNSS_qcom_cfg.ini in /system/etc/wifi (Copied from prima folder) I've came across this error appearing persistently:
Code:
wcnss_service: Failed to open /dev/wcnss_ctrl : Bad address
I've looked around but there's no info of how could I deal with this. I will dig around a little more but if someone has a tip I would gladly hear
This guide is primarily intended for rooted users updating to the latest security update, since stock users can just take the OTA.
Key points
User data and applications are kept intact
You do not have to remove your PIN, password, or fingerprint
You do not have to remove TWRP, Magisk, your custom kernel, dtbo, or anything
This is intended for monthly security updates; developer previews and beta releases may or may not work with this method. You're welcome to try, but all may not work as expected
Installing Update:
Make sure you have the latest Google SDK Platform Tools. Extract the archive to a location of your choosing (creates platform-tools folder)
Get the latest taimen Factory Image (not OTA) from Google's Developer Page and save to a location of your choosing
Extract the archive, and open the extracted folder. You should see a list of files:
bootloader-taimen-[version string].img
flash-all.bat
flash-all.sh
flash-base.sh
image-taimen-[version string].zip
radio-taimen-[version string]
.img
Open the flash-all script (flash-all.bat for Windows, flash-all.sh for Linux/OSX) in your favorite text editor.
Find the line that reads "fastboot -w update image-taimen-[version].zip and remove "-w" (the wipe user data switch). Save and close the flash-all script.
Move (cut and paste, etc) all of these files to the platform-tools folder.
Enable USB Debugging from the Developer Options menu on your device (press "Build Number" 7 times if not already visible)
With your device plugged into the computer, open a command prompt in the platform-tools folder
Windows: Open the folder, hold down Shift and right click inside the folder, "Open Command window here"
Linux: If you're on Linux you already know how to do this
OSX: Open a folder in a terminal
Reboot to bootloader:
Code:
adb reboot bootloader
Execute update script in terminal:
Windows:
Code:
flash-all.bat
Linux/OSX:
Code:
./flash-all.sh
The device will reboot a few times while updating
Restoring root and/or a custom recovery
Download latest:
TWRP image
Magisk zip
TWRP zip
(Optional) Custom kernel zip
Place all files in the platform-tools folder
Reboot to bootloader
Boot TWRP image.
Code:
fastboot boot [twrp image filename].img
Push zip files to /tmp
Code:
adb push [magisk filename].zip /tmp
Optional: TWRP persistent installation + custom kernel:
Code:
adb push [twrp filename].zip /tmp
adb push [custom kernel filename].zip /tmp
Install Magisk:
Code:
adb shell twrp install /tmp/[magisk filename].zip
Optional: TWRP persistent installation + custom kernel:
Code:
adb shell twrp install /tmp/[twrp filename].zip
adb shell twrp install /tmp/[custom kernel filename].zip
adb shell twrp install /tmp/[magisk filename].zip
Reboot to system
[ Reserved ]
[ Reserved Post ]
[Deleted]
tlbland0426 said:
Nice guide but correct me if I'm wrong but I don't believe there is a working solution for Magisk yet
Click to expand...
Click to collapse
Magisk works fine...
twiz0r said:
Magisk works fine...
Click to expand...
Click to collapse
He probably was referring to P
Telperion said:
This guide is primarily intended for rooted users updating to the latest security update, since stock users can just take the OTA.
Key points
User data and applications are kept intact
You do not have to remove your PIN, password, or fingerprint
This is intended for monthly security updates; developer previews and beta releases may not work as expected
Installing Update:
Make sure you have the latest Google SDK Platform Tools. Extract the archive to a location of your choosing (creates platform-tools folder)
Get the latest taimen Factory Image from Google's Developer Page and save to a location of your choosing
Extract the archive, and open the extracted folder. You should see a list of files: bootloader-taimen-[version string].img/B]
flash-all.bat
flash-all.sh
flash-base.sh
image-taimen-[version string].zip
radio-taimen-[version string]
.img
Open the flash-all script (flash-all.bat for Windows, flash-all.sh for Linux/OSX) in your favorite text editor.
Find the line that reads "fastboot -w update image-taimen-[version].zip and remove "-w" (the wipe user data switch). Save and close the flash-all script.
Move (cut and paste, etc) all of these files to the platform-tools folder.
Enable USB Debugging from the Developer Options menu on your device (press "Build Number" 7 times if not already visible)
With your device plugged into the computer, open a command prompt in the platform-tools folder
Windows: Open the folder, hold down Shift and right click inside the folder, "Open Command window here"
Linux: If you're on Linux you already know how to do this
OSX: Open a folder in a terminal
Reboot to bootloader:
Execute update script in terminal:
Windows:
Linux/OSX:
The device will reboot a few times while updating
Restoring root and/or a custom recovery
Download latest:
TWRP image
Magisk zip
TWRP zip
(Optional) Custom kernel zip
Place all files in the platform-tools folder
Reboot to bootloader
Boot TWRP image.
Note: As of the February security update, TWRP 3.2.1-0 cannot decrypt the /data/ partition. When prompted for your PIN, cancel. You can keep /system/ read-only.
Push zip files to /tmp
Optional: TWRP persistent installation + custom kernel:
Install Magisk:
Optional: TWRP persistent installation + custom kernel:
Reboot to system
Click to expand...
Click to collapse
Will this method work if I already have TWRP installed or is this for people who have the factory recovery? I understand that I'll have to reinstall TWRP after. I just wanna make sure that this will work with TWRP installed before I do it. Thanks for the great tutorial btw!
Update: Guide worked perfectly for me!
I would say the guide worked perfectly, but even after removing the "-w", my phone immediately proceeded to wipe all data anyway.
HOWEVER!: This may have been personal error as the first time I did the "flash-all" bat, I forgot to "unlock_critical" (perhaps you should add this to your guide as mine seemed to have reset itself). I therefore had to flash again, which may have caused a corrupted file and automatically initiated the system wipe.
Secondly, on the first boot/install of TWRP, I would not recommend flashing absolutely everything in one go as for me it borked the install of Magisk and caused me all sorts of issues with Google Play (no idea how, but it did).
I would only suggest booting to TWRP and installing that zip, then going back into recovery afterwards and then flashing your kernel, then finally flashing Magisk (may be an issue related to my kernel and Magisk overwriting each other?).
Then go back into TWRP a final time and flash Dolby/VIPER, etc...
Eleiyas said:
I would say the guide worked perfectly, but even after removing the "-w", my phone immediately proceeded to wipe all data anyway.
HOWEVER!: This may have been personal error as the first time I did the "flash-all" bat, I forgot to "unlock_critical" (perhaps you should add this to your guide as mine seemed to have reset itself). I therefore had to flash again, which may have caused a corrupted file and automatically initiated the system wipe.
Secondly, on the first boot/install of TWRP, I would not recommend flashing absolutely everything in one go as for me it borked the install of Magisk and caused me all sorts of issues with Google Play (no idea how, but it did).
I would only suggest booting to TWRP and installing that zip, then going back into recovery afterwards and then flashing your kernel, then finally flashing Magisk (may be an issue related to my kernel and Magisk overwriting each other?).
Then go back into TWRP a final time and flash Dolby/VIPER, etc...
Click to expand...
Click to collapse
Well once you issues the "unlock_critical" it was wiped right?
Hey guys, I followed this today and it wiped data. I am not sure if Google has changed the flash-all.bat file, but I do recall in the past following these exact steps, opening the flash-all.bat, removing "-w" and that saving the data.
Today though, when I opened the bat for image (8.1.0 (OPM2.171019.029.B1, May 2018)) here's what it says: @Echo off
:: Copyright 2012 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.
PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot flash bootloader bootloader-taimen-tmz12a.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-taimen-g8998-00164-1710262031.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot update image-taimen-opm1.171019.011.zip
echo Press any key to exit...
pause >nul
exit
//////////////////
So there's no -w there by default apparently. When I didn't see it I assumed I would be alright. Not the case lol. But thankfully I had already backed up the few things that mattered so it wasn't a huge deal but nevertheless, is there something i am missing for future reference?
Teffy said:
Hey guys, I followed this today and it wiped data. I am not sure if Google has changed the flash-all.bat file, but I do recall in the past following these exact steps, opening the flash-all.bat, removing "-w" and that saving the data.
Today though, when I opened the bat for image (8.1.0 (OPM2.171019.029.B1, May 2018)) here's what it says: @Echo off
:: Copyright 2012 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.
PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot flash bootloader bootloader-taimen-tmz12a.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-taimen-g8998-00164-1710262031.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot update image-taimen-opm1.171019.011.zip
echo Press any key to exit...
pause >nul
exit
//////////////////
So there's no -w there by default apparently. When I didn't see it I assumed I would be alright. Not the case lol. But thankfully I had already backed up the few things that mattered so it wasn't a huge deal but nevertheless, is there something i am missing for future reference?
Click to expand...
Click to collapse
Did this occur when you tried to edit the flash-all.bat file? If so, how were you trying to edit the file?
Badger50 said:
Did this occur when you tried to edit the flash-all.bat file? If so, how were you trying to edit the file?
Click to expand...
Click to collapse
I'm not sure if you're confused about what I wrote so I'll recap. I edited the flashall with notepad but remember I never ended up changing anything at all because the file did not contain "-w" on first open after extraction.
So essentially, I did all the steps except when I editted the flash-all I didn't actually have to edit anything because there was no -w (I included full text as is, first open in my post). Then I continued through rest of the steps. Everything worked fine other than it did wipe use data at the very end.
Teffy said:
I'm not sure if you're confused about what I wrote so I'll recap. I edited the flashall with notepad but remember I never ended up changing anything at all because the file did not contain "-w" on first open after extraction.
So essentially, I did all the steps except when I editted the flash-all I didn't actually have to edit anything because there was no -w (I included full text as is, first open in my post). Then I continued through rest of the steps. Everything worked fine other than it did wipe use data at the very end.
Click to expand...
Click to collapse
I'm always confused my friend. I got it now That's pretty weird for sure. Never encountered that with all the factory images since November. Must have been a rouge download or something. I'll be on the lookout for it though in the coming months :good::good:
Can anyone confirm if this process still works on the June update?
Thanks
docluv01 said:
Can anyone confirm if this process still works on the June update?
Thanks
Click to expand...
Click to collapse
Don't see why not. It's pretty much the same as the one I use :good:
docluv01 said:
Can anyone confirm if this process still works on the June update?
Thanks
Click to expand...
Click to collapse
It worked when I flashed a device from May to Beta 2 this week, so June should still work.
My June factory flash all. bat still had the - w in it. I removed - w, saved it, ran it and worked fine. My Substratum black theme for Inbox still works as well. No data wiped at all.
If I use this method to update, is it just "dirty flashing" the device? So all my settings, apps and their data and the internal storage will remain intact? If not it's better just to flash the full OTA zip as it was suggested for me in another thread by @Badger50 ?
matekaneve said:
If I use this method to update, is it just "dirty flashing" the device? So all my settings, apps and their data and the internal storage will remain intact? If not it's better just to flash the full OTA zip as it was suggested for me in another thread by @Badger50 ?
Click to expand...
Click to collapse
Either way, your data will not be wiped. Google dirty OTA's stock, non rooted folks every month ??
Windows 10. Shift, right click menu has powershell instead of cmd.exe. Powershell doesn't work well for this. Someone tipped me to typing cmd into the path window of file explorer to get the cmd prompt going. Much easier to use than that powershell stuff.
I want to upgrade firmware from 6.0 to 7.0. there is a line in the command where it says erase data. Can I delete that command so that my data does not erase?
JulianCox said:
I want to upgrade firmware from 6.0 to 7.0. there is a line in the command where it says erase data. Can I delete that command so that my data does not erase?
Click to expand...
Click to collapse
There are a few options for updating (Non-OTA)
RSD Lite (using Windows XP/7)
Remove This line from flash_file.xml using Notepad++ then save
Code:
<step operation="erase" partition="userdata"/>
LMSA (Update option or Rescue)
The update option does not wipe dataFastboot.exe
Just do not use this command
Code:
fastboot erase userdata
LMSA is the easiest option if you have a Windows PC
sd_shadow said:
There are a few options for updating (Non-OTA)
RSD Lite (using Windows XP/7)
Remove This line from flash_file.xml using Notepad++ then save
Code:
<step operation="erase" partition="userdata"/>
LMSA (Update option or Rescue)
The update option does not wipe dataFastboot.exe
Just do not use this command
Code:
fastboot erase userdata
LMSA is the easiest option if you have a Windows PC
Click to expand...
Click to collapse
thanks mate