[GUIDE] Full FileSystem Access over SFTP / CMD over SSH on Windows 10 Mobile - Windows 10 Mobile

Hi all,
This guide uses the built-in SSH server on the phone that gets activated once you enable Device Discovery to give us TRUE full file system access. MTP doesn't truly give full file system access as there are files and folders that aren't accessible still.
NOTE: The automation of the steps listed in this whole guide has been incorporated into an easy GUI within @gus33000 's app called Interop Tools. Big thanks to him for taking the time to simplify this whole process.
Many thanks to @gus33000 [For the simplification and guinea pig process ] and @black_blob [ For making me try the UMCIAuditMode trick again]!
Manual Steps for SFTP
Tools needed
@djamol's Root Tool , or even the OEMSetting.reg tweak that @WojtasXda came up with
Some SFTP program (Swish Easy SFTP works the BEST, WinSCP works second best, but for some reason it can't read the root C: drive from SFTP).
Steps:
If you're using @djamol's Root Tool, use @vcfan's Lumia Registry Editor for this
The following keys should be set to the following string values under the Path of System\Currentcontrolset\control\ssh\sirepuser
Represented in this guide as key: value
stfp-home-dir : C:\
default-home-dir : C:\
sftp-mkdir-rex : .*
sftp-open-dir-rex : .*
sftp-read-file-rex : .*
sftp-remove-file-rex : .*
sftp-rmdir-rex : .*
sftp-stat-rex : .*
sftp-write-file-rex : .*
auth-method : password
user-pin : 1234
After you've verified that at least one of these keys have been set, exit the app
[*] Go to the phone settings app and put your Windows 10 Mobile phone in Developer Mode, activate Device Discovery then turn on Pair mode
[*] Pair to your phone using WConnect, either from usb connect mode ("wconnect usb") or IP (wconnect youripaddress) using the pin on your device
[*] When this is complete, go to %USERPROFILE%\appdata\local\Microsoft\WConnectSrv. In this directory, you should see a privkey.pem file. Hold on to this
[*] Open up PuttyGen, click on the Conversions menu and then click Import key. Point to the path that contains the privkey.pem file, then press Okay
[*] Back in PuttyGen, click on the Save private key button and then save the .ppk file off somewhere that you'll remember.
[*] Open Pagent, click Add key and point to the .ppk file you generated before. You'll want to make sure this is ALWAYS running.
If using Swish
Go to Windows Explorer, dbl-click on the Swish icon under Devices and Drives. Click on Add SFTP Connection at the top
Enter in a label that you wish to save the connection present as .
Under host your phone's IP as Host.
Enter in Sirepuser as the User.
Enter / as the Path.
Press Create
Go back to the Swish folder then click on the connection that you just created (YOU MUST HAVE PAGENT RUNNING FOR THIS TO WORK).
When prompted, enter "1234" as the password.
If using WinSCP:
Open WinSCP. Underneath of the Password box, click on Advanced.
Click on the SFTP menu item and set the Preferred SFTP protocol version to 2
Click on the SSH -> Authentication menu item. Click Allow agent forwarding, click on the ellipsis next to Private key file and choose the .ppk file you saved from PuttyGen
Press Ok to save the settings
Back on the WinSCP main screen, enter in your phone's Wi-Fi IP into host name and for the User name, type in Sirepuser. Press save and then save this session as a "Site" in WinSCP
Login. When prompted, enter "1234" as the password.
You'll receive an error initially about not being able to browse /C/ and blah blah. You can right-click and click on Goto Folder. /C/Data will be a nice folder to start at since that's where most of the goodies are.
Voila, you should know be able to have full file system access.
Now there are a FEW caveats to this..
If you're looking to modify/download any of the important files in the AOW folder, you won't be able to. For SOME REASON, it's returning "No such file or directory" if you try to download/modify some certain files. It will also return this if you try to do the same for the registry hives.
If you happen to remove all paired pins on your phone, you must add pin from the phone and use the pin as the password to your SFTP session
I'm tired of my SFTP access cutting out because the WiFi disappears when the screen goes to lock >_<. What do I do?!?!!?
Using the same Lumia Registry Editor from Djamol's Root Tool, Head to the \system\currentcontrolset\services\keepwifionsvc Path and set the following DWORD value
Start => 2
For some reason the service that keeps wifi running even while the screen is under lock is disabled on 10512. This enables it. Reboot and you'll have WiFi working under lock screen on 10512.
Manual Steps for running CMD over SSH (assuming you've done the SFTP steps above) Redstone builds required. 10586.XXX builds will NOT work
Tools Needed:
IoT Insider Preview ISO
Interop Tools - Download the latest arm package and all packages from the Dependencies directory. Install the dependencies first, THEN install the app.
Pageant
Putty
Steps:
First, you'll need to download the Windows IoT Core Insider Preview ISO. Mount it and then install the MSI. Next, you'll need to go into Disk Management (diskmgmt.msc) and create a new 4GB VHD by clicking Action-> Create VHD. Set the location to any place you wish for it to be, set the size to 4GB and keep the rest the same. Pay attention to the disk number shown in the Disk Management screen after you create and mount that VHD (They have a blue drive icon to the left of them).
When this is complete, open up an elevated command prompt. Go to C:\Program Files (x86\Microsoft IoT\FFU.
Run the following command:
Code:
dism.exe /Apply-Image /ImageFile:flash.ffu /ApplyDrive:\\.\PhysicalDriveN /SkipPlatformCheck
Where N is the disk number. At this point, you should start seeing a bunch of volumes created. The MainOS volume is the one we'll care about.
Go to that drive and copy the Windows\System32\cmd.exe and Windows\system32\en-us\cmd.exe.mui to your phone's Document's folder.
Next step is to open up the Interop Tools app, and tap on the Interop Unlock menu item from the hamburger menu. Select the option to restore NDTKSvc, reboot.
When the device comes back up, re-open Interop Tools and this time click on the Registry Editor from the hamburger menu.
Enter the following values, then press Write Data:
Registry Hive : HKEY_LOCAL_MACHINE
Registry Type: String
Registry Key Path: SYSTEM\Controlset001\Control\SSH\Sirepuser
Registry Value Name: default-shell
Registry Value Data: C:\Data\Users\Public\Documents\cmd.exe
Write this key tap on the hamburger menu and go to the Registry Browser. Travel to HKEY_LOCAL_MACHINE -> SYSTEM -> ControlSet001 -> Control -> Ci.
Tap the + button on the application bar and make sure the values are set to the following and then press Write:
Registry Hive: HKEY_LOCAL_MACHINE
Registry Type: Integer
Registry Key Path: SYSTEM\ControlSet001\Control\CI
Registry Value Name: UMCIAuditMode
Registry Value Data: 1
This actually enables the execution of unsigned executables. This is how we end up making CMD and the other programs work ^_^.
Reboot your phone. Wait a good 3-5 minutes before you try doing anything because your phone will be acting very unstable (Some apps crashing, and others working).
While you have pageant open and the private key added, open up a putty SSH session to your phone using the username of Sirepuser. You should be delighted at this point (If you did everything correctly) to see a Command Prompt. You should be getting random resource string errors when you try typing DIR, etc and this is due to the fact that we don't have the mui string in the correct place. Let's fix that.
ONE BIG THING TO NOTE: running CMD in SSH is very sensitive to keystrokes. If you are typing a command and press backspace even once, then the command won't send at all. It will state that it doesn't recognize what you're doing, so be sure to type these things in FLAWLESSLY (yeah it's annoying)
What we want to do now is then copy the cmd.exe to C:\Windows\System32 and the cmd.exe.mui to C:\Windows\System32\en-US. Run the following commands:
copy c:\Data\Users\Public\cmd.exe c:\Windows\System32
copy c:\Data\Users\Public\cmd.exe.mui c:\Windows\System32\en-US
Back on your phone, go back to Interop Tools and click on the Registry Editor. Follow the same exact steps as you did for changing the default-shell key, but make one change:
Registry Value Data: C:\Windows\system32\cmd.exe
At this point, restart your putty session and then you'll be good to go with CMD running over SSH as SYSTEM!
Extra:
There was a reason I said to copy off the system32 folder somewhere... If you follow the same process to get the files to your Documents folder and move them over to system32, you can have quite a bit of exes to run from the command line. The easiest thing to do is to use xcopy to get everything there.
Extra #2:
You can run .NET Console apps in CMD if they are named the following 3 names: TailoredDeploy.exe, WConnectAgent.exe or WConnectAgentLauncher.exe.
Make a directory on your SD Card named "test" or put it in the test directory on your phone's C: drive and it should go. Beware that the runtime is weird on the phone and not ALL things are possible to do with a .NET Console app
PLEASE... For the love of god DO NOT add DefApps to the Administrators group if you don't want all of your apps to stop working
Have fun ^_^
Also...
USE THIS AT YOUR OWN RISK! I AM NOT RESPONSIBLE IF YOU BLOW UP YOUR PHONE ON PURPOSE OR BY ACCIDENT

Hi, snickler! Can I have your permission to repost your tut? It's great and I wanna share with everyone since everyone's really hoping for a full fs access. Of course, i will link your post and add you and the others to the disclaimer.

OH My god . very good so fast . forget MTP Full FS for ever

ngame said:
OH My god . very good so fast . forget MTP Full FS for ever
Click to expand...
Click to collapse
"Theoretical Full FS"

I've tried, but failed
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

@zetvn, did you follow ALL steps? Make sure Device Discovery is on and that your phone's WiFi is on. That message basically means you have a timeout. Also check your IP address and see if it is the correct WiFi address

ADeltaX said:
"Theoretical Full FS"
Click to expand...
Click to collapse
It's full access until you want to modify any of the IMPORTANT files in the AOW directory lol. I'll see how I can get around that and post more, but yes this IS indeed full access.

snickler said:
It's full access until you want to modify any of the IMPORTANT files in the AOW directory lol. I'll see how I can get around that and post more, but yes this IS indeed full access.
Click to expand...
Click to collapse
I was replying about MTP, not about SSH access. lol

. Have you gotten any closer to rooting AOW @ADeltaX?

Is there any way to copy files to C:\Windows\Fonts in the phone without the PC?

snickler said:
. Have you gotten any closer to rooting AOW @ADeltaX?
Click to expand...
Click to collapse
70% yes.
Adb shell is now as root user.
SU binary works fine.
Busybox too.
Superuser app seems to work too.
BUT
Apps can't reference from superuser app because of limit of project astoria caused by some modified libs. (stderr stdout = null)
SU binary refernce from libc.so and it's also modified....

ADeltaX said:
70% yes.
Adb shell is now as root user.
SU binary works fine.
Busybox too.
Superuser app seems to work too.
BUT
Apps can't reference from superuser app because of limit of project astoria caused by some modified libs. (stderr stdout = null)
SU binary refernce from libc.so and it's also modified....
Click to expand...
Click to collapse
Brilliant! Is it on your thread yet? If so, point me to it

snickler said:
Brilliant! Is it on your thread yet? If so, point me to it
Click to expand...
Click to collapse
Not yet, I need to upload these files and create a new thread.
I have a very slow connection, so probably will be ready within 2-4 hours :\
I'll mention you if i'll open the thread/the file is ready.

ADeltaX said:
Not yet, I need to upload these files and create a new thread.
I have a very slow connection, so probably will be ready within 2-4 hours :\
I'll mention you if i'll open the thread/the file is ready.
Click to expand...
Click to collapse
Awesome! Yeah, definitely make a new thread for this. BTW, I updated my OP to include a reg key change to enable WiFi under lock screen. It may not be useful for everyone connecting via USB, but for those on IP it will be VERY helpful

guys please answer: Is there a way to copy files to fonts folder from the phone without using PC?

MrMHK said:
guys please answer: Is there a way to copy files to fonts folder from the phone without using PC?
Click to expand...
Click to collapse
Look at Djamol's Root Tool. There's utilities in there that you should be able to move files with.

Time to play... Thanks for this!

Invite me too
ADeltaX said:
Not yet, I need to upload these files and create a new thread.
I have a very slow connection, so probably will be ready within 2-4 hours :\
I'll mention you if i'll open the thread/the file is ready.
Click to expand...
Click to collapse
Invite me too plz, I want to learn much & much again...

Lost...
Hey there i am following the instructions as written, went to install the vcREG bootstrap and the instructions they give is to apply it to the reinstalled Extras+Info app on the SD card. well when i try to download it it says the app is no longer available? is there a work around?

AteBitDesigns said:
Hey there i am following the instructions as written, went to install the vcREG bootstrap and the instructions they give is to apply it to the reinstalled Extras+Info app on the SD card. well when i try to download it it says the app is no longer available? is there a work around?
Click to expand...
Click to collapse
You didn't follow instructions. It states to use Djamol's root tool and use the Lumia Registry Editor within it that is vcReg's.

Related

built in htc [FM TRANSMITTER] dev needed.

this is an older tutorial i found for the evo way back. it needs to be updated..
this could possibly work on other android htc phones to that have the fm transmit capability....
the evos Broadcom chip has a built in fm receiver and also a transmitter.
according to some threads and diagrams ive seen the transmitter does have a power source, it just doesnt have and software code to actually work.
like hdmi the hardware was there but there was no code set up, therefore we didnt have full hdmi out. it had to be built from scratch.
the hardware for the fm transmitter is there we just need some one to build the code for it.
some one please take this on!!
This tutorial was originally posted in > android development and hacking > android software development.
i am reposting it here in the evo forums for guidelines
its a nice tutorial but its old. i think it was for android 2.0 ive followed the tutorial but i couldnt get it working, and i by no means have the experience to switch things up and get it working.
[TUTORIAL] Reverse engineering HTC FM Radio for noobs (on EVO 4G)
Okay, I'm writing this because I want to help any other newbies trying to learn how to reverse engineer. The technical details involved in this are extremely daunting, so the purpose of this tutorial is to first explain in layman terms exactly what you're trying to accomplish and what to expect. Then we'll go over the details. That way you're not completely blind going into this. I'm fairly new to the scene, so I'm not as knowledgeable as everyone else. If you see any errors in my post, let me know so I can change. I'm going to assume you know a little bit of Java, can find your way around a computer, and know nothing about Android. The techniques used should work with other Android phones. For this tutorial I'm using Windows 7, Cygwin, and my stock (not rooted) EVO 4G mobile phone.
The FM tuner for the Evo is run by a Broadcom chip: BCM4329. This chip is pretty amazing in that it does wireless, bluetooth, and it has an FM receiver/transmitter. We're interested in the FM receiver / transmitter.
Now, all android phones are based on a Linux kernel. Basically they're Linux running computers. The Android operating system is then installed onto the linux system. Every app is then run off of Android.
Android is based on Java but it is not a Java system. It uses a virtual machine called Dalvik. Google did this to get around licensing issues with Sun Microsystems. So they pretty much invented their own machine language (called byte code) for the Java language. This makes things complicated for the reverse engineer because from what I've read, once Java is converted into this machine language or byte code, it can't be converted back.
So let's rehash.
If you were programming strictly in Java, you would see these extensions:
Java source code = .java
Compiled Java source code = Java byte code = .class
Compressed file to package your program = .jar (Java Archive)
But since you're programming in Android and Dalvik, you will see these:
Java source code = .java
Compiled Java source code = Dalvik byte code = .dex
Compressed file to package your program = .apk
(I haven't mentioned this, but HTC further Optimizes their .dex code)
Optimized Dalvik byte code = .odex
I'm writing all of these down because it's very easy to get confused with all of the extensions. (for me at least!). remember how I said once you go dex, you can't go back to java? That's where JesusFreke comes in. He's a senior member of XDA, and he created "baksmali" and "smali", two programs that can convert the Dalvik code back into a human readable format. These files have extensions of .smali
Decompiled Dalvik byte code = .smali
But what can you do with .smali files? That's where this other senior member, brut.all comes in: He developed apktool. apktool takes JesusFreke's work to the next level. This program in conjunction with NetBeans, actually lets you trace through any program using the .smali code taken from JesusFreke's programs!
apktool does this by converting those .smali files into "fake" .java files that can be used by the NetBeans (program that compiles and makes java programs) IDE. I say "fake" because apktool embeds the .smali code into java files as comments. However, once you attach a debugger to NetBeans, you'll see that the debugger will follow line by line every execution statement found in the smali code!
So...... you can take the program you want, plug it into Net Beans using a debugger (using the default ddms command provided by Android SDK), and you can trace everything you do in the program. I have it connected to my phone, so whenever I push a button while running my HTC FMRadio app or unplug my headphones,I see the corresponding response to the HTCFMRadio code I have loaded in NetBeans. I can now see in real-time how the program operates from my own interactions... JAM.
Technical Aspects: How to get from ground zero to tracing HTCFMRadio?
1.) Download Android SDK - Go to google development site and follow instructions: Make sure to download the latest Java JDK. Once that is installed, download NetBeans 6.8. Unfortunately, smali debugging does not work with the lastest versions of NetBeans.
Download the "Java SE" version for minimal space
http://netbeans.org/downloads/6.8/index.html
You can follow the rest of Google walkthrough and download Eclipse and ADT plugin, but it's not pertinent to this. You're going to be using adb and ddms from the android SDK extensively, so make sure the path for </android SDK/tools> is included in the PATH variable in your ENVIRONMENT SETTINGS. To get here, right click My computer, click properties, Advanced Settings, ENVIRONMENT SETTINGS.
2.) Search for 7z and download it. It is an awesome and free compression tool that will be extremely useful. It can be used to "unzip" .jar, .apk, and other compressed formats.
3.) Get the Radio app. You can do this by going to "shipped-roms" website, downloading the latest Supersonic image, and following the directions in the unlockr tutorial for HTC kitchens at the unlockr website... (once you have extracted the files from the image, you can look in the system/app and system/framework directories to get the files listed below) or:
you can pull the following files from your phone:
Using the command prompt type (and with phone plugged in, and with USB debugging enabled on phone):
adb pull /system/app/HtcFMRadio.odex
adb pull /system/app/HtcFMRadio.apk
adb pull /system/framework ./framework
This will put HtcFMRadio.odex and HtcFMRadio.apk in the current directory and create a framework directory with more files. A couple of the files in the framework are needed for the HtcFMRadio app, but for simplicity, we're just going to pull the whole directory.
Now that we have the files, we have to make a few changes to make the app installable and to be viewable by the debugger. To do this we have to decompile the .odex format into a human readable format we can edit. That brings us to:
3.) Download baksmali and smali from Project Hosting on Google Code (google search smali).
Usually an Android application is made up of one file, an apk file. Inside the apk file is an AndroidManifest.xml file, a classes.dex file (compiled Java code for the program), and other folders. The other folders contain either graphics or other .xml files that tell the program how it should look to the user. We don't have to worry about those for now. This is important because APKTOOL only opens programs set up this way. But wait up? We didn't download one .apk file, we downloaded an .apk file and an .odex file! What gives? Well, if you right click the apk file and open it (using 7z), you'll see that it's missing the classes.dex file. The dex file for the app is actually the HtcFMRadio.odex file we downloaded. So, to make this system app more like a nominal app, we have to find a way to convert the HtcFMRadio.odex to a classes.dex file. That's easy with baksmali and smali!
Once you download goto command prompt and type:
java -jar baksmali-<version>.jar -d framework -x HtcFMRadio.odex
(Remember to match baksmali-<version>.jar with the filename of baksmali you downloaded)
If done correctly, you should see a newly created \out directory
This creates an out\com\htc\fm directory with many .smali files.
Now let's reverse the process and put it back as a dex file. Type at command prompt:
java -jar smali-<version>.jar out -o classes.dex
If done correctly you'll see a newly created classes.dex.
now, right click on HtcFMRadio.apk (select 7z and open). Drag classes.dex into the file. Say yes to the prompt. Now you have a normal apk file APKTOOL can read!
4.) Download APKTOOL from Project Hosting on Google Code and the helper apps for your OS. (If you're extracting files for windows OS you should have apktool.bat and aapt.exe). Extract (again using 7z, don't you love this program?) apktool.jar (keep it as a jar file, don't extract the stuff inside of it), apktool.bat, and aapt.exe to the directory you're working on. To make things neat, you can also delete HtcFMRadio.odex (you don't need it anymore) and classes.dex (make sure you put it in the HtcFMRadio.apk file first!)
If this is the first time you're using apktool, then you have to install the htc framework so apktool can baksmali the Radio app. You only have to do this once:
apktool if ./framework/com.htc.resources.apk
Alright, at the command prompt:
apktool d -d HtcFMRadio.apk
This extracts the contents of HtcFMRadio.apk and places them in the HtcFMRadio directory. However, there are two major differences between this content and the content created in step 3. If you go into the smali directory you'll see that instead of .smali files, you'll see .java files. And if you go back and edit the AndroidManifest.xml file, you will also see that it's in text! Android applications convert their xml files to binary format. Now that APKTOOL has converted everything to an IDE friendly format, we can use NetBeans to edit everything. The first thing we're going to do is edit AndroidManifest.xml (using notepad) and add the following:
android:debuggable="true" to the Application tag.
IT should now look like this:
<application android:theme="@android:style/Theme.Black.NoTitleBar" android:label="@string/fm_app_name" android:icon="@drawable/fm_radio" android:taskAffinity="android.task.fmradio" android:description="@string/htc_corp" android:allowTaskReparenting="true" android:debuggable="true">
This permission lets the debugger watch the program while it's running on the phone.
We are going to run into two problems if we try to install this program. One is that Android doesn't let you install more than one copy of a system app. The second issue is that if we change the signature of our system app, then we'll have to change the signatures of our other system apps as well! Ahh.... So, to get around that, we're going to trick Android into thinking we have a completely new program. We're going to do that by renaming the com.htc.fm class to com.htc.modradio class. Next step:
5.) Cygwin (or Linux virtual machine)
The easiest way that I can think of to replace strings in multiple files is by using linux. You can most definitely do it in WIndows, but I dont know how. If you let me know how, I can put it in this tutorial.
(update: you can use Notepad++ to easily find/replace strings in multiple files for Windows. You still, however, want to download Cygwin if you're going to develop with Android-NDK.)
For now, just search for Cygwin (Cygwin is a program that lets you run Linux commands from a command prompt using your Windows directories), and install it. Make sure to have the Perl option selected. You'll need Perl to make the following commands work.
Once you get Cygwin up and running
cd <to your HtcFMRadio directory>
in my case it's
cd /cygdrive/c/Users/Jerry/Desktop/HtcFMRadio
now type the following commands in this order:
this command changes all occurances of htc/fm to htc/modradio in your xml and .java files.
find ./ -type f | xargs perl -pi -e 's/htc\/fm/htc\/modradio/g'
this command changes all occurances of htc.fm to htc.modradio
find ./ -type f | xargs perl -pi -e 's/htc.fm/htc.modradio/g'
If you don't follow this order, your source code will get messed up.
If using cygwin, a bunch of .bak files will be created. Using windows search, find all .bak files in your HtcFMRadio directory, then select them all and delete them (Make sure they are only files with .bak!)
Now just rename the fm directory to modradio. It is located in HtcFMRadio/smali/com/htc
Now go to your windows command prompt and type:
apktool b -d .\HtcFMRadio modradio.apk
Now sign and install modradio.apk on your phone.
adb install modradio.apk
If you have never signed before, then you need to use keytool and jarsigner. These two files are in your JDK directory, so make sure you include your JDK directory in the PATH variable of your ENVIRONMENT SETTINGS. (To get here, right click on My Computer, click Properties, Advanced Settings, Environment Variables. Once you make change, open up a new COMMAND prompt to see changes).
cd to the directory which has modradio.apk
now type:
keytool -genkeypair
Answer all questions, then use the same password for all password prompts.
Next type:
jarsigner -verbose modradio.apk mykey
Type in the password you created in the above step. Your apk should now be signed.
Next install:
adb install modradio.apk
Success!
6.) Testing the app on phone
Go to your phone and you'll now see a new FMRadio icon next to your first. Click on it and watch it open. It should now be able to play music. Keep it open.
7.) Using Netbeans
Go into HtcFMRadio and delete the build directory created by APKTOOL.
Now open up Net Beans and click on File, New Project, Select Java Project with Existing Sources, click on Next
Select HtcFMRadio directory for Project Folder, rename Project Name to whatever you want. Let's type in ModRadio. click on Next
Next to "Source Package Folders" click on "Add Folder" and select the smali directory.
Click Finish. For a quick tutorial by Brut.all, search APKTOOL in youtube and click on: Apktool Demo 2 - Smali improvements
Right click on Libraries. Click on "Add Jar / Folder". You want to add Android.Jar. Since I have Android 2.1 loaded I went to /platforms/android-7 located in my android SDK directory.
Your project is now ready for editting!
8.) Running the Debugger to trace through program.
Next go back to Windows command prompt and type ddms. This runs the Dalvik Debug Monitor. A window should open up. In the left hand side you should see com.htc.modradio. That's our app! To the right you're going to see 2 numbers, you're interested in the one to the right, 4 cells away from com.htc.modradio. This number is a port number, and you're going to use it to communicate with NetBeans. (In my case it is 8603)
Go back to NetBeans and click on Debug, Attach Debugger.
In the host field type: localhost
In the Port field: type in the second number you saw. (8603)
If everything is working you'll see a bug appear next to com.htc.modradio in the Dalvik Debug Monitor. Look at the bottom bar of NetBeans for feedback. If you get errors make sure the numbers match, or try port 8700 and make sure you select com.htc.modradio in the Dalvik Debug Monitor. Port 8700 is the default port used for whatever program you select in Dalvik Debug Monitor.
9.) Setting a breakpoint
I'm making this a seperate step because it is completely arbitrary. When creating a break point be sure to follow this rule:
You must select line with some instruction, you can't set breakpoint on lines starting with ".", ":" or "#".
Rather than looking for a spot to breakpoint, though, I'll tell you where to put one so you can quickly see how the debugger traces through the code. You aren't "REQUIRED" to do the next step, but if you want to trace you have to put a breakpoint somewhere.
In Net Beans click on the Project tab, click on Source Packages, com.htc.modradio, and then doubleclick on BroadcomFMTuner.java
We're going to insert a breakpoint. Scroll down to line 3226 and on your keyboard press: CTRL-SHIFT-F8, select line in dropdown box and hit ok. (To keep it simple, I usually look for "invoke" instructions to set breakpoints at)
Now go to your phone and click on the physical "back" button on your phone. This will clear the radio,(you should still be able to listen to music). Drag your status bar down. You should see a radio icon. Click on it again. The radio backgroudn will appear, but you wont' see any text or anything. Now go back to your netbeans application. You should now see debug options highlighted! Click on Step Over (F8) to step through!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
i found a few things.
http://pdf.eccn.com/pdfs/Datasheets/Broadcom/BCM4329.pdf
http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM4329
Mad tutorial man! You have just opened up my world even more to Android. Thank you heaps.
BTW your freakin signature got me good damn you! I thought someone had hacked my PC LOL
Any chance that this will work with JB?. Can you post app?. Thanks.

