From fb02c65d221fcab7a40c8e7df29c2da5e41b28f8 Mon Sep 17 00:00:00 2001 From: blacktop Date: Tue, 15 Jul 2025 16:41:41 -0600 Subject: [PATCH] chore: various command typos --- cmd/ipsw/cmd/appstore/appstore.go | 13 ++++--------- cmd/ipsw/cmd/appstore/appstore_bundle_cap_add.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_bundle_ls.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_cert_add.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_cert_ls.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_cert_rm.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_device_ls.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_device_mod.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_device_reg.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_profile_create.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_profile_ls.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_profile_renew.go | 7 +------ cmd/ipsw/cmd/appstore/appstore_profile_rm.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_provision_gen.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_review_list.go | 5 ----- cmd/ipsw/cmd/appstore/appstore_token.go | 5 +---- cmd/ipsw/cmd/disk/disk.go | 6 ------ cmd/ipsw/cmd/download/download.go | 7 ------- cmd/ipsw/cmd/download/download_appledb.go | 2 +- cmd/ipsw/cmd/download/download_ipsw.go | 2 +- cmd/ipsw/cmd/download/download_ota.go | 2 +- cmd/ipsw/cmd/download/download_wiki.go | 2 +- cmd/ipsw/cmd/dyld/dyld.go | 7 ------- cmd/ipsw/cmd/dyld/dyld_disass.go | 6 +++--- cmd/ipsw/cmd/dyld/dyld_xref.go | 2 +- cmd/ipsw/cmd/extract.go | 2 +- cmd/ipsw/cmd/frida/frida.go | 8 -------- cmd/ipsw/cmd/fw/fw.go | 7 ------- cmd/ipsw/cmd/idev/idev.go | 8 -------- cmd/ipsw/cmd/idev/idev_amfi_dev.go | 2 +- cmd/ipsw/cmd/idev/idev_backup_create.go | 2 +- cmd/ipsw/cmd/idev/idev_backup_erase.go | 2 +- cmd/ipsw/cmd/idev/idev_backup_extract.go | 2 +- cmd/ipsw/cmd/idev/idev_backup_info.go | 2 +- cmd/ipsw/cmd/idev/idev_backup_ls.go | 2 +- cmd/ipsw/cmd/idev/idev_backup_restore.go | 2 +- cmd/ipsw/cmd/idev/idev_dvt_info.go | 2 +- cmd/ipsw/cmd/idev/idev_dvt_logs.go | 2 +- cmd/ipsw/cmd/idev/idev_dvt_ls.go | 2 +- cmd/ipsw/cmd/idev/idev_dvt_mon.go | 2 +- cmd/ipsw/cmd/idev/idev_dvt_net.go | 2 +- cmd/ipsw/cmd/idev/idev_dvt_noti.go | 2 +- cmd/ipsw/cmd/idev/idev_dvt_ps.go | 2 +- cmd/ipsw/cmd/idev/idev_prof_ls.go | 2 +- cmd/ipsw/cmd/idev/idev_prov_clear.go | 2 +- cmd/ipsw/cmd/idev/idev_prov_dump.go | 2 +- cmd/ipsw/cmd/idev/idev_prov_install.go | 2 +- cmd/ipsw/cmd/idev/idev_prov_ls.go | 2 +- cmd/ipsw/cmd/idev/idev_prov_rm.go | 2 +- cmd/ipsw/cmd/img3/img3.go | 7 ------- cmd/ipsw/cmd/img4/img4.go | 13 ------------- cmd/ipsw/cmd/kernel/kernel.go | 7 ------- cmd/ipsw/cmd/kernel/kernel_kexts.go | 2 +- cmd/ipsw/cmd/macho/macho.go | 7 ------- cmd/ipsw/cmd/macho/macho_disass.go | 4 ++-- cmd/ipsw/cmd/macho/macho_patch_add.go | 2 +- cmd/ipsw/cmd/macho/macho_patch_rm.go | 2 +- cmd/ipsw/cmd/ota/ota.go | 6 ------ cmd/ipsw/cmd/pbzx.go | 2 +- cmd/ipsw/cmd/sb/sb.go | 7 ------- cmd/ipsw/cmd/ssh/ssh.go | 5 ----- cmd/ipsw/cmd/ssh/ssh_debugserver.go | 2 +- pkg/disass/disass.go | 2 +- pkg/disass/macho.go | 2 +- pkg/dyld/disass.go | 2 +- pkg/kernelcache/mig.go | 2 +- pkg/signature/signature.go | 2 +- 67 files changed, 47 insertions(+), 220 deletions(-) diff --git a/cmd/ipsw/cmd/appstore/appstore.go b/cmd/ipsw/cmd/appstore/appstore.go index ff6fe6ee0..a1ea15674 100644 --- a/cmd/ipsw/cmd/appstore/appstore.go +++ b/cmd/ipsw/cmd/appstore/appstore.go @@ -31,10 +31,10 @@ func init() { AppstoreCmd.PersistentFlags().StringP("iss", "i", "", "Issuer ID") AppstoreCmd.PersistentFlags().StringP("kid", "k", "", "Key ID") AppstoreCmd.PersistentFlags().StringP("jwt", "j", "", "JWT api key") - viper.BindPFlag("appstore.p8", AppstoreCmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", AppstoreCmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", AppstoreCmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", AppstoreCmd.Flags().Lookup("jwt")) + viper.BindPFlag("appstore.p8", AppstoreCmd.PersistentFlags().Lookup("p8")) + viper.BindPFlag("appstore.iss", AppstoreCmd.PersistentFlags().Lookup("iss")) + viper.BindPFlag("appstore.kid", AppstoreCmd.PersistentFlags().Lookup("kid")) + viper.BindPFlag("appstore.jwt", AppstoreCmd.PersistentFlags().Lookup("jwt")) } // AppstoreCmd represents the appstore command @@ -43,11 +43,6 @@ var AppstoreCmd = &cobra.Command{ Aliases: []string{"as"}, Short: "Interact with the App Store Connect API", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/appstore/appstore_bundle_cap_add.go b/cmd/ipsw/cmd/appstore/appstore_bundle_cap_add.go index 20df59122..c9e0b93b7 100644 --- a/cmd/ipsw/cmd/appstore/appstore_bundle_cap_add.go +++ b/cmd/ipsw/cmd/appstore/appstore_bundle_cap_add.go @@ -58,11 +58,6 @@ var ASBundleCapabilityAddCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags bid := viper.GetString("appstore.bundle.cap.add.id") ctype := viper.GetString("appstore.bundle.cap.add.type") diff --git a/cmd/ipsw/cmd/appstore/appstore_bundle_ls.go b/cmd/ipsw/cmd/appstore/appstore_bundle_ls.go index 2f2ac28f9..24c9a769d 100644 --- a/cmd/ipsw/cmd/appstore/appstore_bundle_ls.go +++ b/cmd/ipsw/cmd/appstore/appstore_bundle_ls.go @@ -50,11 +50,6 @@ var ASBundleListCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // Validate flags if (viper.GetString("appstore.p8") == "" || viper.GetString("appstore.iss") == "" || viper.GetString("appstore.kid") == "") && viper.GetString("appstore.jwt") == "" { return fmt.Errorf("you must provide (--p8, --iss and --kid) OR --jwt") diff --git a/cmd/ipsw/cmd/appstore/appstore_cert_add.go b/cmd/ipsw/cmd/appstore/appstore_cert_add.go index 5629a78ed..acb30429d 100644 --- a/cmd/ipsw/cmd/appstore/appstore_cert_add.go +++ b/cmd/ipsw/cmd/appstore/appstore_cert_add.go @@ -62,11 +62,6 @@ var ASCertAddCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags ctype := viper.GetString("appstore.cert.add.type") csr := viper.GetString("appstore.cert.add.csr") diff --git a/cmd/ipsw/cmd/appstore/appstore_cert_ls.go b/cmd/ipsw/cmd/appstore/appstore_cert_ls.go index b114c8923..b473a0ba3 100644 --- a/cmd/ipsw/cmd/appstore/appstore_cert_ls.go +++ b/cmd/ipsw/cmd/appstore/appstore_cert_ls.go @@ -50,11 +50,6 @@ var ASCertListCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // Validate flags if (viper.GetString("appstore.p8") == "" || viper.GetString("appstore.iss") == "" || viper.GetString("appstore.kid") == "") && viper.GetString("appstore.jwt") == "" { return fmt.Errorf("you must provide (--p8, --iss and --kid) OR --jwt") diff --git a/cmd/ipsw/cmd/appstore/appstore_cert_rm.go b/cmd/ipsw/cmd/appstore/appstore_cert_rm.go index f238b55d4..abfd63c45 100644 --- a/cmd/ipsw/cmd/appstore/appstore_cert_rm.go +++ b/cmd/ipsw/cmd/appstore/appstore_cert_rm.go @@ -55,11 +55,6 @@ var ASCertRevokeCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags id := viper.GetString("appstore.cert.rm.id") // Validate flags diff --git a/cmd/ipsw/cmd/appstore/appstore_device_ls.go b/cmd/ipsw/cmd/appstore/appstore_device_ls.go index dfc04b065..f240767fc 100644 --- a/cmd/ipsw/cmd/appstore/appstore_device_ls.go +++ b/cmd/ipsw/cmd/appstore/appstore_device_ls.go @@ -50,11 +50,6 @@ var ASDeviceListCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // Validate flags if (viper.GetString("appstore.p8") == "" || viper.GetString("appstore.iss") == "" || viper.GetString("appstore.kid") == "") && viper.GetString("appstore.jwt") == "" { return fmt.Errorf("you must provide (--p8, --iss and --kid) OR --jwt") diff --git a/cmd/ipsw/cmd/appstore/appstore_device_mod.go b/cmd/ipsw/cmd/appstore/appstore_device_mod.go index 5967bd205..13955a40b 100644 --- a/cmd/ipsw/cmd/appstore/appstore_device_mod.go +++ b/cmd/ipsw/cmd/appstore/appstore_device_mod.go @@ -64,11 +64,6 @@ var ASDeviceModifyCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags id := viper.GetString("appstore.device.mod.id") name := viper.GetString("appstore.device.mod.name") diff --git a/cmd/ipsw/cmd/appstore/appstore_device_reg.go b/cmd/ipsw/cmd/appstore/appstore_device_reg.go index e325a9d6e..4dbad0ae1 100644 --- a/cmd/ipsw/cmd/appstore/appstore_device_reg.go +++ b/cmd/ipsw/cmd/appstore/appstore_device_reg.go @@ -58,11 +58,6 @@ var ASDeviceRegisterCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags name := viper.GetString("appstore.device.reg.name") platform := viper.GetString("appstore.device.reg.platform") diff --git a/cmd/ipsw/cmd/appstore/appstore_profile_create.go b/cmd/ipsw/cmd/appstore/appstore_profile_create.go index 6e704f7df..0ddd44f05 100644 --- a/cmd/ipsw/cmd/appstore/appstore_profile_create.go +++ b/cmd/ipsw/cmd/appstore/appstore_profile_create.go @@ -73,11 +73,6 @@ var ASProfileCreateCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags bid := viper.GetString("appstore.profile.create.bundle-id") certs := viper.GetStringSlice("appstore.profile.create.certs") diff --git a/cmd/ipsw/cmd/appstore/appstore_profile_ls.go b/cmd/ipsw/cmd/appstore/appstore_profile_ls.go index a8fd9014d..352239a5e 100644 --- a/cmd/ipsw/cmd/appstore/appstore_profile_ls.go +++ b/cmd/ipsw/cmd/appstore/appstore_profile_ls.go @@ -50,11 +50,6 @@ var ASProfileListCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // Validate flags if (viper.GetString("appstore.p8") == "" || viper.GetString("appstore.iss") == "" || viper.GetString("appstore.kid") == "") && viper.GetString("appstore.jwt") == "" { return fmt.Errorf("you must provide (--p8, --iss and --kid) OR --jwt") diff --git a/cmd/ipsw/cmd/appstore/appstore_profile_renew.go b/cmd/ipsw/cmd/appstore/appstore_profile_renew.go index dfd7c8267..760647bcf 100644 --- a/cmd/ipsw/cmd/appstore/appstore_profile_renew.go +++ b/cmd/ipsw/cmd/appstore/appstore_profile_renew.go @@ -53,7 +53,7 @@ func init() { var ASProfileRenewCmd = &cobra.Command{ Use: "renew ", Aliases: []string{"r"}, - Short: "Renew and expired or invalide provisioning profile", + Short: "Renew an expired or invalid provisioning profile", Args: cobra.NoArgs, SilenceUsage: true, SilenceErrors: true, @@ -65,11 +65,6 @@ var ASProfileRenewCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags id := viper.GetString("appstore.profile.renew.id") name := viper.GetString("appstore.profile.renew.name") diff --git a/cmd/ipsw/cmd/appstore/appstore_profile_rm.go b/cmd/ipsw/cmd/appstore/appstore_profile_rm.go index cd0fd24d2..6ef6e9afb 100644 --- a/cmd/ipsw/cmd/appstore/appstore_profile_rm.go +++ b/cmd/ipsw/cmd/appstore/appstore_profile_rm.go @@ -58,11 +58,6 @@ var ASProfileRemoveCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags id := viper.GetString("appstore.profile.rm.id") name := viper.GetString("appstore.profile.rm.name") diff --git a/cmd/ipsw/cmd/appstore/appstore_provision_gen.go b/cmd/ipsw/cmd/appstore/appstore_provision_gen.go index c5ad0c019..0b3deb69a 100644 --- a/cmd/ipsw/cmd/appstore/appstore_provision_gen.go +++ b/cmd/ipsw/cmd/appstore/appstore_provision_gen.go @@ -72,11 +72,6 @@ for Xcode code signing.`, } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags certType := viper.GetString("appstore.provision.gen.type") csr := viper.GetBool("appstore.provision.gen.csr") diff --git a/cmd/ipsw/cmd/appstore/appstore_review_list.go b/cmd/ipsw/cmd/appstore/appstore_review_list.go index 9edd8c738..36aed487e 100644 --- a/cmd/ipsw/cmd/appstore/appstore_review_list.go +++ b/cmd/ipsw/cmd/appstore/appstore_review_list.go @@ -61,11 +61,6 @@ var ASReviewListCmd = &cobra.Command{ } color.NoColor = viper.GetBool("no-color") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) - viper.BindPFlag("appstore.jwt", cmd.Flags().Lookup("jwt")) // flags id := viper.GetString("appstore.review-list.id") after := viper.GetString("appstore.review-list.after") diff --git a/cmd/ipsw/cmd/appstore/appstore_token.go b/cmd/ipsw/cmd/appstore/appstore_token.go index cfd85b47f..1c719929d 100644 --- a/cmd/ipsw/cmd/appstore/appstore_token.go +++ b/cmd/ipsw/cmd/appstore/appstore_token.go @@ -47,10 +47,7 @@ var ASTokenCmd = &cobra.Command{ color.NoColor = viper.GetBool("no-color") // flags lifetime := viper.GetDuration("appstore.token.lifetime") - // parent flags - viper.BindPFlag("appstore.p8", cmd.Flags().Lookup("p8")) - viper.BindPFlag("appstore.iss", cmd.Flags().Lookup("iss")) - viper.BindPFlag("appstore.kid", cmd.Flags().Lookup("kid")) + // Validate flags if viper.GetString("appstore.p8") == "" || viper.GetString("appstore.iss") == "" || viper.GetString("appstore.kid") == "" { return fmt.Errorf("you must provide --p8, --iss and --kid") diff --git a/cmd/ipsw/cmd/disk/disk.go b/cmd/ipsw/cmd/disk/disk.go index 2ac92c324..b50542c75 100644 --- a/cmd/ipsw/cmd/disk/disk.go +++ b/cmd/ipsw/cmd/disk/disk.go @@ -23,7 +23,6 @@ package disk import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) // DiskCmd represents the disk command @@ -31,11 +30,6 @@ var DiskCmd = &cobra.Command{ Use: "disk", Short: "Disk commands", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/download/download.go b/cmd/ipsw/cmd/download/download.go index 7aad8e7db..e1ad57b27 100644 --- a/cmd/ipsw/cmd/download/download.go +++ b/cmd/ipsw/cmd/download/download.go @@ -26,7 +26,6 @@ import ( "strings" "github.com/spf13/cobra" - "github.com/spf13/viper" ) func getDestName(url string, removeCommas bool) string { @@ -42,12 +41,6 @@ var DownloadCmd = &cobra.Command{ Aliases: []string{"dl"}, Short: "Download Apple Firmware files (and more)", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/download/download_appledb.go b/cmd/ipsw/cmd/download/download_appledb.go index 0d5f6e36a..41302d6c8 100644 --- a/cmd/ipsw/cmd/download/download_appledb.go +++ b/cmd/ipsw/cmd/download/download_appledb.go @@ -89,7 +89,7 @@ func init() { downloadAppledbCmd.Flags().String("api-token", "", "Github API Token") downloadAppledbCmd.Flags().StringP("output", "o", "", "Folder to download files to") downloadAppledbCmd.MarkFlagDirname("output") - downloadAppledbCmd.Flags().BoolP("flat", "f", false, "Do NOT perserve directory structure when downloading with --pattern") + downloadAppledbCmd.Flags().BoolP("flat", "f", false, "Do NOT preserve directory structure when downloading with --pattern") downloadAppledbCmd.Flags().Bool("usb", false, "Download IPSWs for USB attached iDevices") downloadAppledbCmd.MarkFlagsMutuallyExclusive("release", "beta", "rc") // Bind persistent flags diff --git a/cmd/ipsw/cmd/download/download_ipsw.go b/cmd/ipsw/cmd/download/download_ipsw.go index 62b1a5fad..ce820f0e5 100644 --- a/cmd/ipsw/cmd/download/download_ipsw.go +++ b/cmd/ipsw/cmd/download/download_ipsw.go @@ -79,7 +79,7 @@ func init() { downloadIpswCmd.Flags().Bool("fcs-keys", false, "Download AEA1 DMG fcs-key pem files") downloadIpswCmd.Flags().Bool("fcs-keys-json", false, "Download AEA1 DMG fcs-keys as JSON") downloadIpswCmd.Flags().Bool("decrypt", false, "Attempt to decrypt the partial files if keys are available") - downloadIpswCmd.Flags().BoolP("flat", "f", false, "Do NOT perserve directory structure when downloading with --pattern") + downloadIpswCmd.Flags().BoolP("flat", "f", false, "Do NOT preserve directory structure when downloading with --pattern") downloadIpswCmd.Flags().BoolP("urls", "u", false, "Dump URLs only") downloadIpswCmd.Flags().Bool("usb", false, "Download IPSWs for USB attached iDevices") downloadIpswCmd.Flags().StringP("output", "o", "", "Folder to download files to") diff --git a/cmd/ipsw/cmd/download/download_ota.go b/cmd/ipsw/cmd/download/download_ota.go index 97125841d..607879bef 100644 --- a/cmd/ipsw/cmd/download/download_ota.go +++ b/cmd/ipsw/cmd/download/download_ota.go @@ -93,7 +93,7 @@ func init() { }) downloadOtaCmd.Flags().Bool("driver-kit", false, "Extract DriverKit dyld_shared_cache(s) from remote OTA zip") downloadOtaCmd.Flags().String("pattern", "", "Download remote files that match regex") - downloadOtaCmd.Flags().BoolP("flat", "f", false, "Do NOT perserve directory structure when downloading with --pattern") + downloadOtaCmd.Flags().BoolP("flat", "f", false, "Do NOT preserve directory structure when downloading with --pattern") downloadOtaCmd.Flags().Bool("info", false, "Show all the latest OTAs available") downloadOtaCmd.Flags().StringP("output", "o", "", "Folder to download files to") downloadOtaCmd.MarkFlagDirname("output") diff --git a/cmd/ipsw/cmd/download/download_wiki.go b/cmd/ipsw/cmd/download/download_wiki.go index 9479d6d5d..285746260 100644 --- a/cmd/ipsw/cmd/download/download_wiki.go +++ b/cmd/ipsw/cmd/download/download_wiki.go @@ -72,7 +72,7 @@ func init() { downloadWikiCmd.Flags().StringP("output", "o", "", "Folder to download files to") downloadWikiCmd.MarkFlagDirname("output") downloadWikiCmd.Flags().String("db", "wiki_db.json", "Path to local JSON database (will use CWD by default)") - downloadWikiCmd.Flags().BoolP("flat", "f", false, "Do NOT perserve directory structure when downloading with --pattern") + downloadWikiCmd.Flags().BoolP("flat", "f", false, "Do NOT preserve directory structure when downloading with --pattern") // Bind persistent flags viper.BindPFlag("download.wiki.proxy", downloadWikiCmd.Flags().Lookup("proxy")) viper.BindPFlag("download.wiki.insecure", downloadWikiCmd.Flags().Lookup("insecure")) diff --git a/cmd/ipsw/cmd/dyld/dyld.go b/cmd/ipsw/cmd/dyld/dyld.go index e7f7c7df9..cd37cf06e 100644 --- a/cmd/ipsw/cmd/dyld/dyld.go +++ b/cmd/ipsw/cmd/dyld/dyld.go @@ -27,7 +27,6 @@ import ( "github.com/blacktop/ipsw/pkg/dyld" "github.com/fatih/color" "github.com/spf13/cobra" - "github.com/spf13/viper" ) var symAddrColor = color.New(color.Faint).SprintfFunc() @@ -75,12 +74,6 @@ var DyldCmd = &cobra.Command{ Aliases: []string{"dsc"}, Short: "Parse dyld_shared_cache", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/dyld/dyld_disass.go b/cmd/ipsw/cmd/dyld/dyld_disass.go index 18c0d3bbd..db24ce312 100644 --- a/cmd/ipsw/cmd/dyld/dyld_disass.go +++ b/cmd/ipsw/cmd/dyld/dyld_disass.go @@ -242,7 +242,7 @@ var DisassCmd = &cobra.Command{ Middle: 0, AsJSON: asJSON, Demangle: demangleFlag, - Quite: quiet, + Quiet: quiet, Color: viper.GetBool("color") && !viper.GetBool("no-color") && !decompile, }) @@ -357,7 +357,7 @@ var DisassCmd = &cobra.Command{ Middle: 0, AsJSON: asJSON, Demangle: demangleFlag, - Quite: quiet, + Quiet: quiet, Color: viper.GetBool("color") && !viper.GetBool("no-color") && !decompile, }) @@ -503,7 +503,7 @@ var DisassCmd = &cobra.Command{ Middle: middleAddr, AsJSON: asJSON, Demangle: demangleFlag, - Quite: quiet, + Quiet: quiet, Color: viper.GetBool("color") && !viper.GetBool("no-color") && !decompile, }) diff --git a/cmd/ipsw/cmd/dyld/dyld_xref.go b/cmd/ipsw/cmd/dyld/dyld_xref.go index 8ade3d0b2..edfe71838 100644 --- a/cmd/ipsw/cmd/dyld/dyld_xref.go +++ b/cmd/ipsw/cmd/dyld/dyld_xref.go @@ -193,7 +193,7 @@ var XrefCmd = &cobra.Command{ engine := dyld.NewDyldDisass(f, &disass.Config{ Data: data, StartAddress: fn.StartAddr, - Quite: true, + Quiet: true, }) if err := engine.Triage(); err != nil { diff --git a/cmd/ipsw/cmd/extract.go b/cmd/ipsw/cmd/extract.go index 063eaa93b..231bfe21b 100644 --- a/cmd/ipsw/cmd/extract.go +++ b/cmd/ipsw/cmd/extract.go @@ -58,7 +58,7 @@ func init() { extractCmd.Flags().StringP("pattern", "p", "", "Extract files that match regex") extractCmd.Flags().StringP("output", "o", "", "Folder to extract files to") extractCmd.MarkFlagDirname("output") - extractCmd.Flags().Bool("flat", false, "Do NOT perserve directory structure when extracting") + extractCmd.Flags().Bool("flat", false, "Do NOT preserve directory structure when extracting") extractCmd.Flags().BoolP("json", "j", false, "Output extracted paths as JSON") extractCmd.Flags().StringArrayP("dyld-arch", "a", []string{}, "dyld_shared_cache architecture to extract") extractCmd.RegisterFlagCompletionFunc("dyld-arch", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { diff --git a/cmd/ipsw/cmd/frida/frida.go b/cmd/ipsw/cmd/frida/frida.go index 23de98723..0065f6860 100644 --- a/cmd/ipsw/cmd/frida/frida.go +++ b/cmd/ipsw/cmd/frida/frida.go @@ -25,7 +25,6 @@ package frida import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) const fridaVersion = "17.2.0" @@ -40,13 +39,6 @@ var FridaCmd = &cobra.Command{ Aliases: []string{"f"}, Short: "Run Frida commands", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("frida.udid", cmd.Flags().Lookup("udid")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/fw/fw.go b/cmd/ipsw/cmd/fw/fw.go index 37152e61f..95b6003d2 100644 --- a/cmd/ipsw/cmd/fw/fw.go +++ b/cmd/ipsw/cmd/fw/fw.go @@ -23,7 +23,6 @@ package fw import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) // FwCmd represents the fw command @@ -31,12 +30,6 @@ var FwCmd = &cobra.Command{ Use: "fw", Short: "Firmware commands", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/idev/idev.go b/cmd/ipsw/cmd/idev/idev.go index b420c1986..be3611af0 100644 --- a/cmd/ipsw/cmd/idev/idev.go +++ b/cmd/ipsw/cmd/idev/idev.go @@ -23,7 +23,6 @@ package idev import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) func init() { @@ -36,13 +35,6 @@ var IDevCmd = &cobra.Command{ Aliases: []string{"usb"}, Short: "USB connected device commands", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - viper.BindPFlag("idev.udid", cmd.Flags().Lookup("udid")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/idev/idev_amfi_dev.go b/cmd/ipsw/cmd/idev/idev_amfi_dev.go index 3d0aed3c6..3e8267076 100644 --- a/cmd/ipsw/cmd/idev/idev_amfi_dev.go +++ b/cmd/ipsw/cmd/idev/idev_amfi_dev.go @@ -45,7 +45,7 @@ func init() { var idevAmfiDevModeCmd = &cobra.Command{ Use: "dev", Aliases: []string{"d", "developer", "developer-mode"}, - Short: "Enabled Developer Mode on device", + Short: "Enable Developer Mode on device", Args: cobra.NoArgs, SilenceUsage: true, SilenceErrors: true, diff --git a/cmd/ipsw/cmd/idev/idev_backup_create.go b/cmd/ipsw/cmd/idev/idev_backup_create.go index 4ba71c467..707296a34 100644 --- a/cmd/ipsw/cmd/idev/idev_backup_create.go +++ b/cmd/ipsw/cmd/idev/idev_backup_create.go @@ -30,7 +30,7 @@ import ( // backupCreateCmd represents the create command var backupCreateCmd = &cobra.Command{ Use: "create", - Short: "A brief description of your command", + Short: "Create a backup", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_backup_erase.go b/cmd/ipsw/cmd/idev/idev_backup_erase.go index d717546e0..10edf3441 100644 --- a/cmd/ipsw/cmd/idev/idev_backup_erase.go +++ b/cmd/ipsw/cmd/idev/idev_backup_erase.go @@ -30,7 +30,7 @@ import ( // backupEraseCmd represents the erase command var backupEraseCmd = &cobra.Command{ Use: "erase", - Short: "A brief description of your command", + Short: "Erase a backup", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_backup_extract.go b/cmd/ipsw/cmd/idev/idev_backup_extract.go index 8e727fb78..0e1a9aa03 100644 --- a/cmd/ipsw/cmd/idev/idev_backup_extract.go +++ b/cmd/ipsw/cmd/idev/idev_backup_extract.go @@ -30,7 +30,7 @@ import ( // backupExtractCmd represents the extract command var backupExtractCmd = &cobra.Command{ Use: "extract", - Short: "A brief description of your command", + Short: "Extract a backup", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_backup_info.go b/cmd/ipsw/cmd/idev/idev_backup_info.go index adab2b526..154dae61f 100644 --- a/cmd/ipsw/cmd/idev/idev_backup_info.go +++ b/cmd/ipsw/cmd/idev/idev_backup_info.go @@ -30,7 +30,7 @@ import ( // backupInfoCmd represents the info command var backupInfoCmd = &cobra.Command{ Use: "info", - Short: "A brief description of your command", + Short: "Get backup info", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_backup_ls.go b/cmd/ipsw/cmd/idev/idev_backup_ls.go index b0d00968a..f28f466f5 100644 --- a/cmd/ipsw/cmd/idev/idev_backup_ls.go +++ b/cmd/ipsw/cmd/idev/idev_backup_ls.go @@ -30,7 +30,7 @@ import ( // backupLsCmd represents the ls command var backupLsCmd = &cobra.Command{ Use: "ls", - Short: "A brief description of your command", + Short: "List backups", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_backup_restore.go b/cmd/ipsw/cmd/idev/idev_backup_restore.go index dae8a4406..3604e4cc0 100644 --- a/cmd/ipsw/cmd/idev/idev_backup_restore.go +++ b/cmd/ipsw/cmd/idev/idev_backup_restore.go @@ -30,7 +30,7 @@ import ( // backupRestoreCmd represents the restore command var backupRestoreCmd = &cobra.Command{ Use: "restore", - Short: "A brief description of your command", + Short: "Restore a backup", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_dvt_info.go b/cmd/ipsw/cmd/idev/idev_dvt_info.go index 70c72fc31..f1a3f27a3 100644 --- a/cmd/ipsw/cmd/idev/idev_dvt_info.go +++ b/cmd/ipsw/cmd/idev/idev_dvt_info.go @@ -30,7 +30,7 @@ import ( // dvtInfoCmd represents the info command var dvtInfoCmd = &cobra.Command{ Use: "info", - Short: "A brief description of your command", + Short: "Get DVT info", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_dvt_logs.go b/cmd/ipsw/cmd/idev/idev_dvt_logs.go index bf25d57f6..55418b441 100644 --- a/cmd/ipsw/cmd/idev/idev_dvt_logs.go +++ b/cmd/ipsw/cmd/idev/idev_dvt_logs.go @@ -30,7 +30,7 @@ import ( // dvtLogsCmd represents the logs command var dvtLogsCmd = &cobra.Command{ Use: "logs", - Short: "A brief description of your command", + Short: "Get DVT logs", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_dvt_ls.go b/cmd/ipsw/cmd/idev/idev_dvt_ls.go index 59d7f9ba3..8c56e7024 100644 --- a/cmd/ipsw/cmd/idev/idev_dvt_ls.go +++ b/cmd/ipsw/cmd/idev/idev_dvt_ls.go @@ -30,7 +30,7 @@ import ( // dvtLsCmd represents the ls command var dvtLsCmd = &cobra.Command{ Use: "ls", - Short: "A brief description of your command", + Short: "List DVT services", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_dvt_mon.go b/cmd/ipsw/cmd/idev/idev_dvt_mon.go index 67c90251e..b299b80f3 100644 --- a/cmd/ipsw/cmd/idev/idev_dvt_mon.go +++ b/cmd/ipsw/cmd/idev/idev_dvt_mon.go @@ -30,7 +30,7 @@ import ( // dvtMonCmd represents the mon command var dvtMonCmd = &cobra.Command{ Use: "mon", - Short: "A brief description of your command", + Short: "Monitor DVT services", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_dvt_net.go b/cmd/ipsw/cmd/idev/idev_dvt_net.go index a428c6ef7..a318cd4d1 100644 --- a/cmd/ipsw/cmd/idev/idev_dvt_net.go +++ b/cmd/ipsw/cmd/idev/idev_dvt_net.go @@ -30,7 +30,7 @@ import ( // dvtNetCmd represents the net command var dvtNetCmd = &cobra.Command{ Use: "net", - Short: "A brief description of your command", + Short: "Network related commands", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_dvt_noti.go b/cmd/ipsw/cmd/idev/idev_dvt_noti.go index c3299c64e..db15c8571 100644 --- a/cmd/ipsw/cmd/idev/idev_dvt_noti.go +++ b/cmd/ipsw/cmd/idev/idev_dvt_noti.go @@ -30,7 +30,7 @@ import ( // dvtNotiCmd represents the noti command var dvtNotiCmd = &cobra.Command{ Use: "noti", - Short: "A brief description of your command", + Short: "Notification related commands", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_dvt_ps.go b/cmd/ipsw/cmd/idev/idev_dvt_ps.go index 9912ab620..567a30e1c 100644 --- a/cmd/ipsw/cmd/idev/idev_dvt_ps.go +++ b/cmd/ipsw/cmd/idev/idev_dvt_ps.go @@ -30,7 +30,7 @@ import ( // dvtPsCmd represents the ps command var dvtPsCmd = &cobra.Command{ Use: "ps", - Short: "A brief description of your command", + Short: "Process list", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ipsw/cmd/idev/idev_prof_ls.go b/cmd/ipsw/cmd/idev/idev_prof_ls.go index 00b90a135..80c75b6ea 100644 --- a/cmd/ipsw/cmd/idev/idev_prof_ls.go +++ b/cmd/ipsw/cmd/idev/idev_prof_ls.go @@ -42,7 +42,7 @@ func init() { // profLsCmd represents the ls command var profLsCmd = &cobra.Command{ Use: "ls", - Short: "List installed provision profiles", + Short: "List installed provisioning profiles", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/ipsw/cmd/idev/idev_prov_clear.go b/cmd/ipsw/cmd/idev/idev_prov_clear.go index 67e237344..5f8ecb392 100644 --- a/cmd/ipsw/cmd/idev/idev_prov_clear.go +++ b/cmd/ipsw/cmd/idev/idev_prov_clear.go @@ -39,7 +39,7 @@ func init() { // provClearCmd represents the clear command var provClearCmd = &cobra.Command{ Use: "clear", - Short: "Remove all provision profiles", + Short: "Remove all provisioning profiles", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/ipsw/cmd/idev/idev_prov_dump.go b/cmd/ipsw/cmd/idev/idev_prov_dump.go index 371eda683..84b776580 100644 --- a/cmd/ipsw/cmd/idev/idev_prov_dump.go +++ b/cmd/ipsw/cmd/idev/idev_prov_dump.go @@ -43,7 +43,7 @@ func init() { // provDumpCmd represents the dump command var provDumpCmd = &cobra.Command{ Use: "dump", - Short: "Dump installed provision profiles", + Short: "Dump installed provisioning profiles", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/ipsw/cmd/idev/idev_prov_install.go b/cmd/ipsw/cmd/idev/idev_prov_install.go index d1eceb5d8..e5bbe569c 100644 --- a/cmd/ipsw/cmd/idev/idev_prov_install.go +++ b/cmd/ipsw/cmd/idev/idev_prov_install.go @@ -39,7 +39,7 @@ func init() { // provInstallCmd represents the install command var provInstallCmd = &cobra.Command{ Use: "install ", - Short: "Install a provision profile (.mobileprovision file)", + Short: "Install a provisioning profile (.mobileprovision file)", SilenceUsage: true, SilenceErrors: true, Args: cobra.ExactArgs(1), diff --git a/cmd/ipsw/cmd/idev/idev_prov_ls.go b/cmd/ipsw/cmd/idev/idev_prov_ls.go index fc890cfe5..959852a9a 100644 --- a/cmd/ipsw/cmd/idev/idev_prov_ls.go +++ b/cmd/ipsw/cmd/idev/idev_prov_ls.go @@ -42,7 +42,7 @@ func init() { // provLsCmd represents the ls command var provLsCmd = &cobra.Command{ Use: "ls", - Short: "List installed provision profiles", + Short: "List installed provisioning profiles", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/ipsw/cmd/idev/idev_prov_rm.go b/cmd/ipsw/cmd/idev/idev_prov_rm.go index 941968ad5..62bc69eb3 100644 --- a/cmd/ipsw/cmd/idev/idev_prov_rm.go +++ b/cmd/ipsw/cmd/idev/idev_prov_rm.go @@ -39,7 +39,7 @@ func init() { // provRmCmd represents the rm command var provRmCmd = &cobra.Command{ Use: "rm ", - Short: "Remove a provision profile", + Short: "Remove a provisioning profile", SilenceUsage: true, SilenceErrors: true, Args: cobra.ExactArgs(1), diff --git a/cmd/ipsw/cmd/img3/img3.go b/cmd/ipsw/cmd/img3/img3.go index 909ec2a7b..246f83e84 100644 --- a/cmd/ipsw/cmd/img3/img3.go +++ b/cmd/ipsw/cmd/img3/img3.go @@ -23,7 +23,6 @@ package img3 import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) // Img3Cmd represents the img3 command @@ -31,12 +30,6 @@ var Img3Cmd = &cobra.Command{ Use: "img3", Short: "Parse Img3", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/img4/img4.go b/cmd/ipsw/cmd/img4/img4.go index fe7081a0d..d7ab2172e 100644 --- a/cmd/ipsw/cmd/img4/img4.go +++ b/cmd/ipsw/cmd/img4/img4.go @@ -22,10 +22,7 @@ THE SOFTWARE. package img4 import ( - "github.com/apex/log" - "github.com/fatih/color" "github.com/spf13/cobra" - "github.com/spf13/viper" ) // Img4Cmd represents the img4 command @@ -33,16 +30,6 @@ var Img4Cmd = &cobra.Command{ Use: "img4", Short: "Parse and manipulate IMG4 files", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - if viper.GetBool("verbose") { - log.SetLevel(log.DebugLevel) - } - color.NoColor = viper.GetBool("no-color") - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/kernel/kernel.go b/cmd/ipsw/cmd/kernel/kernel.go index 7b9ccee45..98facd467 100644 --- a/cmd/ipsw/cmd/kernel/kernel.go +++ b/cmd/ipsw/cmd/kernel/kernel.go @@ -23,7 +23,6 @@ package kernel import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) // KernelcacheCmd represents the kernelcache command @@ -32,12 +31,6 @@ var KernelcacheCmd = &cobra.Command{ Aliases: []string{"k"}, Short: "Parse kernelcache", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/kernel/kernel_kexts.go b/cmd/ipsw/cmd/kernel/kernel_kexts.go index d24046657..2219509c7 100644 --- a/cmd/ipsw/cmd/kernel/kernel_kexts.go +++ b/cmd/ipsw/cmd/kernel/kernel_kexts.go @@ -49,7 +49,7 @@ func init() { var kextsCmd = &cobra.Command{ Use: "kexts ", Aliases: []string{"k"}, - Short: "List kernel extentions", + Short: "List kernel extensions", Args: cobra.MinimumNArgs(1), SilenceUsage: true, SilenceErrors: true, diff --git a/cmd/ipsw/cmd/macho/macho.go b/cmd/ipsw/cmd/macho/macho.go index e123b0d01..392a0813d 100644 --- a/cmd/ipsw/cmd/macho/macho.go +++ b/cmd/ipsw/cmd/macho/macho.go @@ -23,7 +23,6 @@ package macho import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) // MachoCmd represents the macho command @@ -32,12 +31,6 @@ var MachoCmd = &cobra.Command{ Aliases: []string{"m"}, Short: "Parse MachO", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/macho/macho_disass.go b/cmd/ipsw/cmd/macho/macho_disass.go index b019d8c21..befa9ca53 100644 --- a/cmd/ipsw/cmd/macho/macho_disass.go +++ b/cmd/ipsw/cmd/macho/macho_disass.go @@ -245,7 +245,7 @@ var machoDisassCmd = &cobra.Command{ Middle: 0, AsJSON: asJSON, Demangle: demangleFlag, - Quite: quiet, + Quiet: quiet, Color: viper.GetBool("color") && !viper.GetBool("no-color") && !decompile, }) @@ -371,7 +371,7 @@ var machoDisassCmd = &cobra.Command{ Middle: middleAddr, AsJSON: asJSON, Demangle: demangleFlag, - Quite: quiet, + Quiet: quiet, Color: viper.GetBool("color") && !viper.GetBool("no-color") && !decompile, }) diff --git a/cmd/ipsw/cmd/macho/macho_patch_add.go b/cmd/ipsw/cmd/macho/macho_patch_add.go index e5e59b537..7f3b23dd0 100644 --- a/cmd/ipsw/cmd/macho/macho_patch_add.go +++ b/cmd/ipsw/cmd/macho/macho_patch_add.go @@ -62,7 +62,7 @@ var supportedAddLCs = []string{ func init() { machoPatchCmd.AddCommand(machoPatchAddCmd) machoPatchAddCmd.Flags().BoolP("overwrite", "f", false, "Overwrite file") - machoPatchAddCmd.Flags().BoolP("re-sign", "s", false, "Adhoc sign file") + machoPatchAddCmd.Flags().BoolP("re-sign", "s", false, "Ad-hoc sign file") machoPatchAddCmd.Flags().StringP("output", "o", "", "Output new file") viper.BindPFlag("macho.patch.add.overwrite", machoPatchAddCmd.Flags().Lookup("overwrite")) viper.BindPFlag("macho.patch.add.re-sign", machoPatchAddCmd.Flags().Lookup("re-sign")) diff --git a/cmd/ipsw/cmd/macho/macho_patch_rm.go b/cmd/ipsw/cmd/macho/macho_patch_rm.go index bcc73fd85..9c63b637f 100644 --- a/cmd/ipsw/cmd/macho/macho_patch_rm.go +++ b/cmd/ipsw/cmd/macho/macho_patch_rm.go @@ -62,7 +62,7 @@ var supportedRmLCs = []string{ func init() { machoPatchCmd.AddCommand(machoPatchRmCmd) machoPatchRmCmd.Flags().BoolP("overwrite", "f", false, "Overwrite file") - machoPatchRmCmd.Flags().BoolP("re-sign", "s", false, "Adhoc sign file") + machoPatchRmCmd.Flags().BoolP("re-sign", "s", false, "Ad-hoc sign file") machoPatchRmCmd.Flags().StringP("output", "o", "", "Output new file") viper.BindPFlag("macho.patch.rm.overwrite", machoPatchRmCmd.Flags().Lookup("overwrite")) viper.BindPFlag("macho.patch.rm.re-sign", machoPatchRmCmd.Flags().Lookup("re-sign")) diff --git a/cmd/ipsw/cmd/ota/ota.go b/cmd/ipsw/cmd/ota/ota.go index 9397ee150..a4b1f4ec1 100644 --- a/cmd/ipsw/cmd/ota/ota.go +++ b/cmd/ipsw/cmd/ota/ota.go @@ -43,12 +43,6 @@ var OtaCmd = &cobra.Command{ Use: "ota", Short: "Parse OTAs", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/pbzx.go b/cmd/ipsw/cmd/pbzx.go index 7f6a14247..26d112dab 100644 --- a/cmd/ipsw/cmd/pbzx.go +++ b/cmd/ipsw/cmd/pbzx.go @@ -43,7 +43,7 @@ func init() { // pbzxCmd represents the pbzx command var pbzxCmd = &cobra.Command{ Use: "pbzx", - Short: "Decompess pbzx files", + Short: "Decompress pbzx files", Args: cobra.ExactArgs(1), SilenceUsage: true, SilenceErrors: true, diff --git a/cmd/ipsw/cmd/sb/sb.go b/cmd/ipsw/cmd/sb/sb.go index 9a942c49e..fcda0727b 100644 --- a/cmd/ipsw/cmd/sb/sb.go +++ b/cmd/ipsw/cmd/sb/sb.go @@ -23,7 +23,6 @@ package sb import ( "github.com/spf13/cobra" - "github.com/spf13/viper" ) // SbCmd represents the sb command @@ -32,12 +31,6 @@ var SbCmd = &cobra.Command{ Short: "Sandbox commands", Args: cobra.NoArgs, Hidden: true, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - viper.BindPFlag("diff-tool", cmd.Flags().Lookup("diff-tool")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/ssh/ssh.go b/cmd/ipsw/cmd/ssh/ssh.go index ecc2a4af9..8ceabd2ea 100644 --- a/cmd/ipsw/cmd/ssh/ssh.go +++ b/cmd/ipsw/cmd/ssh/ssh.go @@ -46,11 +46,6 @@ var SSHCmd = &cobra.Command{ Use: "ssh", Short: "SSH into a jailbroken device", Args: cobra.NoArgs, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - viper.BindPFlag("color", cmd.Flags().Lookup("color")) - viper.BindPFlag("no-color", cmd.Flags().Lookup("no-color")) - viper.BindPFlag("verbose", cmd.Flags().Lookup("verbose")) - }, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, diff --git a/cmd/ipsw/cmd/ssh/ssh_debugserver.go b/cmd/ipsw/cmd/ssh/ssh_debugserver.go index 9a2a3aeab..f75d830f5 100644 --- a/cmd/ipsw/cmd/ssh/ssh_debugserver.go +++ b/cmd/ipsw/cmd/ssh/ssh_debugserver.go @@ -50,7 +50,7 @@ func init() { var sshDebugserverCmd = &cobra.Command{ Use: "debugserver", Aliases: []string{"ds"}, - Short: "Prep device for remote debugging", + Short: "Prepare device for remote debugging", Args: cobra.NoArgs, SilenceUsage: true, SilenceErrors: true, diff --git a/pkg/disass/disass.go b/pkg/disass/disass.go index f10b53be1..f4f9a3e13 100644 --- a/pkg/disass/disass.go +++ b/pkg/disass/disass.go @@ -126,7 +126,7 @@ type Config struct { Middle uint64 AsJSON bool Demangle bool - Quite bool + Quiet bool Color bool } type AddrDetails struct { diff --git a/pkg/disass/macho.go b/pkg/disass/macho.go index 2a1360e30..58bfd6255 100644 --- a/pkg/disass/macho.go +++ b/pkg/disass/macho.go @@ -40,7 +40,7 @@ func (d MachoDisass) Demangle() bool { return d.cfg.Demangle } func (d MachoDisass) Quite() bool { - return d.cfg.Quite + return d.cfg.Quiet } func (d MachoDisass) Color() bool { return d.cfg.Color diff --git a/pkg/dyld/disass.go b/pkg/dyld/disass.go index e519dd389..893f1766d 100644 --- a/pkg/dyld/disass.go +++ b/pkg/dyld/disass.go @@ -30,7 +30,7 @@ func (d DyldDisass) Demangle() bool { return d.cfg.Demangle } func (d DyldDisass) Quite() bool { - return d.cfg.Quite + return d.cfg.Quiet } func (d DyldDisass) Color() bool { return d.cfg.Color diff --git a/pkg/kernelcache/mig.go b/pkg/kernelcache/mig.go index 2685c92ba..4457f41a7 100644 --- a/pkg/kernelcache/mig.go +++ b/pkg/kernelcache/mig.go @@ -261,7 +261,7 @@ func getMigInitFunc(m *macho.File) (*types.Function, error) { engine := disass.NewMachoDisass(m, &disass.Config{ Data: data, StartAddress: text.Addr, - Quite: true, + Quiet: true, }) if err := engine.Triage(); err != nil { return nil, fmt.Errorf("first pass triage failed: %v", err) diff --git a/pkg/signature/signature.go b/pkg/signature/signature.go index 3490e39cd..8dd73b09a 100644 --- a/pkg/signature/signature.go +++ b/pkg/signature/signature.go @@ -97,7 +97,7 @@ func (sm SymbolMap) symbolicate(m *macho.File, name string, sigs Symbolicator, q engine := disass.NewMachoDisass(m, &disass.Config{ Data: data, StartAddress: text.Addr, - Quite: true, + Quiet: true, }) log.WithField("name", name).Info("Analyzing MachO...")