public
static
void
Dex2Jar(
string
dexPath)
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe ";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string cmd = Application.StartupPath;
cmd = @"cd /d " + cmd;
p.StandardInput.WriteLine(cmd);
cmd = "/"" + Application.StartupPath + "//"+ "dex2jar.bat" + "/" " + "/"" + dexPath + "classes.dex" + "/"";
if ((Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major >= 6))
{
cmd = Application.StartupPath + "//" + "dex2jar.bat" + " " + dexPath + "classes.dex";
}
p.StandardInput.WriteLine(cmd);
p.StandardInput.WriteLine("exit");
//string strOutput = null;
//strOutput = p.StandardOutput.ReadToEnd();
//Console.WriteLine(strOutput);
p.WaitForExit();
p.Close();
}
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe ";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string cmd = Application.StartupPath;
cmd = @"cd /d " + cmd;
p.StandardInput.WriteLine(cmd);
cmd = "/"" + Application.StartupPath + "//"+ "dex2jar.bat" + "/" " + "/"" + dexPath + "classes.dex" + "/"";
if ((Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major >= 6))
{
cmd = Application.StartupPath + "//" + "dex2jar.bat" + " " + dexPath + "classes.dex";
}
p.StandardInput.WriteLine(cmd);
p.StandardInput.WriteLine("exit");
//string strOutput = null;
//strOutput = p.StandardOutput.ReadToEnd();
//Console.WriteLine(strOutput);
p.WaitForExit();
p.Close();
}