For everyone with provxml not applying changes

Hello xda-developers
I'm not really sure if it's already mentioned here on the forums, but today I found out that provxml-files which where written as .rgu and translated by "rgu-2-xml" don't work for Windows Phone 7. The output file is saved as ANSI file. After updating to Mango I tried a "Developer Unlock.xml" file but it didn't work. Well, all the procedure back and again but now with a UNICODE file After right-clicking the (ANSI) xml-file, "edit" and re-saving it as UNICODE file I noticed that the size of the file increased I tried the provxml-Method again and it worked! Not sure if I'm the only one with this solution and like I already said: not sure if it's already said here Please let me know if it helped you
you unlock your device on Mango build?
hd2leo_fusion said:
you unlock your device on Mango build?
Click to expand...
Click to collapse
The provxml method works on Mango as well.
Yes, I unlocked Mango But for me there are still some unanswered questions about provxml =/ Does a provxml file only work once on Omnia 7?
experience7 said:
Yes, I unlocked Mango But for me there are still some unanswered questions about provxml =/ Does a provxml file only work once on Omnia 7?
Click to expand...
Click to collapse
Ηow you will run provxml on omnia ...
I was under the impression that provxm works only with htc connection setup ...
And yes after the appl (connection setup) finish the 1rst run its deleting the provxml file.
You can also use it on Samsung devices Here is the thread where I found it: http://forum.xda-developers.com/showthread.php?t=1152422
Yes, with Connection Setup on HTC it will be deleted - but what about the GPRS Manager used for Samsung devices? After executing a command (xml-file) in the GPRS Manager, it's still there ^^ Even if I restart the app or the whole phone -> After opening the GPRS Manager again, all the entries seem to stay there
EDIT: Okay, tested it again and it seems like you can apply the xml's as often as you want with GPRS Manager I flashed a older ROM so my phone was on 7004 again I unlocked using ChevronWP7 and installed WP7 root tools. I created a file which switches the Internet Explorer's search provider to Google Well, after execution I first opened IE9, pressed search and yup.. google.com came up - then, just to be sure I opened WP7 root tools and took a look at the SearchScopes in registry. They were changed to Google, so the xml really worked. Then I manually wrote everything back to default. I opened the Internet Explorer, pressed the search button and Bing came up.. so everything's like before. I applied the "Google Search.xml" again and.. yes, it worked: Same effect like above: Registry was changed, IE9 search is now google.com
Well so at the end I can say that this is really useful for switches like in my example. I created several switches like "Enable instant resuming.xml", "Disable instant resuming.xml", "Enable lockscreen never option.xml", "Use Bing (default) search.xml", "Use Google search.xml", ... Wow, Mango with fast resuming apps is wonderful!
experience7
All of my rgu's that I've converted using xboxmods tool rgu2xml have worked just fine on my hd7.
It does kinda suck that HTC connection setup deletes the provxml everytime
Sent from my HD7 using XDA Windows Phone 7 App
Hm.. yes, maybe on HTC (with HTC connection setup) it's enough to convert them. On my Omnia 7 i had to open the provxml files, and resave them as UNICODE ".xml" files It's nice that GPRS Manager on Samsung devices doesn't delete the .xml files
Thank you for this! I was wondering why Connection Setup-applied ProvXML wasn't working. This will hopefully do it.
I've come up with a way to chain provxml files. I don't yet know if it works - it depends on how the deletion after processing the CustClear file is implemented - but it has the potential to allow you to store a "working copy" ProvXML file in My Documents as a txt file (which you can open and edit with Word), and then every time you use Connection Setup, it copies your "working copy" file to \Windows, renaming it as it does. This should make further modifications easier; just copy the XML from a website or app, paste it into Word, and run Connection Setup twice (once to copy your edited file, once to process it).
If it works, I'll post the file.
OK, I couldn't get the chaining to work. It's still in the file, just commented out, in case anybody else wants to experiment.
Oh, and I added some very convenient (if you deal with things like I do all day) registry tweaks. Open .LOG files as though they were .txt (great for attachments) and add an expansion for the , key similar to the one that the . key has.
THis really help me, That's the reason why my unlock.xml didn't worked in 7712 back then. I thought it was the 7712.
minori_aoi said:
THis really help me, That's the reason why my unlock.xml didn't worked in 7712 back then. I thought it was the 7712.
Click to expand...
Click to collapse
I'm trying to keep my HD7 unlock after updating to 7712 but the many times I tried, the Connection Setup will not run after 7712 update. If you can share the file and method with steps you used, that would be appreciated.
I don't know why your HTC connection setup didn't start after the update But maybe you did something wrong.. Okay, let's go through the steps together
Well, for Samsung devices you need a .xml file (GPRS connection manager handles with .xml files).
And on your HD7 you need an .provxml file (HTC connection setup handles with .provxml files).
Okay, first step is to be developer unlocked on NoDo - I think you are, right? [If you want to test it: Just try to sideload an app. If it works your phone is unlocked.. else it's not.]
Now uninstall HTC connection setup and install it again. Do not sideload any app found in the internet - just install the official app from the marketplace.
The next step is to get the right .provxml file. You don't need to do the following steps: I've already attached one which works. But just that you can follow me: Basically the file has to apply the following changes:
1) Developer unlock
Code:
[HKEY_LOCAL_MACHINE\Comm\Security\LVMod]
"DeveloperUnlockState"=dword:1
2) Prevent from relock
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]
"PortalUrlProd"=""
"PortalUrlInt"=""
3) Maximum sideloaded apps
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg\Install]
"MaxUnsignedApp"=dword:7fffffff
And to create a this file we need to open Notepad:
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\Comm\Security\LVMod]
"DeveloperUnlockState"=dword:1
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]
"PortalUrlProd"=""
"PortalUrlInt"=""
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg\Install]
"MaxUnsignedApp"=dword:7fffffff
Simply save this file as a .rgu file.
Then you need the tool "rgu-2-xml.exe" which converts the .rgu to a .provxml file. I've also attached this tool.
Okay, the generated file has now to be in the "Windows" directory of your phone. You can use the "WP7 mass storage" trick to get the file to your device - just search here on xda-developers. After you've copied the file to your device it will be stored in "\My Documents\Zune\Content\0400\...". Now you need a file explorer for HD7. I'm not sure if you're already using a tool but TouchXplorer should do the job. Open your tool on the phone and navigate to the folder above. There should be several folders.. just browse through them and look for a file which has got a short name and another file ending as our file (CustClear.provxml). Check the file size - it has to be the same on PC and your phone. If it's the same file rename it to "CustClear.provxml" again. Then move the file to the "Windows" folder on your HD7. The file has got the right name and is on the right place.. let's go on:
Now don't start the HTC connection setup!
Be sure to update to the highest build available at the moment. It's Mango v7720. There are tutorials here on xda-developers.com on how to update to v7720 Run HTC connection setup only if you can see that your phone is running v7720. You can see this under settings > about > more information.
Then you should be developer unlocked and sideloading apps should work again.
If anyone finds a mistake in those instructions please tell me! Thanks
And please tell me if it worked
Thanks for this but I don't need it now as as I had solved my problem.
After 7403 update, I uninstalled Connection Setup and re-installed again.
Nonetheless, I will PDF your instructions and download the 3 files to try out and learn this. Thank you very much for providing the detailed instructions. I'm sure it might be useful for some others.
experience7 said:
I don't know why your HTC connection setup didn't start after the update But maybe you did something wrong.. Okay, let's go through the steps together
Well, for Samsung devices you need a .xml file (GPRS connection manager handles with .xml files).
And on your HD7 you need an .provxml file (HTC connection setup handles with .provxml files).
Okay, first step is to be developer unlocked on NoDo - I think you are, right? [If you want to test it: Just try to sideload an app. If it works your phone is unlocked.. else it's not.]
Now uninstall HTC connection setup and install it again. Do not sideload any app found in the internet - just install the official app from the marketplace.
The next step is to get the right .provxml file. You don't need to do the following steps: I've already attached one which works. But just that you can follow me: Basically the file has to apply the following changes:
1) Developer unlock
Code:
[HKEY_LOCAL_MACHINE\Comm\Security\LVMod]
"DeveloperUnlockState"=dword:1
2) Prevent from relock
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]
"PortalUrlProd"=""
"PortalUrlInt"=""
3) Maximum sideloaded apps
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg\Install]
"MaxUnsignedApp"=dword:7fffffff
And to create a this file we need to open Notepad:
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\Comm\Security\LVMod]
"DeveloperUnlockState"=dword:1
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]
"PortalUrlProd"=""
"PortalUrlInt"=""
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg\Install]
"MaxUnsignedApp"=dword:7fffffff
Simply save this file as a .rgu file.
Then you need the tool "rgu-2-xml.exe" which converts the .rgu to a .provxml file. I've also attached this tool.
Okay, the generated file has now to be in the "Windows" directory of your phone. You can use the "WP7 mass storage" trick to get the file to your device - just search here on xda-developers. After you've copied the file to your device it will be stored in "\My Documents\Zune\Content\0400\...". Now you need a file explorer for HD7. I'm not sure if you're already using a tool but TouchXplorer should do the job. Open your tool on the phone and navigate to the folder above. There should be several folders.. just browse through them and look for a file which has got a short name and another file ending as our file (CustClear.provxml). Check the file size - it has to be the same on PC and your phone. If it's the same file rename it to "CustClear.provxml" again. Then move the file to the "Windows" folder on your HD7. The file has got the right name and is on the right place.. let's go on:
Now don't start the HTC connection setup!
Be sure to update to the highest build available at the moment. It's Mango v7720. There are tutorials here on xda-developers.com on how to update to v7720 Run HTC connection setup only if you can see that your phone is running v7720. You can see this under settings > about > more information.
Then you should be developer unlocked and sideloading apps should work again.
If anyone finds a mistake in those instructions please tell me! Thanks
And please tell me if it worked
Click to expand...
Click to collapse
Is it possible to enable a custom notification sound via a reg edit in the omnia 7 running 7720 chevron unlocked? Maybe someone can make a prov file and instructions...
Well, maybe it's possible but I'm not really sure what you mean But I'm aware of provxml's capabilities, how to build them and how to set up the phone, so maybe I can help you
Thanks... I read somewhere that with a registry key we can change the path of the notification sound... This way we dont need to overwrite the original .wav... I believe this might be the only way to do it in mango since homebrew is blocked...
Need to check the registry key thread for this one, since i dont really know much about this...
Dehydration Hack
I have used this method to unlock and remove the side load limit on my HD7 and it works great. I am unsure how to create a file to turn the dehydration hack on and then off again after I have updated all the way to 7720. I used the HTC Connection setup once I fully updated, I have touch explorer I just have no clue what to do for the dehydration can anybody help me?
On HTC devices you can't create a simple switch to enable / disable the dehydration hack because once you've ran the HTC connection setup the provxml files will be deleted. But if you don't want to switch that often between on / off you can use this tool:
http://forum.xda-developers.com/showthread.php?t=907971
You'll have to create two .rgu files:
First one contains this:
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\TaskHost]
"DehydrateOnPause"=dword:0
Second one contains this:
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\TaskHost]
"DehydrateOnPause"=dword:3
Then you have to convert them to .provxml files. Put the first one in a folder called "Enable dehydration hack" and the second one into a folder called "Disable dehydration hack". This way you can't mess it up
Then use the tool mentioned above to deploy the .provxml which contains the setting you want to have on your phone - then finally run the HTC connection setup
For example you've enabled the dehydration: To disable it again you have to put the CustClear.provxml from "Disable dehydration hack" into the XAP file from xboxmod and deploy this XAP to your device. Then run HTC connection setup again and the changes will be applied - Dehydration hack will be turned off
Please tell me if it worked for you / helped you,
experience7
experience7 said:
On HTC devices you can't create a simple switch to enable / disable the dehydration hack because once you've ran the HTC connection setup the provxml files will be deleted. But if you don't want to switch that often between on / off you can use this tool:
http://forum.xda-developers.com/showthread.php?t=907971
You'll have to create two .rgu files:
First one contains this:
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\TaskHost]
"DehydrateOnPause"=dword:0
Second one contains this:
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\TaskHost]
"DehydrateOnPause"=dword:3
Then you have to convert them to .provxml files. Put the first one in a folder called "Enable dehydration hack" and the second one into a folder called "Disable dehydration hack". This way you can't mess it up
Then use the tool mentioned above to deploy the .provxml which contains the setting you want to have on your phone - then finally run the HTC connection setup
For example you've enabled the dehydration: To disable it again you have to put the CustClear.provxml from "Disable dehydration hack" into the XAP file from xboxmod and deploy this XAP to your device. Then run HTC connection setup again and the changes will be applied - Dehydration hack will be turned off
Please tell me if it worked for you / helped you,
experience7
Click to expand...
Click to collapse
Should be
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\TaskHost]
"DehydrateOnPause"=dword:0

