Beispiel #1
0
        private void Btn_decompile_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || tbOutputDir.Text == "")
            {
                MessageBox.Show("請先選擇檔案與輸出資料夾");
                return;
            }
            this.btn_selectAPK.Enabled       = false;
            this.btn_selectOutputDir.Enabled = false;
            this.btn_decompile.Enabled       = false;
            this.lb_status.Text                = "正在反組譯...";
            this.lb_status.Visible             = true;
            this.toolStripProgressBar1.Visible = true;

            string args1   = textBox1.Text;
            string args2   = textBox1.Text + ".jar";
            string apkName = args1.Split('\\').Last <string>();
            string args3   = tbOutputDir.Text + "\\" + apkName + ".exctracted\\source code";
            string args4   = tbOutputDir.Text + "\\" + apkName + ".exctracted\\manifest";
            string args5   = tbOutputDir.Text + "\\" + apkName + ".exctracted\\manifest\\AndroidManifest.xml";

            Decompiler.SetOutputBox(tbOutput);
            Decompiler.AddParam(new string[] { args1, args2, args3, args4, args5 });
            Decompiler.JobFinished += Decompile_Completed;
            Decompiler.RunLibrary();
        }
Beispiel #2
0
        private void Btn_LoadPackageList_Click(object sender, EventArgs e)
        {
            LibraryWorker pkgListLoader = new LibraryWorker(Library.ADB);

            pkgListLoader.SetOutputBox(rtb_adbOutput);
            pkgListLoader.AddParam(new string[] { "shell", "pm", "list", "packages", "-3" });
            pkgListLoader.DataProcessor = PkgDataProcessor;
            pkgListLoader.RunLibrary();
        }
        private void Btn_startSearch_Click(object sender, EventArgs e)
        {
            string args1 = tb_SearchTargetFolder.Text;
            string args2 = tb_payloadPath.Text;

            KeywordSearcher.SetOutputBox(this.rtb_searchResult);
            KeywordSearcher.AddParam(new string[] { args1, args2 });
            KeywordSearcher.JobFinished += KeywordSearch_Completed;
            KeywordSearcher.RunLibrary();
        }
Beispiel #4
0
        private void ADBCheckPhone()
        {
            label_PhoneStatus.Text = "正在檢查裝置 ...";
            LibraryWorker adb = new LibraryWorker(Library.ADB);

            adb.AddParam(new string[] { "-d", "shell", "getprop" });
            adb.SetOutputBox(rtb_adbOutput);
            adb.DataProcessor = AdbGetPhoneBrandModel;
            adb.JobFinished  += PhoneFound;
            adb.RunLibrary();
        }
Beispiel #5
0
        private void Btn_ManifestCheck_Click(object sender, EventArgs e)
        {
            string apkName = textBox1.Text.Split('\\').Last <string>();
            string args    = tbOutputDir.Text + "\\" + apkName + ".exctracted\\manifest\\AndroidManifest.xml";

            LibraryWorker ManifestCheck = new LibraryWorker(Library.ManifestCheck);

            ManifestCheck.AddParam(new string[] { args });
            ManifestCheck.SetOutputBox(this.tbOutput);
            //ManifestCheck.DataProcessor = PrivackyDataProcessor;
            //ManifestCheck.JobFinished += PrivacyCheck_Completed;
            ManifestCheck.RunLibrary();
        }
Beispiel #6
0
        private void Btn_InstallAPK_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "apk檔|*.apk";
            var result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                var file = openFileDialog1.FileName;
                rtb_adbOutput.AppendText("正在安裝APK...\r\n");

                LibraryWorker adbInstall = new LibraryWorker(Library.ADB);
                adbInstall.AddParam(new string[] { "-d", "install", file });
                adbInstall.SetOutputBox(rtb_adbOutput);
                adbInstall.JobFinished  += APKInstallCompleted;
                adbInstall.DataProcessor = InstallDataProcessor;
                adbInstall.RunLibrary();
            }

            openFileDialog1.Filter = "";
        }
Beispiel #7
0
        private void ContextMenu_ADB_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            contextMenu_ADB.Hide();
            var result = folderBrowserDialog1.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }
            var           pkgName      = e.ClickedItem.Tag as string;
            var           dataFolder   = "/data/data/" + pkgName;
            var           sdcardFolder = "/sdcard/" + pkgName;
            var           outputFolder = folderBrowserDialog1.SelectedPath + "\\" + pkgName;
            LibraryWorker cp           = new LibraryWorker(Library.ADBPull);

            cp.AddParam(new string[] { dataFolder, sdcardFolder, outputFolder });
            cp.SetOutputBox(rtb_adbOutput);
            cp.JobFinished += Cp_Completed;
            cp.RunLibrary();
        }
Beispiel #8
0
        private void Btn_WSScan_Click(object sender, EventArgs e)
        {
            if (tb_WSProjectName.Text == "" || tb_WSTargetFolder.Text == "")
            {
                MessageBox.Show("目標資料夾與Project Name不可為空");
                return;
            }

            var targetFolder = tb_WSTargetFolder.Text;
            var projectName  = tb_WSProjectName.Text;
            var configFile   = cb_OAInternet.Checked ?
                               "tools\\wss\\OA-whitesource-fs-agent.config" : "tools\\wss\\whitesource-fs-agent.config";

            LibraryWorker WhiteSource = new LibraryWorker(Library.WhiteSource);

            WhiteSource.AddParam(new string[] { configFile, targetFolder, projectName });
            WhiteSource.SetOutputBox(this.rtb_WhiteSource);
            WhiteSource.JobFinished  += WhiteSoutce_Completed;
            WhiteSource.DataProcessor = WSDataProcessor;
            WhiteSource.RunLibrary();
        }