Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
修复路径存在空格导致的解析失败
  • Loading branch information
corle-bell committed Aug 24, 2021
1 parent ad4a914 commit efb10d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions aabViewer/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void ExecAabCheck()
}

string filePath = text_aab_path.Text;
string cmd = string.Format("java -jar bundletool-all-1.8.0.jar dump manifest --bundle {0}", filePath);
string cmd = string.Format("java -jar bundletool-all-1.8.0.jar dump manifest --bundle \"{0}\"", filePath);
string xmlData = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + CmdTools.Exec(cmd);

Console.WriteLine(cmd);
Expand Down Expand Up @@ -165,7 +165,7 @@ private void btn_install_Click(object sender, EventArgs e)
//string cmd = "java - jar bundletool-all-1.8.0.jar build - apks--bundle ={0} --output ={1} --ks ={2} --ks - pass = pass:{3} --ks - key - alias ={4} --key - pass = pass:{5} --device - spec ={6}";

//根据连接手机的设备创建apks的指令
string cmd = "java -jar bundletool-all-1.8.0.jar build-apks --bundle={0} --output={1} --ks={2} --ks-pass=pass:{3} --ks-key-alias={4} --key-pass=pass:{5} --connected-device";
string cmd = "java -jar bundletool-all-1.8.0.jar build-apks --bundle=\"{0}\" --output=\"{1}\" --ks=\"{2}\" --ks-pass=pass:{3} --ks-key-alias={4} --key-pass=pass:{5} --connected-device";
outPath += "temp.apks";


Expand All @@ -176,12 +176,13 @@ private void btn_install_Click(object sender, EventArgs e)

//填充志林该参数
cmd = string.Format(cmd, text_aab_path.Text, outPath, text_key_path.Text, text_pass.Text, text_alias.Text, text_key_pass.Text);

//执行指令
string ret = CmdTools.Exec(cmd);
Console.WriteLine("生成:"+ret);

//安装指令
cmd = string.Format("java -jar bundletool-all-1.8.0.jar install-apks --apks={0}", outPath);
cmd = string.Format("java -jar bundletool-all-1.8.0.jar install-apks --apks=\"{0}\"", outPath);
ret = CmdTools.Exec(cmd);

if(ret.Length!=0)
Expand All @@ -202,14 +203,14 @@ private void btn_install_Click(object sender, EventArgs e)

private void btn_base_hash_Click(object sender, EventArgs e)
{
string cmd = "keytool -exportcert -alias {0} -storepass {1} -keypass {2} -keystore {3} | openssl sha1 -binary | openssl base64";
string cmd = "keytool -exportcert -alias {0} -storepass {1} -keypass {2} -keystore \"{3}\" | openssl sha1 -binary | openssl base64";
cmd = string.Format(cmd, text_alias.Text, text_pass.Text, text_key_pass.Text, text_key_path.Text);
text_hash_result.Text = CmdTools.Exec(cmd);
}

private void btn_sha1_Click(object sender, EventArgs e)
{
string cmd = "keytool -list -alias {0} -storepass {1} -keypass {2} -keystore {3}";
string cmd = "keytool -list -alias {0} -storepass {1} -keypass {2} -keystore \"{3}\"";
cmd = string.Format(cmd, text_alias.Text, text_pass.Text, text_key_pass.Text, text_key_path.Text);
text_hash_result.Text = CmdTools.Exec(cmd);
}
Expand Down
Binary file modified aabViewer/bin/Debug/aabViewer.exe
Binary file not shown.
Binary file modified aabViewer/bin/Debug/aabViewer.pdb
Binary file not shown.

0 comments on commit efb10d4

Please sign in to comment.