Windows imageres.dll being a PiTa: Modding

I've edited my imageres.dll file and have it all nice nice, but when I try to paste it into system 32 (tried safe mode) It will not let me overwrite that file.
I've tried Safe mode, Taking Control, Granting full control permissions of file, system32 folder, windows folder, and C folder (both taking control, and granting full permissions to: User (me) and Administrator (also me) Yes, i'm on windows 7 64bit but there is no Win 7 Forum here, however the imageres.dll is mentioned here, and I'm assuming the file is more-or-less the same. Besides taking ownership in C for Win 8 being bad? I did this to both System32 file and Syswow64 file- its now apparent to me that both are in USE and thats why I can't overwrite/modify them =/ So how do I use my modded one? (startup sound etc.)
Following this:
Code:
How to Take Ownership in Windows 7
1. Locate the file or folder on which you want to take ownership in windows explorer
2. Right click on file or folder and select “Properties” from Context Menu
3. Click on Security tab
4. Click on “Advance”
5. Now click on Owner tab in Advance Security Settings for User windows
6. Click on Edit Button and select user from given Change Owner to list if user or group is not in given list then click on other users or groups. Enter name of user/group and click ok.
7. Now select User/group and click apply and ok. (Check “Replace owner on sub containers and objects” if you have files and folder within selected folder)
8. Click ok when Windows Security Prompt is displayed
9. Now Owner name must have changed.
10. Now click Ok to exist from Properties windows
Once you have taken the ownership of file or folder next part comes is Granting Permissions to that file/folder or object.
How to Grant Permissions in Windows 7
1. Locate the file or folder on which you want to take ownership in windows explorer
2. Right click on file or folder and select “Properties” from Context Menu
3. Click on Edit button in Properties windows Click ok to confirm UAC elevation request.
4. Select user/group from permission windows or click add to add other user or group.
5. Now under Permission section check the rights which you want to grant i.e check “Full Control” under the “Allow” column to assign full access rights control permissions to Administrators group.
6. Click Ok for changes to take effect and click ok final ok to exit from Properties window.
Now you can access files of folder in windows 7 with full permissions and take full control.
also tried cmd prompt
Code:
takeown /F "C:\Windows\System32\imageres.dll"
with Sucess message (probably the same as my right click takeown reg file context thing)
I'm the only person/login/user on my PC. Ugh this is a pain in the butt. No matter what I've googled/tried hasn't worked. I don't have a linux CD/USB boot *(dunno if I do? but don't think I do) to repair/replace file, I may have Win 7 repair on my CD, maybe not.
EDIT: replacing the startup sound in imageres.dll in System32 and SysWOW64 folders still leaves me with default windows startup sound =( Only other file was imageres.dll in winsxs folder- copied, edited the copy, deleted the original with Fileassassin (it was locked, wouldn't edit, blah blah) STILL uses old windows start up sound, WHyyyyyy? theres MUI files with info for imageres.dll but IDK what's left where this sound exists =/ or where its coming from.
there used to be this program made for replacing system files
i don't remember its name, though
http://www.askvg.com/right-click-re...utility-to-replace-system-files-in-windows-7/
No manual methods worked for me, but just came across this and it worked, WOOT!
http://winaero.com/download.php?view.10
Starting with Windows 8, the administrator is no longer the same as root. Microsoft has very, VERY severely limited the administrator's abilities with many aspects of the system. This was done in an ill-conceived notion that they could curb piracy of Windows Store apps (like there's anything worth stealing in there, including games). People have already found a way to pirate Windows Store apps, so it was all just a way to irritate admins and hobbyists in the end.
@dragon_76: Care to explain what you mean by that? For one thing, Administrator on NT has never been "the same" as root (on POSIX); there's always been the local SYSTEM SID (which does some of the things which root would handle, such as being the process that drivers and initial user-space processes run as) and while I'm not entirely sure when the TrustedInstaller SID was added (may have been there since NT3.1 for all I know), it's been a part of Windows since well before Win8. For another thing, unlike root on a POSIX system, Administrator does not (and never has) automatically have access to everything; it's a SID like any other, and ACLs can be put in place to control its access.
Now, two powers that Administrator (and members of the Administrators group) do have are as follows:
1) Take ownership of any securable object (this allows completely overwriting the ACLs).
2) Impersonate any other SID (although some, like TrustedInstaller, are possibly trickier to impersonate in Win8 than they used to be; I need to investigate that).
If what you're complaining about is the fact that \Program Files\WindowsApps\ is now owned by TrustedInstaller and harder to mess with than you'd like, um... sorry? It's not *that* hard to take ownership (or set it back) from TrustedInstaller; you can do it as Admin, in fact.
*Ahem*
Back to *actually* being on-topic, older versions of Windows* had a background service that would undo any modifications to system files by replacing them with un-tampered copies from a backup location. Starting with Vista, such a service supposedly no longer exists, but it would be easy to implement something like it using VSS. So, you should verify that the file isn't being reverted. The simplest check is the modify timestamp and (if it's different on your file than on the stock one) the size. Somewhat more advanced is to use a hash function, such as MD5 or something from the SHA family, on the on-disc file and see whether it matches the version you put there.
Beyond that, you can easily replace system files if you do it while the OS isn't booted. Linux can do it, although that has risks. Better is to use WinPE (the Pre-installation Environment that bootable Windows disks and recovery tools load) and replace it from there.
Incidentally, you can use the command line tool icacls (which may even be present in WinPE by default) to both change ownership and set permissions on files and folders.
* Pre-Vista, which was the first version to switch to using TrustedInstaller to protect system files rather than letting Admin write to them by default. That's the last major change I'm aware of in the powers of the Administrator account on Windows, incidentally...

