diff --git a/Google Authenticator Backup Tool.sln b/Google Authenticator Backup Tool.sln
new file mode 100644
index 0000000..877a04e
--- /dev/null
+++ b/Google Authenticator Backup Tool.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.28729.10
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Google Authenticator Backup Tool", "Google Authenticator Backup Tool\Google Authenticator Backup Tool.csproj", "{A87AE739-6EA3-48E7-A990-B666E372E78F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A87AE739-6EA3-48E7-A990-B666E372E78F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A87AE739-6EA3-48E7-A990-B666E372E78F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A87AE739-6EA3-48E7-A990-B666E372E78F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A87AE739-6EA3-48E7-A990-B666E372E78F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {9B34D881-E589-4EAD-B502-5D3456FB0E23}
+ EndGlobalSection
+EndGlobal
diff --git a/Google Authenticator Backup Tool/App.config b/Google Authenticator Backup Tool/App.config
new file mode 100644
index 0000000..10586df
--- /dev/null
+++ b/Google Authenticator Backup Tool/App.config
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Google Authenticator Backup Tool/App.xaml b/Google Authenticator Backup Tool/App.xaml
new file mode 100644
index 0000000..380d0b8
--- /dev/null
+++ b/Google Authenticator Backup Tool/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Google Authenticator Backup Tool/App.xaml.cs b/Google Authenticator Backup Tool/App.xaml.cs
new file mode 100644
index 0000000..a5ac032
--- /dev/null
+++ b/Google Authenticator Backup Tool/App.xaml.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Windows;
+
+namespace Google_Authenticator_Backup_Tool
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/Google Authenticator Backup Tool/Google Authenticator Backup Tool.csproj b/Google Authenticator Backup Tool/Google Authenticator Backup Tool.csproj
new file mode 100644
index 0000000..d63f9c8
--- /dev/null
+++ b/Google Authenticator Backup Tool/Google Authenticator Backup Tool.csproj
@@ -0,0 +1,123 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {A87AE739-6EA3-48E7-A990-B666E372E78F}
+ WinExe
+ Google_Authenticator_Backup_Tool
+ Google Authenticator Backup Tool
+ v4.0
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\EntityFramework.6.2.0\lib\net40\EntityFramework.dll
+
+
+ ..\packages\EntityFramework.6.2.0\lib\net40\EntityFramework.SqlServer.dll
+
+
+ ..\packages\QrCode.Net.0.4.0.0\lib\net40\Gma.QrCodeNet.Encoding.dll
+
+
+
+
+
+ ..\packages\System.Data.SQLite.Core.1.0.111.0\lib\net40\System.Data.SQLite.dll
+
+
+ ..\packages\System.Data.SQLite.EF6.1.0.111.0\lib\net40\System.Data.SQLite.EF6.dll
+
+
+ ..\packages\System.Data.SQLite.Linq.1.0.111.0\lib\net40\System.Data.SQLite.Linq.dll
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
\ No newline at end of file
diff --git a/Google Authenticator Backup Tool/MainWindow.xaml b/Google Authenticator Backup Tool/MainWindow.xaml
new file mode 100644
index 0000000..e8191b5
--- /dev/null
+++ b/Google Authenticator Backup Tool/MainWindow.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Google Authenticator Backup Tool/MainWindow.xaml.cs b/Google Authenticator Backup Tool/MainWindow.xaml.cs
new file mode 100644
index 0000000..cbba5f3
--- /dev/null
+++ b/Google Authenticator Backup Tool/MainWindow.xaml.cs
@@ -0,0 +1,173 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Gma.QrCodeNet.Encoding;
+using System.Data.SQLite;
+using System.Data;
+
+namespace Google_Authenticator_Backup_Tool
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public class GAItem
+ {
+ public string email { set; get; }
+ public string issuer { set; get; }
+ public string secret { set; get; }
+ public string url { set; get; }
+ }
+
+ List items = new List();
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ public void test()
+ {
+
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ lstOperations.Items.Clear();
+ items.Clear();
+
+ System.Diagnostics.Process process = new System.Diagnostics.Process();
+ System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
+ startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
+ startInfo.FileName = "cmd.exe";
+ startInfo.RedirectStandardInput = true;
+ startInfo.UseShellExecute = false;
+ process.StartInfo = startInfo;
+
+
+ process.Start();
+
+ using (StreamWriter sw = process.StandardInput)
+ {
+ if (sw.BaseStream.CanWrite)
+ {
+ lstOperations.Items.Add("Create Temp Folder");
+ sw.WriteLine("cd %temp%");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("mkdir authenticator-backup");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("cd \"%temp%\\authenticator-backup\"");
+
+ lstOperations.Items.Add("Elevating root access");
+ sw.WriteLine("adb shell su");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("cp /data/data/com.google.android.apps.authenticator2/databases/databases /data/local/tmp");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("chown shell.shell /data/local/tmp/databases");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("exit");
+ System.Threading.Thread.Sleep(500);
+
+ lstOperations.Items.Add("Pull Google Authenticator DB");
+ sw.WriteLine("adb pull /data/local/tmp/databases");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("adb shell su");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("rm /data/local/tmp/databases");
+ System.Threading.Thread.Sleep(500);
+ sw.WriteLine("exit");
+ System.Threading.Thread.Sleep(100);
+
+ lstOperations.Items.Add("Extracting Data");
+ sw.WriteLine("sqlite3 ./databases \"select * from accounts\"");
+ System.Threading.Thread.Sleep(100);
+
+ using (SQLiteConnection connection = new SQLiteConnection("Data Source="+Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)+"\\temp\\authenticator-backup\\databases;Version=3;"))
+ {
+ connection.Open();
+
+ var cmd = connection.CreateCommand();
+ cmd.CommandText = "SELECT email,secret,issuer FROM accounts";
+ var reader = cmd.ExecuteReader();
+
+ foreach(System.Data.Common.DbDataRecord item in reader)
+ {
+ items.Add(new GAItem() { email = item.GetValue(0).ToString(), secret = item.GetValue(1).ToString(), issuer = item.GetValue(2).ToString() });
+ }
+
+ foreach(var item in items)
+ {
+ if (string.IsNullOrEmpty(item.issuer))
+ {
+ if (item.email.Split(' ').Length > 0)
+ {
+ item.issuer = item.email.Split(' ')[0];
+ }
+ else
+ {
+ item.issuer = item.email;
+ }
+
+ if (item.issuer.Split(':').Length > 0)
+ {
+ item.issuer = item.issuer.Split(':')[0];
+ }
+ }
+
+ var url = string.Format("otpauth://totp/{0}?secret={1}&issuer={2}", item.email, item.secret, item.issuer);
+ item.url = url;
+ }
+ }
+
+ }
+ }
+
+ lstResults.ItemsSource = items;
+
+ /*
+ mkdir authenticator-backup
+ cd authenticator-backup
+ adb root
+ adb pull /data/data/com.google.android.apps.authenticator2/databases/databases
+ sqlite3 ./databases "select * from accounts"
+
+
+ import qrcode
+ import sqlite3
+ conn = sqlite3.connect('./databases')
+ c = conn.cursor()
+
+ for idx, (email, secret, issuer) in enumerate(c.execute("SELECT email,secret,issuer FROM accounts").fetchall()):
+ if issuer==None:
+ if len(email.split(" "))>0:
+ issuer=email.split(" ")[0]
+ else:
+ issuer=email
+
+ if len(issuer.split(":"))>0:
+ issuer=issuer.split(":")[0]
+
+ print("If the following issuer looks wrong, enter a new value. If it's OK, just press ENTER.")
+ newIssuer=input(issuer)
+ if len(newIssuer)>0:
+ issuer=newIssuer
+ url = 'otpauth://totp/{}?secret={}&issuer={}'.format(email, secret, issuer)
+ print (url)
+ im = qrcode.make(url)
+ im.save('./{}.png'.format(idx))
+ */
+ }
+ }
+}
diff --git a/Google Authenticator Backup Tool/Properties/AssemblyInfo.cs b/Google Authenticator Backup Tool/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..57462f6
--- /dev/null
+++ b/Google Authenticator Backup Tool/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Google Authenticator Backup Tool")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Google Authenticator Backup Tool")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Google Authenticator Backup Tool/Properties/Resources.Designer.cs b/Google Authenticator Backup Tool/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..8b6fa7e
--- /dev/null
+++ b/Google Authenticator Backup Tool/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Google_Authenticator_Backup_Tool.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google_Authenticator_Backup_Tool.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Google Authenticator Backup Tool/Properties/Resources.resx b/Google Authenticator Backup Tool/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Google Authenticator Backup Tool/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Google Authenticator Backup Tool/Properties/Settings.Designer.cs b/Google Authenticator Backup Tool/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..6942f09
--- /dev/null
+++ b/Google Authenticator Backup Tool/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Google_Authenticator_Backup_Tool.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Google Authenticator Backup Tool/Properties/Settings.settings b/Google Authenticator Backup Tool/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Google Authenticator Backup Tool/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Google Authenticator Backup Tool/packages.config b/Google Authenticator Backup Tool/packages.config
new file mode 100644
index 0000000..a26d5c1
--- /dev/null
+++ b/Google Authenticator Backup Tool/packages.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file