Related
This utility allows to convert PimBackup files to XML one which is
compatible with Android application "SMS Backup&Restore" created by
Ritesh Sahu (* check the author to match the right application on Market *).
After the conversion the XML file contains all your SMS and you can Import
them to you Android smartphone.
This utility doesn't require any installation process or additional DLLs,
in order to start using it, just run the executable file.
WARNING: I've tried to restore about 11,000 SMS with success on "Motorola Atrix 4G" and it seems to freeze many times while running stock "Text Messaging" application.....so I think 11,000 SMS is too much to handle for Android OS
Versions History
=============
* Version 2.0.0.4 (2012-12-13)
- New Draft Folder support
- Messages in Custom Folders are now moved to Inbox or Outbox
- Minor bug fixes
* Version 2.0.0.2 (2012-11-28)
- New option (only for CMS files): Discard self-test messages
- New option to convert not supported folders in In/Outbox
* Version 2.0.0.1_beta1 (2012-11-14)
- New advanced graphic design
- PimBackup binary files (*.pbm) supported!!!!!!
* Version 1.0.1.0 (2011-09-28)
- If it enconters an irreversible error it will asks if you want to continue without stopping conversion
* Version 1.0.0.9 (2011-09-26)
- Managed splitted Conversation/SMS text in multi-rows (messages with Carriage Return)
* Version 1.0.0.8 (2011-07-27)
- Fixed negative values for TimeZone offsets
* Version 1.0.0.7 (2011-07-27)
- Added TimeZone and Date/Time management to increase/decrease according to your local TimeZone
* Version 1.0.0.6 (2011-07-04)
- Fixed bug while using special characters like "&" or quote
* Version 1.0.0.5 (2011-04-21)
- Fixed bug for Inbox messages if SenderName and/or SenderAddress is empty
* Version 1.0.0.4 (2011-04-21)
- Managed empty "SenderName" and "SenderAddress" for Outgoing messages. Now those messages will be considered well.
- Draft, Trash and Outgoing folders (from CSM file) are not converted in any case because Android hasn't got those folders.
* Version 1.0.0.3 (2011-04-19)
- Added "Text Encoding" option to decide output file text encoder ("UTF-8" is the most common)
- Managed empty "SenderName" and "SenderAddress" data from input files. Now those messages will be discarted
* Version 1.0.0.2 (2011-04-19)
- Added an option to stop decodification after have decoded a specified amount of messages
- Managed "line-brakes" in messages. Those line-brakes will be removed from the message
- Managed "self-test" messages. Those self-test messages will not be added to output file
- Fixed a bug that truncates TextMessage at first "semicolon" character
- Added an "Error" section to show occurred errors
* Version 1.0.0.1 (2011-04-18)
- Uncompressed Executable file for better compatibility on multiple Windows OS
* Version 1.0.0.0 (2011-04-06)
- First release
Create a good backup file with PimBackup
=================================
The software is dummy and need a good/perfect file to work fine; in other words it needs
a good PimBackup file.
Let's create that file:
* open PimBackup in your Windows Mobile phone/smartphone
* choose "Backup" from dropdown list
* select sections as you wish but not forget "Messages"!!
* press "Next"
* (if you have a lot of SMS do not select "Create temp files in memory")
* press "Next" and go-on following the Wizard....
Find CSM or PBM file
===================
At the end of procedure above you will have a single PIB file.
This file is compressed and you can open it with WinZip/WinRAR/7Zip.
* So, please open it and look for "*.cms" or "*.pbm" file.
* Extract it from the compressed file.
That's it!!
Start the conversion
==================
Ones located CSM/PBM file you will want to convert it, right?
* Open "PimbackupDroid.exe" (this software of course!)
* Click "Menu --> Open" and select a CSM/PBM file
* [only for CMS] Enter "Your phone number for comparison". This field is necessary because
this is the only way to identify you as the sender of outgoing messages.
You can use simple numbers without international prefix (Ex: 0039 or +39).
* (optional) Check "Only between dates" to force convert just SMS between
two specified dates. It works for both incoming and outgoing messages.
* (optional) Check "Blacklist" OR "Whitelist" radio button if you want to
EXCLUDE (blacklist) some contacts or you just WANT (whitelist) convert
just some specified contacts.
!!WARNING!! - Blacklist and Whitelist using "Partial" input data, in
other words if you will add "Edward" in one of those all
contacts CONTAINS "Edward" word will be blacklisted/whitelisted,
for example also "Edward2" will be affected.
Both Blacklist and Whitelist are case insensitive (no difference between
"Smith" and "SMITH").
* Press "Start" button. It will generate a NEW file with the same name of original
one but with ".xml" extension. (!!WARNING!! - it doesn't ask for overwriting)
Import XML file on Android OS
========================
Now you have an XML file generated with this utility and you need to download
a small (and FREE) application from Android Market:
*SMS Backup & Restore" created by "Ritesh Sahu" (!!!check the author name!!!)
Install it
Before run this new installed utility you need to create a new "SMSBackupRestore"
folder in you Internal Phone Storage's root directory.
Now you can copy your XML file to this new folder and run the new Android application.
This Android utility is very very easy to understand: just press "Restore" button
and select your XML file.
Now wait until errors (ops!!) or successfully popup window!
System Requirements
==================
This utility works properly on all 32-bit/64-bit versions of Windows,
including Windows 98/ME, Windows NT, Windows 2000, Windows XP, Windows
Server 2003, Windows Vista, Windows Seven and Windows 8.
Personally tested on: Windows 7 Ultimate 64bit, Windows XP 32bit and Windows 8 Pro 64bit
Linux users: I think this software will works with "WINE" but not tested.
Disclaimer
==========
The software is provided "AS IS" without any warranty, either expressed
or implied, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose. The author will not
be liable for any special, incidental, consequential or indirect damages
due to loss of data or any other reason.
Issues/Limitations
===============
- MMS/e-mails not supported
- Attachments (like images or files) not supported
Screenshot
===========
{
"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"
}
Download at Sourceforge.net
======================
https://sourceforge.net/projects/pimbackupdroid/
Any idea on what to add more to this software??
Post reserved to author
This sounds great. I have a lot of old SMS I'm missing after switching to android. I'm going to test it as soon as I'm with my PC tommorow morning. Will report back then.
Sent from my HTC HD2 using XDA App
emandt, I tried to download your SW from the page you have listed, but it looks like folder is empty...?
As I've wrote in first post: project just opened at SF.net, so be patient
I'm creating a small README as Guide and prepare source code to place it on SF.net very soon.
OK, I was under impression at least test version is available. I'll wait
Released the first version few hours ago.
Check the Limitations (first post) before post a bug
I've realized my PIM backup files are .pib, not .csm. Is there any way how to move it to .csm? Except of restoring and archiving again through WM...I have only one phone
Thanks.
Please read the description at first post or the README file following the EXE.....
The ".CSM" file IS INTO the PIB file.
PIB file is just a compressed file to handle multiple files in single one.
Use WinZip / WinRaR / 7-Zip to open the PIB file and extract CSM one.
If your backup was created with "Binary backup(faster)" options it's impossibile to convert with my software (no any description/protocol about "How To Read" a Binary file created by BimBackup)....so, in this case, I think you need to Restore all messages and start the backup (without THAT option!!) again....sorry.
However I will study (raw mode with thousands of tries) "Binary backups" to allow them as non-binary ones.
I'm sorry I have overlooked this step. The problem is that even when I open .pib file, there is no .csm. Actualy, all extensions begin with .p**. Could be the reason that I have somehow checked "binary backup" in WM PIM?
I'm hot to test your SW but obviously I'm not a good tester
BTW, why don't you move this topic between general android applications, to have it more visible in the forum?
I'm trying to read binary backup files but without any description from author is very very hard to resolve this step. I've not found a schema for the data into binary files yet.
I've studied BINARY backup and already found half-solution, at least for NAME, TELEPHONE_NUMBER and TEXT_MESSAGE.....not I'm stuck at "Date and Time field"....
I've wrote to PimBackup author and I hope he will respond me with the solution.
Stay tuned
Nice initiative
Hi,
first of all, congrats for the iniative. Sorrowfully, it doesn't work for me (Access Violation at address 004ccea0 [...] @ address 00000004
If this helps: W7 x64 Pro @i5
For people who have their backups in binary format, from this same forum (don't remember the threads tho, sorry) came these tips:
1) Download Microsoft Windows mobile 6.5 Professional Developer Tools (goole it or "Windows Mobile 6.5 emulator");
2) run the appropriate version of the emulator;
3) "install PimBackup and restore your backup (set up a "shared Folder" for that, it will appear as a storage card);
4) redo your backup without binary format unchecked;
5) have fun! (if you're reading this thread, you know the rest already )
Also, see this link: Transferring contact list from Windows Mobile to Android SANS OUTLOOK
Have fun! I'll have to wait the next stable version.
It's strange....I'm using Win 7 Ultimate 64bit in italian language.
What OS language?
What is your OS alphabet in use?
I've developed this application quiclky and I don't have considered alphabets and non-latin characters. Maybe it could be this.
I'll spend more time to make it works on other OS settings
@tuliogs: if your Error is generated during startup of application you can try new version (v.1.0.0.1 folder on download section) which has an uncompressed Executable file to increase compatibility on Windows OS.
Otherwise: I need more explanations about that Error.
not yet
I get the error when trying to convert the file. Win7 here is in brazilian portuguese, I guess it's UTF-8 (or else, probably Windows-1251, which in turn is an ISO 8859-1 variant, I guess).
Just tried the new version... same issue, but it now shows where it stops: on a self-test SMS (explained below). It was enough to change the "phone number for comparison" field and _that_ issue was solved. However, please keep reading.
I found some "anomalies" in some messages in my file, though:
some are self-tests I sent to myself or just empty drafts. this seems to be the issue described before;
some contain the whole phone numbers including country codes and the plus sign (no trouble with those ones);
some archived messages contain line breaks: these are plain skipped;
duplicate messages, some within a short interval (3 secs or less) disappear also;
different cellphones use different text encodings so you guess the mess... however, overall text is more important than specific characters, so it's relevant to say I had no problem at all with these, apart from getting alien symbols (which don't bother me).
I had to abandon Android on my Kaiser to revamp it from scratch (therefore, WM again aawwww), so I can't test the final result now, but there's a Samsung Galaxy S (Froyo, I guess) coming in a few days. So if you'd wish to attack those issues in the meantime, I'll gladly test the final result when time comes.
Thank you again and keep up the good work.
Nice to have so detailed error description!!
New version was compiled just without "Compress executable" option because I thought your error were caused on startup and not during conversion.
Can you send me just a complete row (you can manually edit a row to create fake text) of CSM file with many brazilian characters??
Now I'll try with:
- self test messages
- many special characters (also line-breaks)
outgoing SMS is sucessfully converted,
but I cannot found any incoming message in the output files...
Here are the first few line of the output:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<smses count="196">
<sms protocol="0" address="" date="1284300650000" type="1" body="回到家了啦" read="1" status="-1" contact_name="" />
<sms protocol="0" address="" date="1286260959000" type="1" body="整緊" read="1" status="-1" contact_name="" />
@azothterry: TYPE="1" means "Inbox" but perhaps this wrong decode depends of strange Input data.
I've tested with my latinian-alphabet without special chars (comma, points and few single-quote chars) and it works.
To allow other alphabets/characters I need few lines from your CSM file, expecially with special chars.
Don't forget to set "Number for comparison" field with your partial (without international prefix) phone number.
Hi, emandt
Here are some line of my csm file, many thx.
Code:
0x00,0x00;"";"";;"";"回到家了啦";"";0;"\\%MDF1";"SMS";"IPM.SMStext";;;33;262144;2011,04,13,15,07,28;2010,09,12,22,10,50;1;"524296\;Kat\;99999999\;1\;0\;SMS";0;""
0x00,0x00;"Kain Kwok";"\"Kain Kwok\" <88888888>";;"";"幫我開電腦pls";"";0;"\\%MDF1";"SMS";"IPM.SMStext";;16;1;;2008,01,01,16,38,55;2010,09,22,09,29,45;0;"";0;""
0x00,0x00;"";"";;"";"整緊";"";0;"\\%MDF1";"SMS";"IPM.SMStext";;;1;262144;2008,01,01,16,38,56;2010,10,05,14,42,39;1;"524296\;Kat\;99999999\;1\;0\;SMS";0;""
0x00,0x00;"Kat";"\"Kat\" <99999999>";;"";"飲檸檬茶中..";"";0;"\\%MDF1";"SMS";"IPM.SMStext";;14;1;;2011,04,13,15,07,28;2010,10,05,14,46,55;0;"";0;""
0x00,0x00;"";"";;"";"飲緊燈汁!明天俾一支你!";"";0;"\\%MDF1";"SMS";"IPM.SMStext";;;33;262144;2011,04,13,15,07,28;2010,10,05,14,51,24;1;"524296\;Kat\;99999999\;1\;0\;SMS";0;""
0x00,0x00;"Kat";"\"Kat\" <99999999>";;"";"何時買?";"";0;"\\%MDF1";"SMS";"IPM.SMStext";;8;1;;2011,04,13,15,07,28;2010,10,05,14,52,55;0;"";0;""
0x00,0x00;"";"";;"";"今早";"";0;"\\%MDF1";"SMS";"IPM.SMStext";;;33;262144;2011,04,13,15,07,28;2010,10,05,14,53,23;1;"524296\;Kat\;99999999\;1\;0\;SMS";0;""
Hello guys,
I know there are multiple guides like this one on the forums, but I guessed: Why should one just have tutorials in Batch and C#? I can program in VB, why not share it?
First: This guide will contain some code out of my own program (Universal Android Toolkit) but only the free stuff
So, I guess I'll start off.
Prerequisites:What will you need?
Microsoft Visual Studio (2008, 2010 or 2012) for Windows Desktop. I'll provide links.
A computer with at least 1GB RAM, a P4 @ 2.8GHz, 128MB Graphics chip/card, some basic knowledge of ADB commands (You'll learn them here, I guess...)
A cup of coffee or whatever your favorite warm beverage is.
Oh, and some decent music would be good.
Setting things up:As I've already done this a while back, I cannot provide screenshots, but I'll do my best to explain things.
First, download Visual Studio 2012 for Windows Desktop and open the installer.
It should look somewhat like this, just with a big 'START' button at the bottom.
{
"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"
}
Once you have installed that, it is advisory, that you download the .Net framework 3.5, 4.0 and 4.5
.Net 3.5 (Includes 2.0, 3.0 and 3.5 SP1
.Net 4.0
.Net 4.5
Once you have installed those, you should bookmark this page and restart your computer.
Then, move to the next step.
Creating a New Project:Open up Visual Studio. You will be welcomed by a screen, which looks somewhat like this:
Click on 'New Project...'
You will then see this type of screen:
Select 'Windows Forms Application' and give it a name. You may name it whatever you want. You can also change the location it should be stored in. I'll change the name to Android One-Click Tutorial and I'll leave the default location as it is.
Once you have done that, hit OK and wait for the project to load up.
One-Click, Here we Come!:
Once the project has loaded, you will see a screen like this (Depending on which version of VS you are using..)
You may name the form however you want. I'll name it the same as the project.
Once you have given it a name, you'll want to resize the form to the desired size and give it an icon.
Please excuse the weird highlights, I'm using my old laptop, because my computer broke and my mouse died with it.
Then debug the program, to make sure it is how you want it to be.
If it's OK for you, then let's get to downloading all the ADB-Stuff.
Download the ADT bundle from here and then download the platform-tools.
You might want another cup of coffee for this. Sadly, I can't drink anything warm or with caffeine, because I had an operation to my mouth yesterday (Friday the 07th of June 2013) so feel free to drink one on me
Once it is done downloading, extract the archive to your computer. I'll just put it in my Documents folder.
Once everything is extracted, move to the sdk\platform-tools folder. Make sure that the files 'adb.exe', 'AdbWinApi.dll', 'AdbWinUsbApi.dll' and 'fastboot.exe' are present. If they are, go back to Visual Studio and go to the properties of the project (Project ->> <Project Name> properties) and move to 'Resources'. Change the resource type from Strings to Files.
Then, add the four files from above to the resources.
Once all that is done, we can start coding.
So go ahead and double-click on the form, so that the code file shows up.
It'll look like this:
Type in the following over Public Class Form1:
Code:
Imports System.IO
Imports System.Threading
Imports System.Windows.Forms.DialogResult
Now, as this program is supposedly going to be used by others, probably people without knowledge of coding, and therefore people without ADB, etc., we want the program to look for our files and copy them if necessary.
We want to do this right at the beginning of the program, so we'll do it the Form1 Load Event.
Type the following code:
Code:
If Not Directory.Exists("ADB") Then
Directory.CreateDirectory("ADB")
Else
If Not File.Exists("ADB\adb.exe") Then
File.WriteAllBytes("ADB\adb.exe", My.Resources.adb)
End If
If Not File.Exists("ADB\AdbWinApi.dll") Then
File.WriteAllBytes("ADB\AdbWinApi.dll", My.Resources.AdbWinApi)
End If
If Not File.Exists("ADB\AdbWinUsbApi.dll") Then
File.WriteAllBytes("ADB\AdbWinUsbApi.dll", My.Resources.AdbWinUsbApi)
End If
If Not File.Exists("ADB\fastboot.exe") Then
File.WriteAllBytes("ADB\fastboot.exe", My.Resources.fastboot)
End If
End If
The code folder should now look something like this:
Ok. So now debug the program and check in the project's \bin folder for a folder named ADB and check if all the files were created accordingly.
If your folder looks like mine: You've done a great job! So you can already give yourself a pat on the back!
Now, to move on to the next step:
Adding Buttons and Commands:
Move back to the designer and add a few buttons like I've done. The buttons I've created will:
Back up the device
Restore the device
Install an app
Push a file
Now, we want to create four more forms. One for the backup, one for the restore, one for the install app and one for pushing a file.
Hit CTRL+SHIFT+A to add new items.
You can name the forms however you want.
I created some with pretty self-explaining names:
Now, double-click on each button in Form1 to create a new code block in the code file.
Once you have done that, copy the following codes into each code block.
Button1_Click
Code:
Backup.Show()
Me.Hide()
Button2_Click
Code:
Restore.Show()
Me.Hide()
Button3_Click
Code:
Install.Show()
Me.Hide()
Button4_Click
Code:
Push.Show()
Me.Hide()
Now open up the Backup form. We'll start here. You can close the Form1-files.
Start designing the form as you wish. Here's how I've done it:
If you're using the same design as me, you might want to use the same code.
NOTE: I rarely use the .Net components in the Toolbox. Only for static operations. For things like dialog boxes, I use pure code.
This is working code. I have debugged and tested!
Code:
Imports System.IO
Public Class Backup
Private Sub Backup_Load(sender As Object, e As EventArgs) Handles MyBase.Load
TextBox2.Text = "Backup_From_" & Date.Now.ToShortTimeString
If Not Directory.Exists(TextBox1.Text) Then
Directory.CreateDirectory(TextBox1.Text)
End If
End Sub
Private Sub Backup_FormClosing(sender As Object, e As EventArgs) Handles MyBase.FormClosing
Form1.Show()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim FolderBrowse As New FolderBrowserDialog
FolderBrowse.Description = "Select the destination of where you wish your backup to be saved to." _
& "Note: Please do not choose locations with spaces in the directories. These may cause errors!"
FolderBrowse.ShowNewFolderButton = True
Dim DialogRes As DialogResult = FolderBrowse.ShowDialog
If DialogRes = Windows.Forms.DialogResult.OK Then
TextBox1.Text = FolderBrowse.SelectedPath
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Shell("""ADB\adb.exe"" backup -f" & TextBox1.Text & "\" & TextBox2.Text & "-apk -system -full -all", AppWinStyle.NormalFocus, True, 30000)
End Sub
End Class
Once you have that done, move to the next form. This, in my case, is Restore.
To keep the thread clear, I'll carry on in post #2.
Ok, now let's get on with Restore.
Open up the file, and again, design it as you want.
If you're using the same design as me, it is advisory, that you use the same code.
Here is the code I used:
Code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim OpenFile As New OpenFileDialog
OpenFile.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.Desktop
OpenFile.Multiselect = False
OpenFile.Filter = "AB (Android Backups)|*.ab"
OpenFile.SupportMultiDottedExtensions = False
OpenFile.Title = "Select the Android Backup (*.ab) file to restore your device from..."
Dim DialogRes As DialogResult = OpenFile.ShowDialog()
If DialogRes = Windows.Forms.DialogResult.OK Then
TextBox1.Text = OpenFile.FileName
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Shell("""ADB\adb.exe"" restore " & TextBox1.Text, AppWinStyle.NormalFocus, True, 30000)
End Sub
Private Sub Restore_FormClosing(sender As Object, e As EventArgs) Handles MyBase.FormClosing
Form1.Show()
End Sub
And now we're ready to move to the third form. As usual; if you're using the same design as me, you'll want to use the same code as me.
I'd like to note: I'll explain all the code in post #3.
The third form (Install an App) will be a bit different than the others. Here, we'll give the user the opportunity to select an entire folder which contains .apk files and then with a mouse-click, the app will install the desired APK.
Note the ListBox, That is where all the APKs will be listed. (Hence the name 'ListBox'.)
I have pulled some APKs from my phone and have put them in a folder (C:\APKs). We will use this folder to list all the available APKs in the listbox.
But before we do that, here is the code for the form. Again, nothing is imported here.
Code:
Private Sub Install_FormClosing(sender As Object, e As EventArgs) Handles MyBase.FormClosing
Form1.Show()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim FolderBrowse As New FolderBrowserDialog
FolderBrowse.Description = "Select the folder containing your APK files."
FolderBrowse.RootFolder = Environment.SpecialFolder.DesktopDirectory
FolderBrowse.ShowNewFolderButton = False
Dim DialogRes As DialogResult = FolderBrowse.ShowDialog()
If DialogRes = Windows.Forms.DialogResult.OK Then
For Each Item As String In My.Computer.FileSystem.GetFiles(FolderBrowse.SelectedPath)
ListBox1.Items.Add(Item)
Next
End If
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Shell("""ADB\adb.exe"" install " & ListBox1.SelectedItem.ToString, AppWinStyle.NormalFocus, True, 30000)
End Sub
And here are some pictures of the code in action:
FolderBrowserDialog (FolderBrowse):
The list of apps (ListBox):
Ok. We're almost done with our One-Click utility!
We've only got one more form and we'll do that in a dash! Then I'll get to explaining what everything means. Though most of it is pretty much self-explanatory, I'd rather go over it.
Move on to the last form, and the same rules apply.
This form will be using the same method as the Install form - Using a ListBox to display files.
Here is the code:
Code:
Private Sub Push_FormClosing(sender As Object, e As EventArgs) Handles MyBase.FormClosing
Form1.Show()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim FolderBrowse As New FolderBrowserDialog
FolderBrowse.Description = "Select the folder containing the file/s you want to push to the device..."
FolderBrowse.ShowNewFolderButton = False
FolderBrowse.RootFolder = Environment.SpecialFolder.DesktopDirectory
Dim DialogRes As DialogResult = FolderBrowse.ShowDialog()
If DialogRes = Windows.Forms.DialogResult.OK Then
For Each Item As String In My.Computer.FileSystem.GetFiles(FolderBrowse.SelectedPath)
ListBox1.Items.Add(Item)
Next
End If
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
Shell("""ADB\adb.exe"" push " & ListBox1.SelectedItem & " " & TextBox1.Text, AppWinStyle.NormalFocus, True, 30000)
End Sub
Cool! We've got our first One-Click-Utility done in Visual Basic.Net! This is pretty awesome, don't you think? I may have to re-do this thread, but for the moment it'll do, I guess.
Move down to the third post, to read all about what what piece of code does.
What Does What Piece of Code Mean and do?
In this post, I'll go over what which piece of code does. The practical thing about Visual Basic, is that it uses a lot of words used in the English language. That means: If you can speak English fluently, you can code in Visual Basic quite decently.
But nevertheless, I'll go over each bit, and that bit by bit. Of course, if you have questions, I'm happy to answer.
What does 'Imports' Mean and do?
Imports
In Visual Basic, as in pretty much every other programming language, has references it uses to communicate to the OS (Operating System).
But, although referenced data is there, it is not entirely available to each form. So you must import that data to the form, where it is needed.
You can imagine 'Import' as if you were importing freight from another country - With the only difference, that you're importing data.
If you're familiar with C++, #includes <stdio.h> is the same as if you were using Imports System.IO in Visual Basic.
If, Else, ElseIf and End If
What will be explained here, is the If-Statement. Every programming and scripting language has an If-Statement - Even if it is used with a different name.
Basically, what an If-Statement does, is check whether specific criteria is met by a clause you typed.
For example:
Code:
If File.Exists("C:\HelloWorld.vb") Then
MessageBox.Show("The file exists!")
Else
MessageBox.Show("The file doesn't exist!")
End If
This piece of code checks if a specific file exists.
If it exists, it will throw a message box saying that the file exists. Else, it will throw a message box saying it doesn't exist. Make sense?
But then we have ElseIf.
Using ElseIf can make the code more precise.
For example: Imagine you have a form with a text box, and you want to determine whether that text box contains, say http:// or ftp://, you'd type something like this:
Code:
Dim Text As String = TextBox1.Text (We'll get to Dim in a moment)
If Text.Contains("http://") Then
MessageBox.Show("The text box contains http://")
ElseIf text.Contains("ftp://") Then
MessageBox.Show("The text box contains ftp://")
Else
MessageBoz.Show("The text box doesn't contain http:// or ftp://")
End If
End If basically just terminates the If-Statement. I don't have an example for this in C++, but I guess you guys are smart enough to get what I mean
What does Dim mean?
This is probably the easiest thing to explain, in this entire tutorial: All Dim does and means, is Declare. It declares a variable with a type.
I think in C++, you'd write something like
Code:
int a = 16;
Where the equivalent in VB is:
Code:
Dim a As Integer = 16
Sure, it's a bit more to write, but the code is easier to understand. Which is all VB is about: Easy coding.
For Each X As String In... Whaa?
Well, here we've gotten to a stage, which I only learned a few months ago, and I've been programming in Visual Basic for five years, now.
Basically, For Each is kind of like an If-Statement. It searches for specific criteria. If that criteria is met, the code will be executed.
I'll use an example from the program written above:
Code:
For Each Item As String In My.Computer.FileSystem.GetFiles("C:\Windows")
This searches for files (FileSystem.GetFiles("") ) and returns these to a variable (Item) as a string value.
Code:
Next
The Next statement tells the computer to move to the next piece of code.
And last but not least:
Shell? But wait.. I know that from somewhere, don't I?
Yup, you do! Shell is just a command prompt or terminal (Whatever you prefer). All it does, is it executes commands as the computer's shell and it gets a bit more low-level as other commands.
For example:
Code:
Shell("")
This would execute a simple program, without any command line arguments (Command Line Args).
Code:
Shell("""adb.exe"" install")
This would execute a specific file (In this case adb.exe) and would add a command line arg. Which gives you more flexibility and it allows you to interact with the shell-executable.
But the Shell Function can do more than that. It is also still a part of the program, which means it can still tell the program what to do.
For example:
Code:
Shell("""ADB\adb.exe"" install " & ListBox1.SelectedItem.ToString, AppWinStyle.NormalFocus, True, 30000)
This piece of code executes adb.exe, with a command line arg, but adds to the shell (CMD) window.
AppWinStyle: This determines how the CMD window is shown. In this example, we used NormalFocus, which puts the CMD window in the foreground and focuses on it. So the user can immediately interact with it, if necessary.
Where True is: True or False determine whether the program should wait until the shell operation is completed, before moving on to the next step of code. And ultimately, this is also what the integer (Whole number) behind it is for. The number (Must be an integer!) determines how long the program should wait until the program should execute the next line of code, in milliseconds.
And that was that, I guess.
If you feel I've missed something out, or you don't understand something, fell free to let me know and I'll it it to the list.
I'll add the project to my GitHub, so you can all download it.
Once I have the time, I'll re-design the posts, but at the moment, I think it'll do
(Mods: If you think I should, I'll do it right away! )
Downloads:
Download the source code (And pre-compiled binary) from my GitHub.
https://github.com/Beatsleigher/OneClickUtil
This is licensed under the GPL3.0, so feel free to do with it as you wish
I probably won't add to this project, but that should stop you!
Happy developing!
--- Reserved #4 ---
mfastboot.exe flash partition gpt.bin mfastboot.exe flash motoboot motoboot.img mfastboot.exe flash logo logo.bin mfastboot.exe flash boot boot.img mfastboot.exe flash recovery recovery.img mfastboot.exe flash system system.img_sparsechunk.0 mfastboot.exe flash system system.img_sparsechunk.1 mfastboot.exe flash system system.img_sparsechunk.2 mfastboot.exe flash modem NON-HLOS.bin mfastboot.exe erase modemst1 mfastboot.exe erase modemst2 mfastboot.exe flash fsg fsg.mbn mfastboot.exe erase cache mfastboot.exe erase userdata pause mfastboot.exe reboot
---------- Post added at 01:51 PM ---------- Previous post was at 01:48 PM ----------
Plz help me to execute above codes on a button press event
I know how to add mfastboot.exe
Quite useful thanks
coldflid said:
Quite useful thanks
Click to expand...
Click to collapse
You're welcome
I'm thinking of doing something similar for Java. Should keep people occupied
Looking forward to it
ADB Bruteforcer
I have made a Android Debugging Bridge 0000 to 9999 bruteforcer,
With this I will make a nice interface for it,
When I'm done, I will upload it somewhere at XDA.
Thanks 4 ur upload!
This just one of the great wonders. Nice Job .. Greeting from Mawcot Inc
dear @Beatsleigher first of all i wold like to thanks you for such a nice guide
i have some questions please answer it
1st. how to use multiple adb commands with one button
for example ( adb kill-server , adb start-server )
2nd how to print information to a textbox or label
for example if i want to see the connected adb devices and i use (adb devices ) so i want to print connected devices into a text box
thanks
zameer_yus said:
dear @Beatsleigher first of all i wold like to thanks you for such a nice guide
i have some questions please answer it
1st. how to use multiple adb commands with one button
for example ( adb kill-server , adb start-server )
2nd how to print information to a textbox or label
for example if i want to see the connected adb devices and i use (adb devices ) so i want to print connected devices into a text box
thanks
Click to expand...
Click to collapse
This is a pretty old thread to resurrect. I only saw your reply by chance.
I'm not an active member of this community anymore, just as with all tech-related things.
Those are rudimentary questions. If you're interested in programming, you should read up on some tutorials.
Everything you need to find the answers to those questions is written on MSDN.
Furthermore, the information provided in this thread is outdated. I recommend you check out @regaw_leinad's AndroidLib or my JDroidLib The documentation for both of these libraries can be found on my website.
Good luck with programming. Just don't read these tutorials and documentations and go from there.
Depending on which language you want to use, read the maintainer's website (e.g.: MSDN, or Oracle's JavaDoc) and read their tutorials. They'll teach you the basics, best practises, dos and donts, and more.
NOTE: I will not be providing support for this tutorial any longer. I have since moved on, and don't see any value in helping people make their lives more complicated than necessary. There are plenty libraries out there which allow you to do much more than I showed in this tutorial, and are easier for beginners, as they show you the best-practises of the language anyway.
Many many notes using the Notes app on the Mate 7. Is there any way to export these notes so I can transfer them to PC/ another phone?
You can press "Share" for each note and share it via E-mail, or alternatively you can share it to "Google Keep" which is also an app for taking notes made by google. With google keep you can sync your note across all your devices.
Another way is to backup your notes with the "Backup" app which came with the phone's software, or the "HiSuit" program which is the official application from Huawei to backup files on your PC.
Feel free to ask any question if anything wasn't very clear.
Thanks for your response-
Too many notes to share individually and I think I would need to share individually to migrate to Google Keep...?
I believe the Backup and Hisuit program store in a format that is only useful for restoring to the phone or another Huawei phone; I need to transfer notes to pc/another non-Huawei phone.
Please clarify if I've missed something here. Hope someone has a solution...
Thanks-
Sam
SAbboushi said:
Too many notes to share individually and I think I would need to share individually to migrate to Google Keep...?
Click to expand...
Click to collapse
Unfortunately, yes you need to transfer each one individually.
SAbboushi said:
I believe the Backup and Hisuit program store in a format that is only useful for restoring to the phone or another Huawei phone; I need to transfer notes to pc/another non-Huawei phone.
Click to expand...
Click to collapse
Yea that's true, it only works with Huawei phones.
Huawei's notes app doesn't have many features to try, it only allows to "share" each note individually, Yes that will take time but once you switch into Google keep, Evernote, OneNote ..etc you can sync your notes across all your devices.
hi there,
I lost all my notes from my huawei p9 lite after i format my phone.
My questio is where can I find my old saved notes? I backed upmy phone before reseting it, and i copied all my files in my PC.
Thanks for your help.
If anyone else struggles with transfering notes from their phone to a different device, you could use the cloud option, back up the notes in phone settings (Cloud section), and then login to : cloud.huawei.com where you will be able to copy-paste all the notes to your computer. I assume this is easier for most people than copy-pasting on phone.
Hi,
I had similar situation - a stock Huawei phone with stock notes app and a user trying to migrate to Xiaomi... So it happened as follows:
Export Huawei notes from cloud, using browser access
Create "Standard Notes" account
Convert Huawei exported notes into "Standard Notes" backup format
Import "Standard Notes" backup
Here are details of operation:
Login into your Huawei cloud on some browser (preferably on computer)
Choose to download your data, click on notes
It will generate ZIP with JSONs of every note (use 7z to extract, as unzip on Linux fails with error 99)
Create a "Standard Notes" account at https://app.standardnotes.org (basic account is free, FOSS app is available on F-droid, nice interface, e2e encrypted)
Add one "My test note WOO-HOO!" to your new account
Export "Standard Notes" backup (using computer)
It will also make you download ZIP file, with a structure inside, however you only need top level "Standard Notes Backup and Import File.txt" file, which is, in fact, a JSON
You can make your own solution or just use my Ruby code (attached) to convert into a Standard Notes backup format, please adjust path at line #11 to match your needs.
Run ruby (it converted 2000+ notes in a few seconds for me), redirect output into a file, remove array markers in the very beginning and very end (first and last "[ ]" symbols)
Carefully edit "Standard Notes Backup and Import File.txt" file, insert the JSON block generated by Ruby code. In my case, my test note started at line 102 and finished at line 119, so I inserted my JSON starting with line 120 (do not forget add one comma in the end of line 119)
Run resulting TXT file through jq or any other JSON validation tool to make sure everything is fine.
Import into your Standard Notes
Sorry to leave some manual work to do, however this is just one time operation.
Cheers!
chockophone said:
Hi,
I had similar situation - a stock Huawei phone with stock notes app and a user trying to migrate to Xiaomi... So it happened as follows:
Export Huawei notes from cloud, using browser access
Create "Standard Notes" account
Convert Huawei exported notes into "Standard Notes" backup format
Import "Standard Notes" backup
Here are details of operation:
Login into your Huawei cloud on some browser (preferably on computer)
Choose to download your data, click on notes
It will generate ZIP with JSONs of every note (use 7z to extract, as unzip on Linux fails with error 99)
Create a "Standard Notes" account at https://app.standardnotes.org (basic account is free, FOSS app is available on F-droid, nice interface, e2e encrypted)
Add one "My test note WOO-HOO!" to your new account
Export "Standard Notes" backup (using computer)
It will also make you download ZIP file, with a structure inside, however you only need top level "Standard Notes Backup and Import File.txt" file, which is, in fact, a JSON
You can make your own solution or just use my Ruby code (attached) to convert into a Standard Notes backup format, please adjust path at line #11 to match your needs.
Run ruby (it converted 2000+ notes in a few seconds for me), redirect output into a file, remove array markers in the very beginning and very end (first and last "[ ]" symbols)
Carefully edit "Standard Notes Backup and Import File.txt" file, insert the JSON block generated by Ruby code. In my case, my test note started at line 102 and finished at line 119, so I inserted my JSON starting with line 120 (do not forget add one comma in the end of line 119)
Run resulting TXT file through jq or any other JSON validation tool to make sure everything is fine.
Import into your Standard Notes
Sorry to leave some manual work to do, however this is just one time operation.
Cheers!
Click to expand...
Click to collapse
hello i can't find the ruby code...
mcnick50 said:
hello i can't find the ruby code...
Click to expand...
Click to collapse
Sorry mate, looks like I can't attach it successfully. Let me try to paste into the body... Hopefully it won't get transformed into a emoticons
#!/usr/bin/ruby
#
require "pp"
require "json"
require "securerandom"
#json_in = File.read("../Notes-2021050323205147761/Notes/20210401133344621/json.js");
s_notes = []
Dir.glob('../Notes-2021050323205147761/Notes/*/json.js').each do |j|
json_in = File.read(j)
json_hash = JSON.parse(json_in[11..-1]);
uuid = SecureRandom.uuid
text = json_hash["content"]["title"].to_s
created_u = json_hash["content"]["created"].to_s[0..9].to_i
modified_u = json_hash["content"]["modified"].to_s[0..9].to_i
created = Time.at(created_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
modified = Time.at(modified_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
title_length = json_hash["content"]["title"].to_s.index("\n")
title = ""
if title_length > 30
title = json_hash["content"]["title"].to_s[0..30]
else
title = json_hash["content"]["title"].to_s[0..title_length-1]
end
s_note = {
:uuid => uuid,
:content_type => "Note",
:content => {
:text => text,
:title => title,
:references => [],
:appData => {
"org.standardnotes.sn" => {
:client_updated_at => modified
}
},
: preview_plain => "" # DELETE SPACE BETWEEN : and the "p"...
},
:created_at => created,
:updated_at => modified
}
s_notes.push s_note
end
puts s_notes.to_json
chockophone said:
Sorry mate, looks like I can't attach it successfully. Let me try to paste into the body... Hopefully it won't get transformed into a emoticons
#!/usr/bin/ruby
#
require "pp"
require "json"
require "securerandom"
#json_in = File.read("../Notes-2021050323205147761/Notes/20210401133344621/json.js");
s_notes = []
Dir.glob('../Notes-2021050323205147761/Notes/*/json.js').each do |j|
json_in = File.read(j)
json_hash = JSON.parse(json_in[11..-1]);
uuid = SecureRandom.uuid
text = json_hash["content"]["title"].to_s
created_u = json_hash["content"]["created"].to_s[0..9].to_i
modified_u = json_hash["content"]["modified"].to_s[0..9].to_i
created = Time.at(created_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
modified = Time.at(modified_u).strftime('%Y-%m-%dT%H:%M:%S.%LZ')
title_length = json_hash["content"]["title"].to_s.index("\n")
title = ""
if title_length > 30
title = json_hash["content"]["title"].to_s[0..30]
else
title = json_hash["content"]["title"].to_s[0..title_length-1]
end
s_note = {
:uuid => uuid,
:content_type => "Note",
:content => {
:text => text,
:title => title,
:references => [],
:appData => {
"org.standardnotes.sn" => {
:client_updated_at => modified
}
},
: preview_plain => "" # DELETE SPACE BETWEEN : and the "p"... otherwise it becomes
},
:created_at => created,
:updated_at => modified
}
s_notes.push s_note
end
puts s_notes.to_json
Click to expand...
Click to collapse
Could you describe to me exactly how this ruby works, what it takes. i have 2000 notes and i can't convert as described you can't.
glehel said:
Could you describe to me exactly how this ruby works, what it takes. i have 2000 notes and i can't convert as described you can't.
Click to expand...
Click to collapse
You will need little experience with running things on command line (preferably Linux or Mac, but can also work on Windows). Basically, I already escribed all steps in the post above: export Huawei notes, export empty Standard Notes. Use ruby to transform Huawei notes into Standard Notes fragment, which you will have then manually copy-paste into empty SN backup form above.
chockophone said:
You will need little experience with running things on command line (preferably Linux or Mac, but can also work on Windows). Basically, I already escribed all steps in the post above: export Huawei notes, export empty Standard Notes. Use ruby to transform Huawei notes into Standard Notes fragment, which you will have then manually copy-paste into empty SN backup form above.
Click to expand...
Click to collapse
I tried running your code but I'm getting the following error
Traceback (most recent call last): 2: from Notes.rb:11:in <main>' 1: from Notes.rb:11:in each' Notes.rb:27:in block in <main>': undefined method >' for nil:NilClass (NoMethodError)
RajtheKing said:
I tried running your code but I'm getting the following error
Traceback (most recent call last): 2: from Notes.rb:11:in <main>' 1: from Notes.rb:11:in each' Notes.rb:27:in block in <main>': undefined method >' for nil:NilClass (NoMethodError)
Click to expand...
Click to collapse
I guess that in your case problem actually is on line 11. Please make sure you put correct file pattern there. Or maybe they changed format since then and there is no more title field present. In any case, if you run into issues, do not hesitate to PM me.
First off, I've been browsing here for some time, but I've just registered so I'm sorry if I'm breaking any etiquette or conventions on posting.
I ran across goofwear's tool to extract videos and photos from Samsung Motion Photos and thought it was useful. But I really wanted something that I'd be able to throw a whole album of motion photos at, rather than doing one at a time with this or the share app. I looked at the .bat file they used and implemented the same technique in C, so it could quickly process many photos. It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.
Here's the exe.
See the main page of that Github repository for more complete instructions and full source.
How to use:
1. Copy your Motion Photos off your Samsung phone, to your PC. Just copy them out of the DCIM folder.
2. Run the program. An "open" dialog appears. Apart from that there's no GUI on this program.
3. Browse to your photos and select them. Hold ctrl to select more than one, or shift to select a range. Or, ctrl+A to select all in a folder.
4. Click Open.
5. Wait. Depending how many you selected, it might take a little bit. When it's done, a message box will appear.
6. You should see *_photo.jpg and *_video.mp4 files next to the originals in the source directory. Note that this program does not modify the original files. It doesn't even open them with write permissions enabled.
Alternately, drag one or more photos from Windows Explorer onto the exe's icon instead of using the open dialog.
Screenshots:
{
"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"
}
Version History:
1.0: Initial release
1.1: Added optional compile-time option to delete the original file after extracting
2.0: Refactored a bit, added a proper build system, and multilanguage support; moved to a 'real' Github repo
2.1: It now preserves timestamps when making the extracted files, and now supports a -r flag to rename the original file instead of appending _photo and _video to the extracted ones.
Andylain has written a Chinese language explanation of the usage of this program, and kindly translated the UI to Chinese (Traditional). To use it in Chinese, either have your Windows set to Chinese language, or rename the exe to put _zh at the end of the name. To use it in English on a Chinese Windows, put _en at the end of the name.
If for some reason you want the old version exe, the old "delete-original" exe, or the old source code, you can still have them.
Can you help to make a version that delete the source after successfully exact?
@Andylain Here's one that deletes the original file after splitting it into photo and video.
Oops -- turns out it was smaller because I forgot to include the icon last time. I've updated the link now and it points at a new build that has an icon.
This is super helpful, Thank you! Oh, there is no beautiful icon in this version.
BTW, I am a Chinese blogger live in Taiwan, I blogged this tool and made a Chinese user guide in my blog "andylain‧blogspot‧com/2017/07/SamsungMotionPictureExtractor.html" .
(Sorry, I am a new user and not allowed to post link.)
If you think that's not a great idea, please tell me and I'll delete my post.
@Andylain Thanks for linking me to your post, and thanks for writing a Chinese explanation for how to use it. I'm happy for people to use my program if they find it useful.
Would a proper Chinese language version of the program be helpful, or are most people there able to read enough English to understand the few error and status messages the program has?
@Andylain Please update your link to the "delete original" version to this one. I forgot to include the icon when building it yesterday.
Chupi383 said:
@Andylain Thanks for linking me to your post, and thanks for writing a Chinese explanation for how to use it. I'm happy for people to use my program if they find it useful.
Would a proper Chinese language version of the program be helpful, or are most people there able to read enough English to understand the few error and status messages the program has?
Click to expand...
Click to collapse
I think it's not hard to understand the status messages
However, a proper Chinese language version of the program would be much more helpful for girls and elderly since Samsung sell a lot of pink S8/S7 for this target.
I really love this app (super helpful for me) and I am happy to translate it , but I don't know how to code BTW. :silly: (just a blogger/photographer)
---------- Post added at 12:55 PM ---------- Previous post was at 12:47 PM ----------
Chupi383 said:
@Andylain Please update your link to the "delete original" version to this one. I forgot to include the icon when building it yesterday.
Click to expand...
Click to collapse
Thank you for the update. I update the link to my blog and facebook fanpage
@Andylain I've extracted all the user-facing strings from my code. The text in [square brackets] are comments giving some context for the message that follows, and don't appear anywhere in the program.
Code:
=====
[this message is shown in a dialog box if you click cancel on the open photos dialog]
You can use this program 3 different ways:
GUI USE: Just run it. You'll get an file-open dialog where you can open .jpg files. Use ctrl or shift or drag to select more than one.
DRAG & DROP USE: Drag one or more motion photos onto the icon for this exe.
COMMAND LINE USE: Run this program with one or more motion photo file names as arguments. Remember to use "quotes" if there are spaces in the names.
Any way you run it, the original files will not be modified. The extracted photo and video will be stored in *_photo.jpg and *_video.mp4 where * is the name of the original file, minus the .jpg extension.
Coded by Chupi383. All credit for the method goes to goofwear at the XDA forums. I've just ported their .bat file to plain C and Win32.
=====
[this is the title of the program]
Samsung Motion Photo Batch Extractor
=====
[this is displayed in the open dialog, under the box where you can type a filename, in a drop-down list]
Motion Photos (*.jpg)
All Files (*.*)
=====
[this is the title bar of the open dialog]
Open some Samsung Motion Photos
=====
[this message is shown if the user selected a file with a really really long name]
Skipping too-long path: <filename goes here>
=====
[title bar for error dialogs]
Error
=====
[error if the user selects over the maximum number of files (currently 10000)]
You've selected too many files. I can only do up to 10000 at a time.
=====
[error if the user selects so many files the Windows "open" dialog box gives up]
You've selected too many files. Try selecting fewer files and process them in bunches.
=====
[appended to names of extracted files - not sure if these should be translated]
_photo
_video
=====
[error if enough memory couldn't be allocated, possibly because the computer is out of RAM]
Can't allocate RAM to read <number> bytes from <filename>
=====
[error if a file can't be read for some reason, perhaps a damaged disk]
Skipping due to read error:
<filename>
=====
[error if an output file can't be written, generally because of full disk, read only disk, file exists and is read only, or permissions on the folder]
Can't write to <filename>
=====
[message on completion]
Finished extracting Motion Photos
Photos extracted: <number>
Videos extracted: <number>
=====
[added to the end of the previous success message if some files didn't contain a photo and a video]
<number> files were skipped because they weren't Motion Photos
=====
[title bar of completion message if at least 1 file was processed successfully]
Success
=====
[title bar of completion message if nothing was done successfully]
Failure
=====
["description" shown in right-click->properties dialog for the exe file]
Extract Samsung Motion Photos to jpg and mp4
=====
["product name" shown in properties dialog for the exe file]
Motion Photo Batch Extractor Utility
If you translate these for me, I'll put them back into my program to make either a Chinese or multi-language version.
Here is the translation of Chinese, sorry for the delay of this reply.
BTW, maybe a dialog for user to choose whether delete original files would be a great idea?
Code:
=====
[this message is shown in a dialog box if you click cancel on the open photos dialog]
有三種方式可以使用本軟體:
一:點開軟體後選擇你要轉存的照片,你可以使用Ctrl或是Shift來多選檔案。
二:把你要的照片拖移到本軟體的icon上也能轉存!
三:你也能使用Command Line來處理喔! (記得用”quotes”取代空格)
請放心:無論你怎麼做,原始檔案都不會被修改。轉存成功的檔案將會存在原始檔案位置,並新增為 *_photo.jpg 和 *_video.mp4。
GUI軟體由Chupi383撰寫,軟體內核由XDA forums的goofwear撰寫,Andylain翻譯正體中文,詳細中文使用教學請上「安迪連碎碎念」。
=====
[this is the title of the program]
三星動態相片批次轉存工具
=====
[this is displayed in the open dialog, under the box where you can type a filename, in a drop-down list]
動態相片 (*.jpg)
所有檔案 (*.*)
=====
[this is the title bar of the open dialog]
開啟一些動態相片
=====
[this message is shown if the user selected a file with a really really long name]
已忽略太長的路徑:<filename goes here>
=====
[title bar for error dialogs]
發生錯誤
=====
[error if the user selects over the maximum number of files (currently 10000)]
你一次選太多檔案了。我一次只能處理一萬個檔案。
=====
[error if the user selects so many files the Windows "open" dialog box gives up]
你一次選太多檔案了。嘗試選少一點檔案吧!
=====
[appended to names of extracted files - not sure if these should be translated ]
_photo
_video
=====
[error if enough memory couldn't be allocated, possibly because the computer is out of RAM]
記憶體定位錯誤,無法讀取 <number> bytes 上的 <filename> 檔案,有可能電腦的RAM不足。
=====
[error if a file can't be read for some reason, perhaps a damaged disk]
由於讀取錯誤,已跳過處理:
<filename>
=====
[error if an output file can't be written, generally because of full disk, read only disk, file exists and is read only, or permissions on the folder]
無法寫入 <filename> 可能目的地已滿或是為唯讀。
=====
[message on completion]
動態相片轉存結果:
有 <number> 張照片輸出成功!
有 <number> 個影片輸出成功!
=====
[added to the end of the previous success message if some files didn't contain a photo and a video]
<number> 個檔案被跳過了,因為它們不是三星動態相片。
=====
[title bar of completion message if at least 1 file was processed successfully]
轉存成功
=====
[title bar of completion message if nothing was done successfully]
轉存失敗
=====
["description" shown in right-click->properties dialog for the exe file]
批次把三星動態相片轉存成JPG照片和MP4影片!
=====
["product name" shown in properties dialog for the exe file]
動態相片轉存工具
[/CODE]
I'm sorry I'm being slow on this. My work has been especially busy lately. This thread isn't forgotten -- I'll make the translated app once I'm over this hump in workload.
Chupi383 said:
I'm sorry I'm being slow on this. My work has been especially busy lately. This thread isn't forgotten -- I'll make the translated app once I'm over this hump in workload.
Click to expand...
Click to collapse
That is very nice of you to do this!
Take your time and I am willing to help!
@Andylain Thank you for the translation! I've finally got a working bilingual exe -- see the original post. Sorry it took a while.
The "delete original" feature is now built into the main exe. You use the /d command line option to activate it. To make a drag-and-drop icon that will delete the original, right-drag it and create shortcut. Then right click the shortcut, go to properties, shortcut tab, and add a space and /d to the end of the target, after the closing quote.
BTW, if you could, please link people to "https://github.com/joemck/ExtractMotionPhotos/releases/latest" to get the exe -- that's a special link that will always go to the latest version I've posted there.
Coming up, I'd like to add an option to add/remove Explorer context menu integration.
This is absolutely amazing. Thank you so much!!
Chupi383 said:
First off, I've been browsing here for some time, but I've just registered so I'm sorry if I'm breaking any etiquette or conventions on posting.
I ran across goofwear's tool to extract videos and photos from Samsung Motion Photos and thought it was useful. But I really wanted something that I'd be able to throw a whole album of motion photos at, rather than doing one at a time with this or the share app. I looked at the .bat file they used and implemented the same technique in C, so it could quickly process many photos. It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.
Here's the exe.
See the main page of that Github repository for more complete instructions and full source.
How to use:
1. Copy your Motion Photos off your Samsung phone, to your PC. Just copy them out of the DCIM folder.
2. Run the program. An "open" dialog appears. Apart from that there's no GUI on this program.
3. Browse to your photos and select them. Hold ctrl to select more than one, or shift to select a range. Or, ctrl+A to select all in a folder.
4. Click Open.
5. Wait. Depending how many you selected, it might take a little bit. When it's done, a message box will appear.
6. You should see *_photo.jpg and *_video.mp4 files next to the originals in the source directory. Note that this program does not modify the original files. It doesn't even open them with write permissions enabled.
Alternately, drag one or more photos from Windows Explorer onto the exe's icon instead of using the open dialog.
Screenshots:
Version History:
1.0: Initial release
1.1: Added optional compile-time option to delete the original file after extracting
2.0: Refactored a bit, added a proper build system, and multilanguage support; moved to a 'real' Github repo
Andylain has written a Chinese language explanation of the usage of this program, and kindly translated the UI to Chinese (Traditional). To use it in Chinese, either have your Windows set to Chinese language, or rename the exe to put _zh at the end of the name. To use it in English on a Chinese Windows, put _en at the end of the name.
If for some reason you want the old version exe, the old "delete-original" exe, or the old source code, you can still have them.
Click to expand...
Click to collapse
Thanks
Just wanted to add my thanks for this fantastic tool.
I can't quite believe there's no official Samsung Motion Photo viewer (The Windows app doesn't appear to play Motion Photos). And there's practically no 3rd party support around for what you would think would be in high demand.
So I registered on XDA to show my appreciation. Thanks again.
Chupi383 said:
It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.
Click to expand...
Click to collapse
I also wanted to say thanks! That program is a wish-come-true! I wanted to create some script to batch-process JPG's and extract videos but that .exe is even better.
I have just one suggestion. Would you be able to modify program to set video's
Windows date modified
and maybe even date taken (EXIF) attributes
values to correct date, not current date when the extraction takes place?
It would help a lot, because Gallery apps or cloud services like Google Photos shows videos sorted / grouped by the date attribute which is different thandate of photo (when you extract old photos from last couple of months you will have a mess).
For now only way is to use some bulk date changer software to fix that - changing dates based on filename pattern, but it would be a nice feature for your exe. Do you think it's doable?
And yes. I created my XDA account just to say thank you for your great program!
Thanks a lot for this tool, Chupi383!
I'd like to "vote" for konieckropka's suggestion as well. Having the corrent timestamps on the extracted images and videos would be important for a correct file management.
The tool basically needs to read the original "modified timestamp" and set it to the created files (same for "created timestamp").
Could this please be added?
Fair point. I'll add it in a bit when I have the time.
Sorry for the delay, guys. I've added timestamp preservation and a -r flag to rename the original instead of adding _photo and _video. You can use -dr to delete the original and don't append _photo or _video to the extracted files.
This is super helpful, Thank you!
Chupi383 said:
Sorry for the delay, guys. I've added timestamp preservation and a -r flag to rename the original instead of adding _photo and _video. You can use -dr to delete the original and don't append _photo or _video to the extracted files.
Click to expand...
Click to collapse
Works perfectly now! THANKS A LOT!!
Heyho together,
after my P9-Lite and P10-Lite toolkit i thought, it's time to build a more generic version. Here it is, the ADB-Overlay!
The main point of this project is to serve a GUI for ADB. Currently, there is a File-Explorer, Remote-Desktop, Shell interface and APK installer implemented. You can also READ the contacts if your device is rooted and has sqlite3 installed. But a picture tells more as 1000 words... So here is a preview of what you'll get.
{
"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"
}
But anyways, i'm not responsible for any damage done to your device! For example, if you delete some files/folders on root lvl etc.
Component Info
Remote-Desktop:
Left-Click = Touch
Right-Click = Swipe with duration
The keyboard is nearly fully supported, i have written a kind of WPF -> Android key-mapper. So even combos like SHIFT+A-Z, SHIFT+0-9, ALT+A-Z and ALT+0-9 should work. The base for the key-mapping is a 102 keys keyboard with en-GB or de-DE layout. If you have another setup, some keys may on other positions.
The screenshots will be created under "ADB-Overlay\Screenshots\Screenshot.yyyy-MM-dd_HHmmss.(bmp | gif | jpg | png | tiff | wmp)".
-
If the device is booted in the recovery, the Remote-Desktop is only a viewer, because the recoveries doesn't support "input tap x y" nor "input keyevent XXX".
Shell:
The input box supports CTRL-A-Z, so you'll have the ability to send for example CTRL+C to stop a remote process. If you want use Copy & Paste onto the input box, use the Right-Click menu.
Tested OS
Win 7 | 8 | 8.1 | 10 | 11 (32Bit/64Bit in VM-Ware)
Win 7 | 8 | 8.1 | 10 | 11 (64Bit Native)
Tested Devices
Android Emulator some Versions (min. 2.x) in AVD
Android x86
HTC Sensation -/ XE (non-/rooted)
HTC One M9 (non-/rooted)
Huawei P9 Lite (VNS-L21, 22, 23, 31, etc.) (non-/rooted)
Huawei P10 Lite (WAS-LX1A, etc.) (non-/rooted)
Huawei Mate 9 (THX to @Tecalote)
Huawei Mate 10 Lite (THX to @Chisetdel31260)
Huawei P9 (EVA-al10) (THX to @reynard1)
Sony Xperia X (THX to @FoxTheLegend)
Pixel 4 (THX to @squabbi)
Requirements
Android: min. 2.x
Platform: x86/x64 (Windows)
Frameworks: min. .NET 6 / .NET 6 Desktop Runtime x86/x64
(Installed ADB/Fastboot driver)
Download
Mirror: See attachments
Mirror #1: My FTP [USR/PW=ADB-Overlay]
Mirror #2: GoogleDrive
Mirror #3: Dropbox
Mirror #4: Mega
DO NOT MIRROR MY FILES! DO NOT COPY MY THREADS!
Bug-Tracker
If you can't use the SDK-Updater or the Version is 0.0, just close the ADB-Overlay delete the "platform-tools" directory and restart the ADB-Overlay.
If the device won't connect via W-/Lan, check which version of android you are running... the latest version "SP2A.220505.002, May 2022" seems to break "Developer settings -> USB-Debugging -> Debug over W-/Lan"... To get it working anyways, just open a cmd prompt in the "platform-tools" folder, connect your device via USB and execute the following command: "adb tcpip 12345" (or some other port). After that, you should be able to connect your device via W-/Lan.
App Freeze
If the ADB-Overlay freezes during startup or by connecting a rooted device, the solution is to update the su binary. I encountered this problem yesterday on an older device running Android N. After an update to Magisk Canary [build 21005] the problem was solved.
Changelog
DD.MM.YYYY | (A) = Added | (C) = Changed | (D) = Deleted | (F) = Fixed | (R) = Recoded | (U) Updated
----------------------------------------------------------------------------------------------------------------------------------------------------
30.04.2022 [2.2.2.0]
(F) The SDK updater.
27.04.2022 [2.2.1.0]
(F) A freeze which occured on some FTP-Servers which doesn't implement RFC 959 properly.
11.04.2022 [2.2.0.0]
(U) General improvements in terms of speed and connectivity.
(U) The FTP config is now AES-256 encrypted for better security.
29.11.2021 [2.1.0.0]
(U) To .Net 6
(U) General improvements in terms of speed and connectivity.
25.07.2021 [2.0.2.0]
(A) ADB-Sideload
(U) ADB and Fastboot binaries.
(F) Some transfer issues (Binary <-> Socket)
(F) The platform-tools updater.
12.01.2021 [2.0.1.0]
(F) All freezes on the Tree-/ListView.
(A) ColumnHeader sorting on the Explorer and Apk-Manager ListView.
(A) Sort options for all header not only Name, Size, Date and Type.
(C) Sorting happens now in the background (So no more freezes here too.).
.-Older changes-.
12.12.2020 [2.0.0.0 - .Net 5]
Switched to .Net 5.0
(F) FTP-Updater timeout issue
(C) Brotli compression to .Net native
17.09.2020 [1.18.46.0]
(A) sendrecv_v2 for Android 11
(A) Brotli compression for file transfers on Android 11
29.03.2020 [1.17.46.0]
(A) Cut (via Context-Menu and "Ctrl+X")
(A) Copy (by default and via Drag'n'Drop by holding "Ctrl" during drop)
(A) Move (via Drag'n'Drop by holding "Shift" during drop)
(NOTE: Move is now enabled for on-device, device-to-device, local-to-device and device-to-local transfers.)
(C) The copy window, it will now display "Copy" or "Move" depending on the current operation.
16.03.2020 [1.16.46.2]
(F) The updater buttons, now they are also disabled during an download/check.
15.03.2020 [1.16.46.1]
(F) File/Folder interaction with those which contains "\s _ - ' , * & ~ | < > ( ) [ ] { }" in their names.
07.03.2020 [1.16.46.0]
(C) The synchronous IO to fully asynchronous IO.
(A) The Edit-Window, this will temporary download the file and open it locally in an application defined for this file type or with the "OpenAs" dialog.
(C) The UI, buttons which can't be used are now "grayed out".
12.02.2020 [1.15.46.1]
(F) The re-connection bug on the FTP-View. (Which also caused the updater to fail.)
(F) The (2 sec) freezes after copy/delete/tar.
(C) The info bar, added the modify date.
31.01.2020 [1.14.46.0]
(F/A) The timestamps for access, changed, modify.
(C) The "Properties Window", added the mentioned fields and resized the height a bit.
(A) Create File on the FTP-View.
30.12.2019 [1.13.46.0]
(F) The FTP TLS/SSL problem, now all procedures (implicit/explicit) should work without problems. (I tested this the last days with multiple servers, also the proxy's socks4/a|5 should now work with TLS/SSL.)
(U) All 3 explorers, they relay now on an shared generic base explorer which implements most of the features for all 3 views. So it's guaranteed that all views will behave the same.
(U) All 3 explorer views, changed the spacing's and the "edit textbox" (on rename) a bit, so that they look a bit more like the default explorer.
(A) IComparable<T> and IEquatable<T> to all List-/TreeViewItems so you get a pre-sort during item parsing. (I thought it would work a bit nicer, but hey, now it's implemented^^)
(R) Optimized the item (file/folder) parser for both Android & FTP.
18.12.2019 [1.12.46.1]
(F) The broken SDK-Updater, where you saw in the log file a "BindingException".
(F) The "SocketException" on app close. Reason for this was, that i disposed the "DeviceMonitor" after i killed the adb-server, but the monitor tried to check in some cases (10 sec refresh rate) for changes, after the server was already down.
(A) The "remount" option for mounts to the properties window. (You'll get also a little warning, each time you attempt to remount a mount point.)
(C) Resized the properties and the updater windows a bit.
17.12.2019 [1.11.46.0]
(F) The remote desktop for 16-Bit devices.
(R) Root detection
(R) Mount detection (added support for Android 2.x)
(R) The properties view, as mentioned, there is now a more valuable overview.
14.12.2019 [1.10.46.0]
(A) A version banner to the title bar.
(R) Nearly the whole caching logic inside the local ,Android and FTP explorer.
(R) The mount ([Device]) overview, now you'll see all mounts returned from "mount" and the assigned "df" data, if available. (The next build will include a more valuable overview in the PropertiesWindow. Like the mount options etc.)
(R) The remote desktop, i moved the "color correction" inside the pixel-buffer copy process. This will save a lot of time and boost the FPS in my TWRP up to 80++ per sec.. (That was so much, that .Net even couldn't dispose the sockets so fast as i requested a new one... This ended in an waiting queue overflow... So i decided to limit the FPS to 30-40 this is enough to have a clean view.) - Also NOTE: BOOTED IN ANDROID, WILL DECREASE THE FPS TO 2-3 DEPENDING ON THE RESOLUTION OF YOUR DEVICE! THE ONLY SOLUTION FOR THIS IS, START ADB WITH ROOT RIGHTS. (I added a internal switch, which will detect if adb runs as root, if so, i don't relay on the frame-buffer-service of adb. Instead, i use the bare metal (/sys/class/graphics/fb0/) to get the correct buffer values and then i read directly from "/dev/graphics/fb0".) AGAIN, NOTE: THIS WILL NOT RAISE THE FPS UP TO 80++, BUT THE FPS WILL INCREASE UP TO 15-25.
11.12.2019 [1.9.46.1] (HotFix)
(A) The mistakenly removed overwrite protection on item rename. (Android)
(R) The Copy & Delete view, the media-scanner, if activated, will now only run once at the end of an copy or delete action.
(R) Sym-/Directory/File detection, there was in rare cases a wrong detection where a SymDirectory was treated as an SymFile.
(F) The "Create New Textfile" action. (Android)
10.12.2019 [1.9.46.0]
(F) An ArgumentNullException which was raised during "mount" parsing. (On the "device" view.)
(F) The renaming issue, where you got, "The element couldn't be renamed!", if the name hasn't changed.
(A) Windows shortcuts to the TreeView of the Windows explorer. (Even the original one hasn't that feature )
(A) Hiding the ".lnk" extension on any Windows shortcut.
(A) Internal auto updates to the remote explorers (Android/FTP). So you have a kind of "pseudo" FileSystemWatcher.
(A) The re-sorting of the items after an rename action.
(D) Some code duplication. (Saved all together ~12 kb)
(R) Unnecessary refreshes and replaced them with internal cache logic's.
02.12.2019 [1.8.46.0]
(F) An ObjectDisposedException which was sometimes raised after symlink parsing and/or file transfers.
(C) The channeling on the ADBSocket, from an ConcurrentDictionary to an simple array with locks, this increased the transfer speed.
(U) The dlls to the latest versions.
24.07.2019 [1.7.46.0]
(R) The config files, both, the config.xml and the config.ftp.xml got an structure update. The old/current config files will be migrated to the latest version. So there should be no data loss in any way.
(A) A version banner to the Android and FTP view
(C) The adb directory from "ADB-Overlay\adb" to "ADB-Overlay\platform-tools"
(A) The SDK-Updater
(A) Auto-SDK-Update - If activated, this will check once every 24h for an update, but only on startup of the ADB-Overlay. (NO Tasks or something)
Info
The updater will only check "https://dl.google.com/android/repository/repository-11.xml". This XML gets downloaded and parsed, if the "platform-tools" version is newer as the used one, you'll get an popup which offers the download for the latest version.
The Auto-SDK-Update is by default disabled.
28.06.2019 [1.6.46.0]
(F) A memory leak which occurred by removing a device (Android View -> Closing an tab)
(F) A memory leak which occurred by removing a server (FTP View -> Closing an tab)
(R) Improved the directory parsing speed
(A) A progress bar to the copy window (green during transfer and on completion | red on failure or cancellation)
04.06.2019 [1.5.46.0]
(C) The versioning:
1 = Major
5 = Minor
46 = Framework Version (4.6)
0 = Hotfix
(A) A few speed improvements to the Remote-Desktop.
(A) The updater/-menu
(A) Auto-Update - If activated, this will check once every 24h for an update, but only on startup of the ADB-Overlay. (NO Tasks or something)
Info
The updater will only check my FTP for a ".version" file. This gets downloaded and parsed, if the version is newer as the used one, you'll get an popup which offers the download for the latest version. (NO logs and NO telemetry!)
The Auto-Update is by default disabled.
28.05.2019 [0.0.0.5]
(A) The "APK Manager" to the Android -> Tools menu
(A) {<-} & {->} buttons to the addressbar
(A) The "Install" option to the remote explorer -> ListViewItem context menu (only shown if the item is a apk)
(R) Added the missing options to the APK Installer (e.g. Downgrade, Test-Package, etc.)
(R) Optimized the "symlink" parsing
01.05.2019 [0.0.0.4]
(F) An exception which was raised after you tried to open any "Tool" on an disconnected device.
(A) A Battery Monitor to the Android -> Tools menu
29.04.2019 [0.0.0.3]
(A) Remote-Viewer when booted in the recovery
(A) A screenshot format selector (bmp | gif | jpg | png | tiff | wmp) to the Remote-Desktop
(A) A color correction switch to the Remote-Desktop
(A) Links to the German forum post
20.04.2019 [0.0.0.2]
(F) An issue during item renaming - Reason was maybe the switch from .NET 4 to .NET 4.6, seems the UI updates on textboxes are no longer only on focus got/lost, instead they are now after any change.
(A) Contextmenu (Listview) -> New -> Text Document
(A) Replacements for "New Directory", "Group (New)", "Server (New)" to the german language, so you get now after such an action the correct "Neuer Ordner", "Neue Gruppe", "Neuer Server".
(C) The FTP Copy/Delete action, you can now close the control connection and leave only those windows open until they are done. Both, the Copy and Delete action using now their own connection which is no longer bound to the control connection.
(C) Moved the "Keep Alive" checkbox (FTP -> Servermanager -> Account) to FTP -> Servermanager -> Connection
13.04.2019 [0.0.0.1]
Initial release
Great job. my huawei mate 10 lite is recognized. currently my smartphone is on rom original stock rne - l21c432b340 emui 8.0 not rooted. and my PC is a windows 7 64.
Works for my Xperia X - and thanks for your help!
I'm flattered to be in your contacts screenshot I was still using your prototype you had sent to me years ago!
Works very well on my Pixel 4!
squabbi said:
I'm flattered to be in your contacts screenshot I was still using your prototype you had sent to me years ago!
Works very well on my Pixel 4!
Click to expand...
Click to collapse
Hey Bro
long time not seen. Hehe yeah the good old Multi-Explorer ;p - Still using it my self, it's more or less my playground before i implement things in this tool.
If you want and have some spare time we can modify this beauty. I also reworked nearly the whole AndroidCtrl.dll, there you have now solid filestreams, strongly typed FilesystemInfos (Like the one from the .NET fw) and lots of other handy stuff. Like framebuffer access in Android and recovery mode. I also implemented a ADBridge class which is an instanced wrapper for the 2 static ADB classes (binary/socket).
Best Regards,
Sebastian
this is what im looking for a while
Thank you very much
here is some suggestion
1.better ui
2.edit build prop in the realtime
btw my phone is Huawei P9(eva-al10) rooted android 8.0 work very well
k1ll3r8e said:
Hey Bro
long time not seen. Hehe yeah the good old Multi-Explorer ;p - Still using it my self, it's more or less my playground before i implement things in this tool.
If you want and have some spare time we can modify this beauty. I also reworked nearly the whole AndroidCtrl.dll, there you have now solid filestreams, strongly typed FilesystemInfos (Like the one from the .NET fw) and lots of other handy stuff. Like framebuffer access in Android and recovery mode. I also implemented a ADBridge class which is an instanced wrapper for the 2 static ADB classes (binary/socket).
Best Regards,
Sebastian
Click to expand...
Click to collapse
Sounds great! I'm looking to get back into toolkit making later this year, I'm keen to see the improvments to your library! :good:
Great job. we can navigate and copy files efficiently.
Only one thing is missing. Why not keep file timestamp for last access and modifie dates? or let us choose the option to keep it or not.
skyrail01 said:
Great job. we can navigate and copy files efficiently.
Only one thing is missing. Why not keep file timestamp for last access and modifie dates? or let us choose the option to keep it or not.
Click to expand...
Click to collapse
Heyho,
which Android version are you using and on which action (pull/push) does the timestamps get lost?
Normally i preserve the timestamps but on some Android versions the "timestamp" field in the ADB-Protocol is ignored.
Maybe i can set the timestamps on an other way, but therefore i need to know the version.
Regards,
Sebastian
PS:
Some code where i set the timestamps
Upload
Code:
public void Close(DateTime fileCreationTime)
{
if (_ch?.IsConnected ?? false)
{
if (CanWrite)
{
int o = 0, w;
byte[] d = new byte[8];
d.SetUInt32LE((UInt32)SyncCmd.DONE, 0);
d.SetUInt32LE(ToUnixTime(fileCreationTime), 4);
//...
}
_ch.Close();
}
}
Download
Code:
//...
using (FileStream dfs = destination.Open(FileMode.Create, FileAccess.Write))
{
using (AFileStream sfs = OpenRead())
{
sfs.CopyTo(dfs, DMAX, msg, cancellationToken);
ct = sfs.CreationTime;
}
}
//...
if (msg.State == TransferState.Done)
{
destination.CreationTime = ct;
transferEventHandler?.Invoke(Client.ID, new FileTransferEventArgs(Client.ID, msg));
return true;
}
//...
Thank you really great program keep it up
Hey,
I am operating under lineageOS 16 on Galaxy S5 (klte), using adb 1.0.39 on windows 10 64-bits, either via wifi or usb connect.
I check file dates under Windows, in console mode with far manager (M: last write time, C: creation time, A: last access time).
I am using linux command ls -l under adb shell from Windows command line to list files pushed to Android.
When pushing files from Windows to Android, only M is preserved, with a 2 hours offset (ES file explorer tells it is modified date) Maybe daylight issue or bad timezone.
When pulling files from Android, only C is preserved
When I pull back to Windows, files pushed to Android, all original date is lost.
But I am pretty sure we can preserve last access, modified and creation date as I could see Adbexplorer (another project) pull files keeping M and A (adb pull -a).
Hope I give you enough details.
k1ll3r8e said:
Heyho,
which Android version are you using and on which action (pull/push) does the timestamps get lost?
Normally i preserve the timestamps but on some Android versions the "timestamp" field in the ADB-Protocol is ignored.
Maybe i can set the timestamps on an other way, but therefore i need to know the version.
Regards,
Sebastian
PS:
Some code where i set the timestamps
Upload
Code:
public void Close(DateTime fileCreationTime)
{
if (_ch?.IsConnected ?? false)
{
if (CanWrite)
{
int o = 0, w;
byte[] d = new byte[8];
d.SetUInt32LE((UInt32)SyncCmd.DONE, 0);
d.SetUInt32LE(ToUnixTime(fileCreationTime), 4);
//...
}
_ch.Close();
}
}
Download
Code:
//...
using (FileStream dfs = destination.Open(FileMode.Create, FileAccess.Write))
{
using (AFileStream sfs = OpenRead())
{
sfs.CopyTo(dfs, DMAX, msg, cancellationToken);
ct = sfs.CreationTime;
}
}
//...
if (msg.State == TransferState.Done)
{
destination.CreationTime = ct;
transferEventHandler?.Invoke(Client.ID, new FileTransferEventArgs(Client.ID, msg));
return true;
}
//...
Click to expand...
Click to collapse
skyrail01 said:
Hey,
I am operating under lineageOS 16 on Galaxy S5 (klte), using adb 1.0.39 on windows 10 64-bits, either via wifi or usb connect.
I check file dates under Windows, in console mode with far manager (M: last write time, C: creation time, A: last access time).
I am using linux command ls -l under adb shell from Windows command line to list files pushed to Android.
When pushing files from Windows to Android, only M is preserved, with a 2 hours offset (ES file explorer tells it is modified date) Maybe daylight issue or bad timezone.
When pulling files from Android, only C is preserved
When I pull back to Windows, files pushed to Android, all original date is lost.
But I am pretty sure we can preserve last access, modified and creation date as I could see Adbexplorer (another project) pull files keeping M and A (adb pull -a).
Hope I give you enough details.
Click to expand...
Click to collapse
Heyho,
THX for that info, i'll check the "adbd" source which LOS uses, maybe there is the prob. According to "adb pull -a" i'll also have a look at the adb source, because i think they do some "touch" stuff. Because the ADB-Protocol it self only supports creation/last modified time. In the source is a another "struct" for "STA2" (stat 2) command. But i have never seen a adb binary which supports this. (All binaries use the "STAT" command.)
EDIT 1:
Just checked the adb source again, seems they changed it a bit...
(This is the current STAT (v1) header)
Code:
# cmd name STAT or STA2 // 4 bytes
st->st_mode = msg.stat_v1.mode; // 4 bytes
st->st_size = msg.stat_v1.size; // 4 bytes
st->st_ctime = msg.stat_v1.mtime; // 4 bytes
st->st_mtime = msg.stat_v1.mtime; // 4 bytes
My HTC-One M9, Sensation, VM-Ware (Kitkat - Nougat) none of them has a 20 byte header. ALL of them return a 16 byte header.
Code:
CMD // 4 bytes
Mode // 4 bytes
Size // 4 bytes
CTime // 4 bytes
So it seems the protocol is highly inconsistent... I'll check how much time gets lost by calling touch on each file, because, currently i open a sync channel via an smart-socket, transfer the file and read all data provided by the protocol header. This is really fast, but if i have to spin up each time another channel to get a shell for the touch, this will increase the time each copy needs. Because, a shell depending on the version (v1, v2), has a lot checks you need to perform, specially the shell_v2 because it's like a ssh protocol.
EDIT 2:
Just for completeness, i'm pretty sure your device also sends only a 16 byte header for the stat v1 command, because:
(This is a cut of my implemented "Stat(byte[] bytes)" class)
Code:
if (c == (uint)SyncCmd.STA2 && bytes.Length >= 72)
{
ID = SyncCmd.STA2;
Error = bytes.GetUInt32LE(4);
Dev = bytes.GetUInt64LE(8);
INode = bytes.GetUInt64LE(16);
Mode = bytes.GetUInt32LE(24);
NLink = bytes.GetUInt32LE(28);
UID = bytes.GetUInt32LE(32);
GID = bytes.GetUInt32LE(36);
Size = bytes.GetUInt64LE(40);
ATime = bytes.GetInt64LE(48);
MTime = bytes.GetInt64LE(56);
CTime = bytes.GetInt64LE(64);
}
else if (c == (uint)SyncCmd.STAT && bytes.Length == 16)
{
ID = SyncCmd.STAT;
Mode = bytes.GetUInt32LE(4);
Size = bytes.GetUInt32LE(8);
CTime = bytes.GetUInt32LE(12);
}
As you can see, the both structures differ in there field order, if your device would send a 20 byte header, the test (bytes.Length == 16) wouldn't match. And you couldn't download a file.
EDIT 3:
After playing a while with "stat" and "touch" on some Android versions, i decided to rely on those functions. The next build should restore and write the correct timestamps.
EDIT 4:
Well, setting timestamps on the SD-Card doesn't work, also, setting timestamps on the "internal" SD-Card doesn't work either. Seems that it's related to the underlying FS. If i try to set the timestamp on an ext4 partition, it works. So it doesn't make sense to rewrite the push/pull functions because the return of touch for 99% of the time will be "touch: '/sdcard/TWRP/test.pdf': Operation not permitted". So it's simply a time waste during the copy procedure. BUT, i'll implement it at least for the download, so u'll get the correct timestamps on Windows.
EDIT 5:
Added a screenshot of the new "Properties Window" which also proves that the download timestamps are now correct.
(Btw. C doesn't mean created - it means changed)
Code:
stat /sdcard
File: `/sdcard' -> `/storage/self/primary'
Size: 21 Blocks: 0 IO Blocks: 512 symbolic link
Device: 1h/1d Inode: 4432 Links: 1
Access: (777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 1970-01-01 01:00:00.000000000
Modify: 1970-01-01 01:00:00.000000000
Change: 1970-01-01 01:00:00.360063176
Little update about the "creation time". After a bit research i found this post on Stack Exchange, there is explained that the so called "birth time" is stored since ext4 as part of the INode field. But it seems you need a special version of "stat" to read this info, it's called "statx". But so far i could see, Android doesn't support this feature, maybe some kernel does but it seems that it's more the rare case.
Regards,
Sebastian
Thanks for the update!
I was wondering what could be causing a small delay in copying files over, once the progress finishes, the transfer dialog remains frozen for a 1-2 seconds. I'm copying over a photo, so around 2MB.
squabbi said:
Thanks for the update!
I was wondering what could be causing a small delay in copying files over, once the progress finishes, the transfer dialog remains frozen for a 1-2 seconds. I'm copying over a photo, so around 2MB.
Click to expand...
Click to collapse
Heyho ,
yup i still working on it. It seems that the "Task.Delay()" isn't performed inside the Task itself, instead it's executed on the main thread. The reason for the freeze is, that i try to show the last result, otherwise the copy window would close immediately after the last element and you couldn't see if it's transferred or not. So i keep it like windows, wait 1,5-2,5 sec before closing the window.
The delay you might feel extremely is the "Media-Scanner". It runs on the end of each copy/delete action, the reason for this is, that files pushed/copied by adb are not reported to the MTP interface. So you couldn't see those files if you connect your device after such an adb copy via MTP. Also files/folders deleted by adb are also not reported to the MTP interface. So you will see those elements via MTP if you don't perform manually the "Media-Scanner" lookup. - But if you work only with adb for example, you could turn the "Media-Scanner" off. All device based explorers and of course adb will see those files/folders at any times. (But if you need those files/folders for exchange you should keep the "Media-Scanner" on )
EDIT:
This is executed for every file which is copied/pushed/deleted.
Code:
_adb.Device.Manager.ActivityManager.Broadcast("android.intent.action.MEDIA_SCANNER_SCAN_FILE", "-a", string.Concat("-d 'file://", remotePath, "' > /dev/null"));
EDIT 2 (a bit off-topic):
You could also simply use the "Media-Scanner" with my AndroidCtrl.dll. The calls are:
Code:
//"_adb" is a instance of "ADBClient"
_adb.Device.IO.MediaScanner.CreateScanList(string remoteDirectory, MediaScanMode mode);
_adb.Device.IO.MediaScanner.CreateScanList(string remoteDirectory, MediaScanMode mode, CancellationToken cancellationToken);
_adb.Device.IO.MediaScanner.CreateScanList(string remoteDirectory, IList<string> files, MediaScanMode mode, CancellationToken cancellationToken);
_adb.Device.IO.MediaScanner.ScanDirectory(string remotePath, MediaScanMode mode);
_adb.Device.IO.MediaScanner.ScanDirectory(string remotePath, MediaScanMode mode, CancellationToken cancellationToken);
_adb.Device.IO.MediaScanner.ScanDirectory(IEnumerable<string> remotePaths, MediaScanMode mode);
_adb.Device.IO.MediaScanner.ScanDirectory(IEnumerable<string> remotePaths, MediaScanMode mode, CancellationToken cancellationToken);
_adb.Device.IO.MediaScanner.ScanFile(string remotePath, MediaScanMode mode);
_adb.Device.IO.MediaScanner.ScanFile(IEnumerable<string> remotePaths, MediaScanMode mode);
_adb.Device.IO.MediaScanner.ScanFile(IEnumerable<string> remotePaths, MediaScanMode mode, CancellationToken cancellationToken);
_adb.Device.IO.MediaScanner.ScanObject(ITransferMessage message, MediaScanMode mode);
EDIT 3:
Found the bad boy, seems "Task.Delay()" only works when used in "async" context. Now the "freeze" is gone, you can move the window until it vanishes. So, in the next update those "freezes" are gone.
---
Little Update:
@squabbi
The next update includes a little editor as suggested by @reynard1. A screenshot can be found as attachment.
Regards,
Sebastian
k1ll3r8e said:
**snip**
EDIT 3:
Found the bad boy, seems "Task.Delay()" only works when used in "async" context. Now the "freeze" is gone, you can move the window until it vanishes. So, in the next update those "freezes" are gone.
---
Little Update:
@squabbi
The next update includes a little editor as suggested by @reynard1. A screenshot can be found as attachment.
Regards,
Sebastian
Click to expand...
Click to collapse
Woohoo! Thanks for digging into it! I'm glad you found the culprit haha.
Looking forward to that editor feature! Do you know if it's possible to integrate with Windows Explorer? It's probably a little harder, but something like how WinSCP can drag files from the remote to a local Explorer window.
If that's a little difficult, would this be possible to implement? If I drag and drop a folder/file onto the local pane, it will change directory (and highlight the file if a file was dragged onto the local pane). Just to make it easier to work with folders I have already open.
Still using Windows 7?
squabbi said:
Woohoo! Thanks for digging into it! I'm glad you found the culprit haha.
Looking forward to that editor feature! Do you know if it's possible to integrate with Windows Explorer? It's probably a little harder, but something like how WinSCP can drag files from the remote to a local Explorer window.
If that's a little difficult, would this be possible to implement? If I drag and drop a folder/file onto the local pane, it will change directory (and highlight the file if a file was dragged onto the local pane). Just to make it easier to work with folders I have already open.
Still using Windows 7?
Click to expand...
Click to collapse
Heyho
Yes its definatly possible, we need to use the so called "VirtualFileDataObject". I tried to implement it some time ago, but doesn't worked as expected. But i'll give it another try.
-
Yup, i still use Win 7 as my main system, but i have some VMs running, like my Debian server which serves the documentation and some test sites for my php projects, a few Android x86 Versions and of course a legit Win10 installation to test If everything works.
*Never change a running system! - Currently my main hdd has a uptime of 2689 days with 216 restarts, i think that tells a lot *
---
Little Update:
As the screenshot shows, the editor is working fine so far. (Added also a few more controls.) The only problem i still have is, that if ADB doesn't run as root you can't edit for example the "build.prop". Because ADB can't write the file directly back, so i need to build a kind of "tmp" file. The next problem will be, that you (the user) have to remount the mount point, before you start editing those "root" and "write protected" files. There is also a problem with "binary" files, because the "RichTextBox" screws up when it gets "binary to ASCII/UTF8" transformed data, which ends in an app freeze... So i have to check on some way if the stream contains really text-data, the file extension doesn't help here much because, you know, linux uses also a lot of txt files without any extension.
Update 2:
Just got the "binary" files running... With a super BIG drawback, 248 kb (4069 rows) text results in 269,364 mb memory utilization by the "RichTextBox". - The prob here is, that the ADB filestream doesn't support seek, so i need to load the whole doc in one, which is quiet to much for the "RichTextBox"...
Update 3:
Soo, i wrote a kind of paging for the "RichTextBox" which works so far really nice, at least when it comes to the memory (even during scrolling, with free running wheel, only 15 - 27 mb increase), there is now a fixed amount of rows (40) which will be shown, all other rows are hidden from the "RichTextBox". This opens a few new issues^^ - Currently there is no selection possible which goes beyond the 40 rows. Also insert and delete are a little challenge because, i need to "overwrite" the default behavior with the some "PreviewKeyDown/etc." events... - Looks all a bit hacky, but lets see if it works in the end.
Update 4:
Well, the "RichTextBox" is out of the race^^ - It triggers events more or less random instead when you expect it, it removes blank lines (for example you have 3x "\n", this gets wrapped to 1x "\n") and the best, you remove "\r" during stream reading and the RTB adds it again, also random (some paragraphs get an "\r" some not). Editing text in a solid way without losing something isn't possible with this thing... So i'll try the "TextBox".
Last Update before release:
So, after testing the "RichTextBox" and "TextBox" i ask myself why those controls are there^^. Both can't edit text with more than a few hundert lines, the "TextBox" is at least much better as the "RichTextBox" but it also screws up when i comes to more as 250 kb text. So the "Editor" will be one of your installed applications. I add a little tool window, which offers the temporary download to the windows temp folder, after that i launch the windows "OpenAs" dialog that you can choose the editor you want. Also, i'll attach a "FileSystemWatcher" to the file that the upload automatically happens when you press save in your editor.
Little Info:
It take a few more days for the "edit" update, because i started also to implement the TAP pattern, this increased for example the download speed by factor 6. But to implement it the right way, i have to rewrite a lot of code in the AndroidCtrl.dll and AndroidCtrlUI.dll.
Regards,
Sebastian
k1ll3r8e said:
Heyho
Yes its definatly possible, we need to use the so called "VirtualFileDataObject". I tried to implement it some time ago, but doesn't worked as expected. But i'll give it another try.
-
Yup, i still use Win 7 as my main system, but i have some VMs running, like my Debian server which serves the documentation and some test sites for my php projects, a few Android x86 Versions and of course a legit Win10 installation to test If everything works.
*Never change a running system! - Currently my main hdd has a uptime of 2689 days with 216 restarts, i think that tells a lot *
** snip **
Click to expand...
Click to collapse
That'll be great to see haha, and that does make sense keeping your system as is, if it works, it works.
Thanks for your hard work in checking out what's best for the new edit function. Maybe there's a library out there that can implement a text viewer better? I'm not familiar with WPF libraries, or how many there are.
squabbi said:
That'll be great to see haha, and that does make sense keeping your system as is, if it works, it works.
Thanks for your hard work in checking out what's best for the new edit function. Maybe there's a library out there that can implement a text viewer better? I'm not familiar with WPF libraries, or how many there are.
Click to expand...
Click to collapse
Heyho,
i have had a look on Avalon Texteditor but on StackOverflow is also a discussion about how to open a file bigger than 20 mb. It seems WPF is not that great for such things. I found also another one, written by a lonely dev like me , but it's not maintained since 7 years. So the best way might be, open a installed App which is well designed for that purpose.
A bit off-topic
I nearly finished the TAP implementation for the AndroidCtrl.dll, so far it brought a great speed increase. Also, it consumes less CPU time, for example the remote desktop uses only 3-7% on an Intel I5 with 32 GB memory (but up to 36% on an single-core Intel Pentium M with 1,5 Ghz and 1 GB memory - my old well working Laptop, also with Win7 ). So you might be happy to see all the new "real async" overloads in the lib. (I implemented all from scratch, so there is NO Task.Run() or Task.StartNew() in those functions.)
Edit:
Soo, after a few horrible days, the TAP pattern is now fully integrated! But there is still a little issue with the Remote-Desktop recovery viewer. It seems that everything got a speed boost except the recovery viewer, the viewer is currently nearly 4x slower as before... After i fixed this last problem, i'll release the new asynchronous version.
Regards,
Sebastian