Xiaomi Mi Band data extraction, analytics and Google Fit sync tools

Current Version: Extraction Tool v5.92, Analytics Tool v5.60, iOS Extraction Tool v0.2, Fit Sync Tool v0.2 (Updated 6/20/2015)
Here is a tool I wrote for Xiaomi Mi band which provides following functionality:
1. Exports data from Xiaomi Mi band on both rooted and non-rooted Android phones and jailbroken (and possibly non-jailbroken) iPhones under Windows and Linux, generating file in CSV format which can be reviewed in Excel.
Bonoboo maintains a script to perform extraction directly on your smartphone (see link in post 3).
2. Extracts detailed (per minute) walking and running information from Mi Band database (thanks to the input provided by mritsch and Osid).
3. Produces files that can be uploaded to fitnesssyncer.com/ to syncronize data with various fitness services: FitBit/HealthVault/RunKeeper/JawBone and soon Google Fit! See 3rd post for details on data mapping for fitnesssyncer.
4. Provides multiple analytics reports to review extracted data. These reports can be shared on cloud drives to be accessed from anywhere (see post 3 for details)
5. Supports localized UI (currently supported languages are English, Russian, French, Spanish and Italian)
6. Support for synchronization data with Google Fit Service - see post #2 for details
How to use:
Preparation steps:
1. If you plan to use multiple packages, unpack them all to same directory.
1a. If you want to extract data from smartphone, download miband_extract package. To extract data from iOS devices, see to "To extract data from iOS devices" step.
1b. If you want to display local charts of your extracted data on your computer, download miband_analytics package.
1c. If you want to synchronize your extracted data with Google Fit, download miband_fit package.
2. Make sure you have USB drivers for your device properly installed and that your device is accessible by ADB when you connect it through USB
3. If you use it on windows, extract package has all binaries included, for Linux/OSX see comments below.
Checking configuration settings:
1. Review SDPath parameter value in run.bat/run.sh. The program will copy files from Mi app location to folder specified in SDPath before pulling them to desktop. In most cases default value (/sdcard) shoud work fine, however if your phone does not have this directory, find the path where your Internal/External SD is mounted and put that path string into SDPath value. Second most common value might be /storage/sdcard0
2. Review config.js and make any changes to your liking (set Goals for sleep hours and daily steps, force override UI language to specific value)
3. If you do not want main report being open every time you run extract, change OpenHTML=Y in run.bat/run.sh to OpenHTML=N
4. If your device is not rooted or have any issues with first (root) method that application uses and prefer to skip straight to the second (backup) method, set ForceBackupMode value to Y in run.bat.
5. If you want to generate Raw data extract in addition to summary data, set ExtractRaw parameter to Y, update Height parameter to your height in centimeters and update Weight parameter to your weight in kilograms. Please note that data extracted from raw blobs may be slightly different from total numbers in summary data.
If you are planning to use ADB over Wifi:
0. I would not be able to provide much support for ADB over Wifi - so many things could go wrong. Check you firewall settings, check TCPIP ports on both ends, but you are basically on your own.
1. If you are planning to use ADB over WiFi, edit run.sh and set up IPAddr value to IP address of your phone, if you use USB cable, leave IPAddr value blank. If you using non-default port, you may need to change TCPPort value.
2.You may also think of a great idea of running syncronization automatically and unattended using ADB over Wifi - at least I liked that idea initially. I gave that idea more thought and as of now I strongly recommend not to do it - having ADB running over Wifi is a security risk, if you have to use it over Wifi, enable it manually, run the sync and disable ADB over Wifi right away.
For Linux/OSX users:
1. You would need to to manually install android-sdk for (adb binary), sqlite3 version 3.8.3 or higher and openssl with zlib support (version 1.0.2 or higher with zlib support is recommended) to uncompress zlib data. Please note that versions of sqlite3 and openssl that are preinstalled on your machine might be too old to be used with this package, so you might need to obtain newer versions. For example, I was told that OSX has sqlite3 version 3.7.13 preinstalled and it is incompatible with some of functions used in script, so you would need version 3.8.3 at least. If you cannot get openssl with zlib support, you can use similar functionality from python instead - you will need to comment out a line with openssl zlib in run.sh and uncomment next line instead which invokes python script.
2. You'll need to grant execute permissions to run.sh by using chmod +x run.sh and you will need to execute run.sh instead of run.bat in steps listed below. You'll also need to make configuration changes in run.sh instead of run.bat
3. Check that your sqlite3 is properly configured for your time zone. Run following command and see if it returns correct timestamp:
bin\sqlite3 dbfile "select datetime('now','localtime');"
Running application:
1. Connect phone through USB and make sure USB debugging setting is enabled on your phone. Unlock phone screen.
2. Execute run.bat - if your phone is rooted, the data would be pulled automatically. If your phone is not rooted you would see backup screen and you need to press "Back up my data" button in the bottom left corner.
3. Data from your mi band will be saved to extract.csv file and extract.js. After extraction is complete, if OpenHTML is set to Y, mi_data.html will be opened automatically to show charts for your Mi usage.
4. HTML reports are using Google Charts framework and Google TOS does not allow storing their scripts offline along with the application, therefore you will need to have working internet access for reports to work. Your data is not being sent to Google, the internet connection is only used to download latest version of Google Charts javascripts.
Troubleshooting connectivity issues:
1. If you phone is rooted:
Review that your phone has /sdcard directory and it is writable. After you run extract, check if you have origin_db file in that directory. If you do not, ADB may have issues writing files to that directory. Check configuration settings section, item 1
2. If your phone is not rooted or if you use ForceBackupMode=Y:
Check if you get full backup screen, which looks like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If you do not get this screen, then Android backup functionality on your device is broken. If your phone is rooted, consider setting ForceBackupMode=N and using rooted method; if your phone is not rooted, try to run Helium Backup https://play.google.com/store/apps/details?id=com.koushikdutta.backup and see if it can backup MI app to sdcard.
To extract data from iOS devices:
Thanks to joshmosh for detailed instructions.
This is reported to work on jailbroken iPhone, but may work on regular iPhones as well - if you try it on non-jailbroken iPhone please let me know if it worked for you.
1. Get a copy of itools. Google it to find a download location (cnet might have it)
2. Plug in your iPhone to your PC
3. Open itools and click on Applications in top row
4. On the left you will find name of your iPhone and below "Applications". Click on Applications
5. Locate your application Mi Fit and click it. On the right you will find a button labelled "browse". Click it.
6. A window will open. Doubleclick on "Documents" then click on user.sqlite, then on "Export" above.
7. A window will open asking you where to export this file. Export it to a db subdirectory of miband extractor main directory and click OK. You should have a file db\user.sqlite now.
8. Once file is extracted to db\ directory, run runIOS.bat from main miband extractor directory. It should generate extract.js, extract.csv and minmaxtime.csv files and will open local charts in your browser if you have analytics package installed.
Screenshots:
Report descriptions:
mi_data.html:
This report shows overview of the data being extracted. It consists of 3 elements:
a. The chart on the left shows sleep data over time. Total bar height represents overall sleep time and colored segments represent light and deep sleep parts of it.
b. The chart on the right shows daily activity metrics over time. It shows total distance, number of steps and calories burned.
c. The chart on the bottom shows all data inside text table. You can sort the data by any column by clicking on the title of that column. If you select any specific row in the table, same day will be hightlighted in two other charts.
Both graphic charts also show target goals in green line, so you could see how well your results are matching target values. You can dynamically change target values by pressing + and - buttons. The table below has arrows next to Total Sleep and Total Steps columns which would be green for days when goal was met and red for days when goal was not achieved.
mi_data_byDoW.html:
This report allows you to see the scatter of your activities grouped by the day of the week.
This would be a good chart to see if you are performing better on any specific day of the week.
There are 4 charts on that report:
a. The left chart shows various metrics in scatter chart. You can select a specific metric from the dropdown located above the chart. You can also see a daily goal trendline in green and an approximation line in black. If the approximation line is not flat and you have statistics over many weeks, this might mean that your performance is consistently different depending on the day of the week.
b. The right chart shows line chart data for the metric selected in the left chart. It has time zoom controls at the top to only show the data over last day, last 5 days, 1 week, 1 month, 3 months, 6 months and 1 year. You can also select time interval manually by dragging time sliders at the bottom of the chart.
c. The chart at the bottom is a calendar view for your activity-related metrics. It shows a calendar and each days recorded activity is colored based on whether the value for that activity is above or below the goal. The days that have metric value below daily goal will be colored red, the days with metric value above the goal will be colored blue. The higher the deviation from the goal, the more intense color would be. In other words, the days where results are significantly above the goal would be colored in saturated blue and the days where results are significantly below the goal would be colored in saturated red.
This chart could help searching for more complicated patterns in your performance, patterns that are not just days of the week.
You can also change goal values dynamically by using + and - buttons at the top and see green trendline moving on the left chart and days changing colors on the bottom chart.
d. The last chart shows a timeline of your sleep on a daily level. This chart will only be visible if you select "Sleep Timeline" metric from the dropbox. This chart shows the time you went to sleep and the time you woke up. It shows this information for each day the history data is available and weekends are colored in a different color. This chart could help you to see how consistent your sleep/wake hours across different days and also if you have same sleeping patterns on weekends.
Google Fit Syncronization:
Limitations:
1. Daily summary statistics is synced, so charts by Week and Month will show correct data; chart by day will show correct totals, but not correct hourly breakdown.
Prerequisites:
1. You need to have at least version 5.71 of miband_extract package.
2. You will need to have Internet access and your browser should be configured to enable pop-ups at least from a specific domain below.
3. You need to open following URL: Get Fit Token and allow it to access your Google Fit data. Latest version of Chrome worked for me, while IE 11 had issues with popups.
Installation:
1. Download latest version of meband_fit package and unpack it to the directory where you have miband_extract v5.71 or above.
2. If you upgrade from previous version of fit sync package, you will need to clean up old data populated by old version. To do so run following command:
fit clean
Running Sync:
1. Synchronize your data from smartphone to desktop.
2. Obtain a new OATH key for syncing data with Fit - open Get Fit Token and copy resulting string to your clipboard.
3. Run fit.bat and when asked for new token paste the string from previous step and press enter. If fit.bat did not ask you for token and failed with Authentication error, just run it again.
Troubleshooting:
1. The process is logging into fit\*.log files. If you have errors, review these logs first.
2. The token from step 2 is valid for 1 hour - you will need to refresh the token after that. After 1 hour subsequent fit syncs will start failing until you obtain a new token.
3. Current token is cached in GKey environment variable. Once batch determines that old token is expired, it would clean the variable and will ask you for a new key on a subsequent run.
Related links:
Latest version of Bonoboo port for smartphone extraction.
Known Issues:
1. Vertical axis is not always in sync for two charts in mi_data_byDoW.html
2. Timeline axis is only shown at the bottom of timeline
Version History:
Code:
[B]v5.92 06/20/2015[/B]
Added support for Mi Scale - extracting weight history into weight.csv
[B]v5.90 03/14/2015[/B]
Walking and Running statistics with minute granularity are now extracted from Raw data thanks to the input provided by mritsch and Osid.
[B]v5.80 03/07/2015[/B]
Google Fit sync package 0.3:
Fixed error in 1324438.json file which prevented Fit Sync for some users.
Added FitTools.bat which allows pulling various information from Google Fit account.
[B]v5.80 03/01/2015[/B]
Extraction package:
Added experimental support for raw data extraction. To enable raw data extraction, set ExtractRaw=Y in run.bat
Analytics package:
German localization added to analytics package (thanks to joshmosh)
default app_locale.js file is added to analytics package to support data extracted from iOS devices.
Data Extraction Tool v0.1 for iOS is added along with instructions on how to manually extract Mi Band data from iPhone
[B]v5.71 02/16/2015[/B]
Extraction package:
Extra fields added to extract.csv to support for Google Fit sync v0.2.
extract.json is not created anymore, this data is now calculated on the fly from extract.csv
Google Fit sync package 0.2:
Added sync for activity durations (walk duration, run duration, sleep duration)
Added sync for distance walked. Since distance metric is considered location, Token application will request new permission:
https://www.googleapis.com/auth/fitness.location.write
Fixed activity timestamps - Google Fit expects time to be in UTC time zone.
[B]v5.70 02/16/2015[/B]
Extraction package:
Initial support for Google Fit sync.
Google Fit package 0.1:
Initial release
[B]v5.50 02/05/2015[/B]
Extraction package:
Added new columns to CSV file for better FitnessSyncer compatibility.
Added support for time correction. See db\offset.sql for sample entries.
Updated run.sh from [URL="http://forum.xda-developers.com/member.php?u=6091617"]jlaunay[/URL] to support new run.bat parameters and localization.
Analytics package:
Changed mi_data_byDoW.html to use AnnotationChart for right graph - support for time interval zooming.
Added new metric to mi_data_byDoW.html called "SleepTimeline" to show Sleep Timeline chart.
Various small fixes.
[B]v5.35 02/03/2015[/B]
Extraction package:
Fixed logging issue - adb would sometimes lock the log files and subsequent extraction invocations would fail completely on locked log files.
Added support for ADB over Wifi - see instructions in the first post.
Analytics package:
Fixed sorting order on main table
Second fix for incorrect sleep/wake hours calculation
Updated colors across all reports to be consistent
Converted total/deep/light sleep from minutes to hours and minutes in the main table. Show percentages of deep/light sleep compared to total sleep.
Add fall asleep and wake up times as selecrable metrics to mi_data_byDoW.html
mi_data_byDoW.html absorbed all functionality from mi_data_Sleep.html - the sleep calendar functionality and sleep timeline is available when you select Total Sleep metric. You will need to scroll down to see sleep timeline chart.
[B]v5.3 02/02/2015[/B]
Extraction package:
Add new column with number of walk time + run time in seconds (as per request)
Added new parameter ForceBackupMode to skip attempt at rooted extraction and go straight for backup mode
[B]v5.2 02/1/2015[/B]
Splitted program into data extract package and analytics packages. Data extract should be pretty stable now and reports could be updated independently.
Spanish translation (thanks to Viriatox)
[B]v5.1 01/31/2015 [/B]
Fix for incorrect sleep/wake hours calculation
[B]v5.0 01/31/2015[/B]
Localization setting is pulled from Mi database - no need to set it manually anymore (in most cases)
Two completely new reports - Sleep Report and Statistics by day of the week.
Fixes to unix shell script encoding.
[B]v4.0 01/29/2015[/B]
Month number calculation fixed.
Removed extra rows with zeroes that we incorrectly extracted
Localization moved to separate file, all other components are unified for all languages
Scripts for rooted and non-rooted phones combined into one.
Daily goals and data grouping added on main report.
Unix shell script for data extraction (thanks to jlaunay)
French translation (thanks to jlaunay)
[B]v3.0 01/26/2015[/B]
New script to support data extraction for non-rooted phones
Reverse sort order in table part of report, so newest dates are on top.
Week number and day of the week added to report.
[B]v2.0 01/25/2015 [/B]
All needed Windows binaries included in the package.
Batch file to automatically run all binaries to extract the data.
First report showing overall statistics.
[B]v1 01/24/2015[/B]
Initial release.
Syncronizing with fitnesssyncer.com
FitnessSyncer FAQ: https://www.fitnesssyncer.com/frequently-asked-questions
How to set up import and export.
1. Open account at fitnesssyncer.com/
2. On Dashboard, go to Sources and Destinations and select Add New Source
3. Select Type: Activity, source Amazon S3 (CSB), Dropbox (CSV) or OneDrive (CSV) depending on where your files are stored. Enter path and file name in Path field. Select highlighted columns mappings:
Activity:
Include Date (US) - Column 18
Include Activity - Column 19
Include Distance in Meters - Column 8
Include Duration in Seconds - Column 17
Include Calories Burned - Column 10
Include Total Steps - Column 9
4. Click on Save and authenticate into your cloud storage account.
5. Back on Sources and Destinations account, click on Sync Now link next to your newly added connection to confirm that it loads without errors. Click on Dashboard button and confirm that you see some data in charts there.
6. Go back to Sources and Destinations and select Add New Source again
7. This time, select Type: Sleep, same Source entry, same Path value and set up highlighted column mappings:
Sleep:
Include Date (US) - Column 18
Include Bed Time Hour - Column 20
Include Bed Time minute - Column 21
Include Awake Hour - Column 22
Include Awake Minute - Column 23
Include Sleeping Minutes - Column 2
8. Click Save, go to Sources and Destinations and click Sync Now on Sleep source now to see that it imports without issues.
9. Click on Stream option and see that you have both Daily Activity and Sleep data loaded.
10. Go back to Sources and Destinations and select Add New Destination Task
11. Select SyncType Activity and select Destination from the dropdown list
12. Repeat same steps for Sleep syncronization
Accessing your charts directly from Dropbox:
If you have a Public folder on your dropbox, you can copy all the .js and .html files there and get the shared url by selecting one of htmk files and selecting "Copy public link..." button. It would give you a URL that you can use from anywhere. You need to have Dropbox Pro account or free account created before October 4, 2012 for Public folder functionality to work on your dropbox.
Accessing your charts directly from Google Drive:
1. It is recommended that you create new folder in your Drive for this purpose.
2. Select the folder and Choose Share... option
3. On Share with others page dialog, click on Advanced button in bottom right corner.
4. On Sharing Settings dialog, click on Change... link at the top line of Who has access list.
5. On Link sharing dialog, select On - Public on the web option and click Save button.
6. Copy the URL that is shown on Sharing Settings page and click Done to close it
7. The URL that you copied will look something like the sample below. Copy just the alphanumeric sequence that is located between ?id= and &usp=sharing
Code:
https://drive.google.com/folderview?id=[B][COLOR="Red"]123-abcdcdefghijklmnopqrstUV[/COLOR][/B]&usp=sharing
8. Put www.googledrive.com/host/ before this string and /mi_data.html (or any other report) after it, you should get something like www.googledrive.com/host/123-abcdcdefghijklmnopqrstUV/mi_data.html - this should be your sharing link
Here is Google support page on sharing files/directories: https://support.google.com/drive/answer/2881970?hl=en
Using Helium backup instead of Android backup:
Helium produces .ab files that are ALMOST correct tar file, however besides extra characters on file header level they also have some differences in header entries for each file. I've looked through different methods and utilities and the best option so far is to use Helium_ab2tar.zip package (credit goes to xaos.cz for writing it and to johnny1176 for discovering it). It used to be available on xaos.ic.cz/Helium_ab2tar.zip, but that site is down now. You can still google for Helium_ab2tar.zip to find other locations that have copy of this file.
Plans for future versions:
Code:
0. Get more sleep :)
1. Titles for each chart
2. Implement dashboard comparing current week with previous statistical data. (For same days of week)
3. Use timeline component for right chart in data_byDow.htm
4. Show percentage of good days based on selected goals. Show min/max values for each metric.
5. Modify scatter chart to allow using any other series for X axis (Search/display correlations between sleep time and total number of steps).
6. Make a help page showing all the charts and how to use them.
7. Add ratio of deep/light sleep as part of selectable charts.
8. Merge all reports into single multi-tab document.
9. Parse detailed daily binary data - this is going to be a big one.
How to translate application to your language:
To add support for a new language:
For HTML pages
1. Open locale.js in editor supporting UTF-8 encoding.
2. Create a new section starting with
if (lang == "ru_RU") { }
and replace ru_RU with a locale string for your language.
3. Copy all strings from english version to inside { } brackets and translate the text.
4. Save file in UTF-8 encoding.
5. Add reference to your new language in comments section of config.js
For unix shell script:
For all subsequent entries, replace XX with 2-character locale name of your language
1. Create new po file using following command:
bash --dump-po-strings run.sh > po/XX.po
2. Edit newly generated file and translate msgstr entries using msgid entries as references
3. Save the file and generate new directory for the compiled langage file (.mo) using following command:
mkdir -p i18n/XX/LC_MESSAGES/
4. Compile .po file to .mo file by running following command:
msgfmt -o i18n/XX/LC_MESSAGES/mibandextract.mo po/XX.po
If you do not want to use the i18n folder and want the langage file to be system wide, you just have to comment (adding a #) the line "export TEXTDOMAINDIR=./i18n/" in the script.
Then you will have to move your po file to /usr/share/locale/XX/LC_MESSAGES/ (where XX is your langage).
Changelog:
v5.2 released on 2/1/2015.
v5.3 released on 2/2/2015.
v5.32 released on 2/3/2015
v5.7 released on 2/16/2015
v5.71 + fit v0.2 released on 2/21/2015
v5.8 + fit v0.3 released on 3/7/2015
v5.9 released on 3/14/2015
v5.92 released on 6/20/2015
Reserved
Hi.
Working perfect. Nexus 5 non-rooted.
Thank you very much for your work :good:
Grretings from Spain.
Hi,
It does not work for me at all ... All the time the same thing.
C:\Users\plmaciejewk\Desktop\miband_extract_v53>run
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Press "Backup My Data" button on device...
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
bin\tail: mi.ab: No such file or directory
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Could Not Find C:\Users\plmaciejewk\Desktop\miband_extract_v53\mi.ab
Could Not Find C:\Users\plmaciejewk\Desktop\miband_extract_v53\mi.tar
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Extraction failed
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Can I do anything with this?
I face the same issue as @macia10. I have rooted Nexus 5.
Dell112 said:
I face the same issue as @macia10. I have rooted Nexus 5.
Click to expand...
Click to collapse
I found a temp workaround. Edit rub.bat and remove all >> log from end of the lined. This causes the issue.
macia10 said:
Hi,
It does not work for me at all ... All the time the same thing.
C:\Users\plmaciejewk\Desktop\miband_extract_v53>run
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Can I do anything with this?
Click to expand...
Click to collapse
This might be caused by adb process still running in memory and locking log file. I've modified script not to redirect output from adb commands into log file and also added few commands to kill previous adb service once extraction is complete. Could you please download v5.33 and see if it works?
xmxm said:
This might be caused by adb process still running in memory and locking log file. I've modified script not to redirect output from adb commands into log file and also added few commands to kill previous adb service once extraction is complete. Could you please download v5.33 and see if it works?
Click to expand...
Click to collapse
works perfectly
Thanx!!
Thanks, very useful!!
FYI, I needed to make some modifications to make it work in my case:
- In 'run.sh', I had to modify the SDPath variable to the correct path (in my version of Cyanogenmod):
SDPath=/storage/sdcard0
- run.sh log indicated a "permission denied" error. It was caused because adb did not have root privileges in my android. To correct it:
In Android: Settings > Administrative access > Select "Applications and ADB"
- sqlite3 in OSX is an old version, so run.sh complains with:
Error: unknown command or invalid arguments: "once". Enter ".help" for help
Error: unknown command or invalid arguments: "print". Enter ".help" for help
To solve it, install a new version of sqlite3. For example using brew:
> brew install sqlite3
and replace sqlite3 in run.sh for the brew version: /usr/local/Cellar/sqlite/3.8.6/bin/sqlite3
- Files from: miband_analytics need to be in the same folder than miband_extract
With these modifications it is working properly in my mac.
Keep up the good work!
Hi.
I'm extracting data with Bonoboo Mi Band Export Stats, which exports to sd card the files:
app_locale.js; config.js; extract.js; locale.js; Mi_Band_Table.csv; Mi_Band_Table.html and Mi_Band_Graphs.html.
In order to used that exported data with your analytics tools, which files should i move to your folder which contains multiple files like mi_data_byDoW.html and mi_data.html ?
Thanks
herpez said:
Hi.
I'm extracting data with Bonoboo Mi Band Export Stats, which exports to sd card the files:
app_locale.js; config.js; extract.js; locale.js; Mi_Band_Table.csv; Mi_Band_Table.html and Mi_Band_Graphs.html.
In order to used that exported data with your analytics tools, which files should i move to your folder which contains multiple files like mi_data_byDoW.html and mi_data.html ?
Thanks
Click to expand...
Click to collapse
You'll just need at app_locale.js and extract.js. The folder with analytic tools already has config.js and locale.js and CSV file is not required for analytic tools, you only need it if you want to see your data in Excel.
SynerG said:
Thanks, very useful!!
FYI, I needed to make some modifications to make it work in my case:
- In 'run.sh', I had to modify the SDPath variable to the correct path (in my version of Cyanogenmod):
SDPath=/storage/sdcard0
- run.sh log indicated a "permission denied" error. It was caused because adb did not have root privileges in my android. To correct it:
In Android: Settings > Administrative access > Select "Applications and ADB"
- sqlite3 in OSX is an old version, so run.sh complains with:
Error: unknown command or invalid arguments: "once". Enter ".help" for help
Error: unknown command or invalid arguments: "print". Enter ".help" for help
To solve it, install a new version of sqlite3. For example using brew:
> brew install sqlite3
and replace sqlite3 in run.sh for the brew version: /usr/local/Cellar/sqlite/3.8.6/bin/sqlite3
- Files from: miband_analytics need to be in the same folder than miband_extract
With these modifications it is working properly in my mac.
Keep up the good work!
Click to expand...
Click to collapse
Thank you for your feedback.
Regarding SDPath, I'll put a a more clear explanation that SDPath may need to be changed depending on device.
For ADB privileges, the way you had to enable it might be specific to your Android version (I've granted permissions in a different way on my phone), but generally speaking the application should work through Backup logic even when adb has no root permissions.
For sqlite3 issue, could you please tell me which version of sqlite3 OSX has by default, so can add a note in instructions about version compatibility?
Regarding same folder location, I think there is already a mention about the need to have both packages exptracted to the same folder.
xmxm said:
Thank you for your feedback.
For ADB privileges, the way you had to enable it might be specific to your Android version (I've granted permissions in a different way on my phone), but generally speaking the application should work through Backup logic even when adb has no root permissions.
Click to expand...
Click to collapse
I got a message in my Android asking for permission to do the backup, but at the same time I saw the "permission denied" message in the console. Maybe I got both because the script tries to get data from two different mechanisms. Even if I clicked yes to do the backup, the script was not able to get the data until adb was granted permissions.
For sqlite3 issue, could you please tell me which version of sqlite3 OSX has by default, so can add a note in instructions about version compatibility?
Click to expand...
Click to collapse
My Mac with OSX 10.9 (Mavericks) had installed sqlite3 version 3.7.13. I think that the required commands were added in 3.7.15, but I could be wrong. Brew has installed 3.8.6 and is working properly.
SynerG said:
I got a message in my Android asking for permission to do the backup, but at the same time I saw the "permission denied" message in the console. Maybe I got both because the script tries to get data from two different mechanisms. Even if I clicked yes to do the backup, the script was not able to get the data until adb was granted permissions.
Click to expand...
Click to collapse
Windows version supports ForceBackupMode=Y setting to skip root-specific method and go straight for backup method, but I guess that run.sh is outdated by now - I'll need to find a way to copy newest logic changes to unix script. I still think hope that giving ADB root is not mandatory for extract to work.
My Mac with OSX 10.9 (Mavericks) had installed sqlite3 version 3.7.13. I think that the required commands were added in 3.7.15, but I could be wrong. Brew has installed 3.8.6 and is working properly.
Click to expand...
Click to collapse
Thank you for this information - I'll put version numbers in the header.
xmxm said:
Windows version supports ForceBackupMode=Y setting to skip root-specific method and go straight for backup method, but I guess that run.sh is outdated by now - I'll need to find a way to copy newest logic changes to unix script.
Click to expand...
Click to collapse
You will find attached a zip with a new version of run.sh.
run.sh now support ForceBackupMode and internalization.
Thats why I add 2 folders (po and i18n).
If you want to add support for a new langage, let's say spanish for example, you will first have to create a new po file
Code:
bash --dump-po-strings run.sh > po/es.po
Then edit the file newly created with any text editor and translate the "msgid" with the "msgstr"
Once done, you have to create a new directory for the compiled langage file (.mo)
Code:
mkdir mkdir -p i18n/es/LC_MESSAGES/
Then compile the file with
Code:
msgfmt -o i18n/es/LC_MESSAGES/mibandextract.mo po/es.po
For another langage replace "es" with the one you want.
If you do not want to use the i18n folder and want the langage file to be system wide, you just have to comment (adding a #) the line "export TEXTDOMAINDIR=./i18n/" in the script.
Then you will have to move your po file to /usr/share/locale/XX/LC_MESSAGES/ (where XX is your langage).
Version updated to 5.5 with better support for FitnessSyncer and some chart updates
Good Work
xmxm said:
Version updated to 5.5 with better support for FitnessSyncer and some chart updates
Click to expand...
Click to collapse
Thanks for your work!!!

How I got my Sprint LG G2 (LS980) to work on T-Mobile - Guide with Screenshots

I have a Sprint LG G2 (LS980) that I wanted to use on T-mobile. There is a ton of info scattered in various threads on achieving bits and pieces of this task, but nothing I could follow straight through to get it done. I did not come up with any of the info in here, I just assembled it to form a guide that I used to successfully get my LS980 working on T-Mobile. Thanks to all the hard work of everyone else who wrote the apps I used, and those who came up with the exploits that made it all possible.
(Also, I wrote this in HTML before I realized I had to use BBCode here. I used a HTML to BBCode converter, so if something looks formatted weird, let me know, I might have overlooked it)
Apps Used
RootBrowser
RadioSwitcher
RootChecker
ChangeAPN
ROMToolbox Lite
Flash Stock Rom
Based on steps here.
Downloads
Download firmware and dll files for your specific phone model
I used LS980ZVA_01.tot& LGLS980_20130904_LGFLASHv151.dll
Download LGDrivers
File name: 'LGUnitedMobileDriver_S51MAN313AP22_ML_WHQL_Ver_3.13.2.exe'
Original article says to get the Verizon Drivers if you're doing a verizon phone, however since I'm dealing specifically with the Sprint LS980 I didn't get them.
Download LGFlashTool v1.8
Download MegaLock.dll
Install LG Drivers
Run the downloaded file 'LGUnitedMobileDriver_S51MAN313AP22_ML_WHQL_Ver_3.13.2.exe'
Click Next through the prompts, they require no real configuration.
If successful, you should get a prompt:
LG United Mobile Driver Installed Successfully.
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Setup LG Flash Tool
Run the downloaded file Setup_LGFlashTool_1.8.1.1023.exe
Click Next through the prompts, nothing needs unique configuration. It will install by default to C:\LG\LGFlashTool\
Copy the downloaded MegaLock.dll from earlier into C:\LG\LGFlashTool, and over-write the one that is already there.
Boot into Download Mode
Plug usb cable to computer
On the phone, hold volume up and plug other end of usb cable into phone
Screen will show 'Download Mode'
The screen will then show 'Firmware Update'
The device is now in Download Mode and ready to be flashed
Configure Port for Phone
Open Device Manager and expand Ports (COM & LPT)
Right click LGEAndroidNet USB Serial Port and choose Properties
In the Properties window click the Port Settings tab, then click Advanced
In the Advanced Settings window, set the COM Port Number to COM41 and click OK
The entry in Device Manager should show as having COM41 now.
Flash the Phone
Run LGFlashTool as Administrator
"C:\LG\LGFlashTool\LGFlashTool.exe"
In the Model Config window that opens:
Check Select Manual Mode
DLL:"C:\LG G2\LGLS980_20130904_LGFLASHv151.dll"
S/W:"C:\LG G2\LS980ZVA_01\LS980ZVA_01.tot"
Click Ok
In the LG Flash Tool screen click the Yellow Arrow to Start
The Port 1 box should, after a second, show Ready!
If the Port 1 box does not start showing processing after a few seconds, unplug the phone then plug it back in. This should start it.
As it processes, the phone may reboot a couple times (I never counted how many times)
At 94% my phone will restart, and the app will show 'Waiting 120 sec for reboot'. When the phone restarts at this point, it is loaded into the OS and waiting to be configured. I have never gotten the Flash Tool it to hit 100% successfully, despite being in the phone. I have not seen this to be a problem yet.
Once inside the phone, close the Flash Tool.
Root the Device
The device has to be in debug mode before it can be rooted with this method.
Enable Debug Mode
Open Apps| Settings
Select About Phone
Choose Software Information
Click Build Number 7 times. After about 4 clicks you will see feedback indicating remaining clicks until you are a developer
You are now 3 steps away from being a developer.
Click to expand...
Click to collapse
After 7 clicks, you will see a popup that says:
You are now a developer!
Click to expand...
Click to collapse
Back out to the root of Settings and choose Developer options
In the Developer Options, check USB Debugging
Root the device
Download IOroot here.
Extract the downloaded ioroot.zip
Run ioroot.bat as Administrator
A cmd window will launch and show:
enable ADB connection..
Developer Options unlocked and ON.
USB debugging ON.
Accept RSA key fingerprint.
Press any key to continue...
Click to expand...
Click to collapse
On the Phone, click OK when prompted for Allow USB Debugging?
On the Computer, press ENTER to advance the batch
The batch script will next pause showing:
USB Connection Mode needs to be toggled.
Toggle USB mode to another setting and then back again.
Ex.
Charge Mode to MTP then MTP back to Charge.
Ethernet Mode to MTP then MTP back to Ethernet.
Sometimes unplugging USB and then plugging back in helps.
Then press ENTER to confirm ADB root...
--------------------------------------------------------
Click to expand...
Click to collapse
On the Phone, switch the USB mode to a different option,then switch it back.
On the Computer, press ENTER to advance the batch script
The batch will show:
adbd is already running as root
uid=0(root) gid=0(root)
If you do NOT see uid=0(root) gid=0(root) above then
it is likely your device firmware is not supported or
USB mode was not toggled properly. You can try to
run the script again or..
PRESS CTRL+c to stop this script...
If you DO see uid=0(root) gid=0(root) mentioned above...
CONGRATS.. Rooted ADB is now confirmed.
You will have a rooted ADB shell but no apps on the
phone will be able to access root functions.
PRESS ENTER to backup EFS and continue with full root.
PLEASE NOTE!
Continuing with full root can trip LG's rootchecker.
This means your phone will show ROOTED in Download mode.
You can remove root flag by flashing stock firmware...
.bin .cab .tot or .kdz
If you do not want to possibly invalidate your warranty
press CTRL+c to stop this script...
--------------------------------------------------------
Press any key to continue . . .
Click to expand...
Click to collapse
Make sure you see uid=0(root)gid=0(root) as shown in the screenshot above
Press Enter to continue The script will next show:
Backing up EFS...
6144+0 records in
6144+0 records out
3145728 bytes transferred in 0.626 secs (5025124 bytes/sec)
6144+0 records in
6144+0 records out
3145728 bytes transferred in 0.617 secs (5098424 bytes/sec)
2978 KB/s (3145728 bytes in 1.031s)
2977 KB/s (3145728 bytes in 1.031s)
________________________________________________________
EFS partitions now in ioroot folder on computer
named modemst1.img and modemst2.img
They will come in handy in case of an emergency.
Store them somewhere you won't lose them.
Press ENTER to continue with full root.
--------------------------------------------------------
Press any key to continue . . .
Click to expand...
Click to collapse
Press Enter to continue
The script will show:
Mounting system, pushing su binary...
2525 KB/s (121260 bytes in 0.046s)
WARNING: generic atexit() called from legacy shared library
0 KB/s (629 bytes in 1.000s)
Rebooting Phone.
________________________________________________________
You should hopefully now be fully rooted!!
IOroot complete.
Confirm root with Root Checker app from Play Store.
--------------------------------------------------------
Press any key to continue . . .
Click to expand...
Click to collapse
The phone should reboot and be rooted now.
Check Root with Root Checker
If nothing went wrong, the phone should be rooted now. To make sure, we can use Root Checker. (there are probably other apps that will do this as well, but I used this one)
Download, install, and launch RootChecker
In the application, click Verify Root
It should return back showing
Congratulations! this device hasroot access!
Click to expand...
Click to collapse
Unlock SIM
Steps here are from this article. I am just writing it out here with notes that helped me.
Download and install Root Browser (I only had success using version 2.2.3.)
Download ls980SIMunlockFinal.rar
Extract ls980SIMunlockFinal.rar (I used 7-zip)
Replace 'Carrier' folder
Within the extracted contents, copy the 'Carrier' folder onto the phones internal storage (I copied it to Internal Storage\Downloads)
On the Phone, open Root Browser and navigate to where the Carriers contents were copied
Note: My screenshots show me copying the files from where I copied the files to in Internal Storage\Downloads (storage\sdcard0\Downloads)
Click Storage
Click sdcard0
Click Download
Long press carrier
Click copy
Click the green back arrow until you're back at root
Click Paste
When prompted, choose to overwrite.
Note: Alternatively, you could rename the original 'carrier' folder for safekeeping... I never did though.
carrier already exists. Do you want to overwrite it?
Click to expand...
Click to collapse
Reboot the phone.
Replaceapns-conf.xml
From original post - "To make APNs stick automatically"
Note: I later add a new APN, despite having replaced the apns-conf.xml here. I honestly don't know if this step is necessary for that reason, but I did it in my process, so I'm adding it here.
Within the extracted contents, copy the apns-conf.xml onto the phones internal storage (I copied it to Internal Storage\Downloads or root\storage\sdcard0\download)
On the Phone, open Root Browser and navigate to where the apns-conf.xml was copied
Long press the apns-conf.xml and choose copy
Navigate to root\etc, and click paste
When prompted to overwrite, choose Yes
Note: Again, you could rename the original to keep a backup.
Navigate to root/data/data/com.android.providers.telephony/databases
Delete/Rename telephony.dband mmssms.db
Note: I didn't actually delete the telephony.db and mmssms.db originally, and I still had success. But I also don't know what deleting those so they can be rebuilt does, so I included the steps.
Reboot the phone.
Update build.prop
Backup build.prop
Open Root Explorer and navigate to root\system
Long press build.prop and choose Copy, then click Paste to create a backup.
Edit build.prop
Download and install ROMToolbox Lite.
We're going to use the Build Properties application included in the Toolbox for editing the build.prop.
Open Root Explorer and navigate to root\system
Click build.prop and choose to open with Build Properties
If you get the Welcome screen, click OK
Locate and click on each of the following settings, and set the Value as shown below, and click Save
persist.service.crash.enable=1
ro.build.target_operator=spr
ro.carrier=spr
Reboot the phone.
Switch the Radio
Download and install RadioSwitcher (I only had success with version 1.2.)
Open Radio Switcher, and set the Preferred network type to LTE/GSM/WCDMA
Create a New APN
Despite replacing the apns-conf.xml earlier, I still ended up having to create a new APN.
Download, install, then open ChangeAPN
Click Menu and choose New APN
Here are the settings I used in the APN from here
Name:*T-MOBILE
APN:*epc.tmobile.com
Proxy:<Leave in Blank>
Port:*<Leavein Blank>
Username:*<Leavein Blank>
Password:*<Leavein Blank>
Server:*<Leavein Blank>
MMSC:*http://mms.msg.eng.t-mobile.com/mms/wapenc
MMSproxy:*<Leavein Blank>
MMSport:*<Leavein Blank>
MCC:310
MNC:260
Authenticationtype:*<Leavein Blank>
APNtype:default,supl,mms
APNProtocol:Leave it to the Default one
Click to expand...
Click to collapse
Click Menu then Save
Reboot the phone
Notes
After all of this was complete, I had the LS980 working on my T-Mobile SIM card successfully. Some other threads I've read discussed installing recoveries like TWRP to make a backup, but every time I tried, it ended up causing a boot loop, so I ultimately didn't do it. From what I can tell it is not a necessity to simply get the phone to work on T-Mobile. Once all the settings/changes have been made, I just popped in my SIM Card from my other phone and it worked fine.
Known Issues
Since we got it running on T-Mobile, there are a few issues that we've been facing.
Unable to call some numbers
When trying to make calls, ff the number does not have a 1 at the beginning, I get a crash.
Unfortunately, the process com.android.phone has stopped.
Click to expand...
Click to collapse
Adding a '1' before the number has corrected it.
This article lists another possible more permanent fix, that I will eventually try out:
If you want to fix this manually, Follow the following fix found by jsergio123)
*To fix the issue of the com.android.phone process crashing when you don't dial a 1 in front of the number edit the /data/data/com.android.providers.settings/databases/settings.db file with a SQLlite editor and change in the "system" table "assist_dial" and "assist_dial_init_db_check" to "0". If you don't see those 2 rows then you can add them. Fix permissions, wipe cache and reboot.
Click to expand...
Click to collapse
Text Messages, and Multimedia Messages Fail to send
When trying to send texts, or picture messages, I was getting regular failures.
This article had a solution.
1. In dialer press ##443336772#, you will get a 6 digit SPC code, remember it!
2. In dialer press ##DATA# , this will take you to hidden Data settings
3. Select MMSC
4. Hit Edit, you will be prompted for your SPC code, enter it
5. Now have 3 options: Set URL, Gateway, and Set Port. Set all
My working settings:
Set URL: http://mms.msg.eng.t-mobile.com/mms/wapenc
Gateway: 10.12.0.2
Set Port: 80
6. Reboot
3g not working on My lg g2 ls980 plz solve it.
Moin. said:
3g not working on My lg g2 ls980 plz solve it.
Click to expand...
Click to collapse
See the section of the article on switching your radio.
Thank you Fuzz1303. This is, without question, the most thorough tutorial available for using an LS980 on a domestic GSM carrier. After weeks of trying to piece together various threads explaining the process, I stumbled upon your tutorial and BINGO, it was a cake walk. Again, thank you.
Now that it's done, will the unlock stick through custom ROM flashing? I have installed TWRP.
bibbin said:
Thank you Fuzz1303. This is, without question, the most thorough tutorial available for using an LS980 on a domestic GSM carrier. After weeks of trying to piece together various threads explaining the process, I stumbled upon your tutorial and BINGO, it was a cake walk. Again, thank you.
Now that it's done, will the unlock stick through custom ROM flashing? I have installed TWRP.
Click to expand...
Click to collapse
I dealt with the same sort of headache flashing mine, so I'm glad this helped.
As for the unlock sticking, I'm not totally positive. I never played much with the custom roms just as I kept having issues and finally got tired of battling it.
It is easier to get a Nexus 5 instead.
Fuzz1303 said:
I dealt with the same sort of headache flashing mine, so I'm glad this helped.
As for the unlock sticking, I'm not totally positive. I never played much with the custom roms just as I kept having issues and finally got tired of battling it.
Click to expand...
Click to collapse
Once again, thanks for this spectacular tutorial. FYI, my G2 is still chugging along strong and I'm safely running Resurrection Remix. I started with Lollipop and moved on to Marshmallow. So happy. Thanks.
I need help, I just get "adbd cannot run as root in production builds
uid=2000(shell) gid=2000(shell) groups=1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:toolbox:s0" and have no idea how to fix... help please!

Categories

Resources