Skip to content

Commit

Permalink
fix: ipsw ota --key-val flag
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Aug 2, 2024
1 parent 5d4f094 commit d6acb0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/ipsw/cmd/ota/ota_extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func init() {
otaExtractCmd.Flags().BoolP("kernel", "k", false, "Extract kernelcache")
otaExtractCmd.Flags().StringP("pattern", "p", "", "Regex pattern to match files")
otaExtractCmd.Flags().StringP("range", "r", "", "Regex pattern control the payloadv2 file range to search")
otaExtractCmd.Flags().StringP("key-val", "b", "", "Base64 encoded symmetric encryption key")
otaExtractCmd.Flags().String("key-val", "", "Base64 encoded symmetric encryption key")
otaExtractCmd.Flags().BoolP("confirm", "y", false, "Confirm searching for pattern in payloadv2 files")
otaExtractCmd.Flags().BoolP("decomp", "x", false, "Decompress pbzx files")
otaExtractCmd.Flags().StringP("output", "o", "", "Output folder")
Expand Down Expand Up @@ -99,6 +99,7 @@ var otaExtractCmd = &cobra.Command{
}
/* KERNELCACHE */
if viper.GetBool("ota.extract.kernel") {
log.Info("Extracting kernelcache(s)")
re := regexp.MustCompile(`kernelcache.*$`)
for _, f := range o.Files() { // search in OTA asset files
if f.IsDir() {
Expand Down Expand Up @@ -131,6 +132,7 @@ var otaExtractCmd = &cobra.Command{
}
}
}
return nil
}
/* ALL FILES */
if len(args) == 1 && !viper.IsSet("ota.extract.pattern") {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipsw/cmd/ota/ota_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {
otaLsCmd.Flags().BoolP("payload", "p", false, "List the payloadv2 files")
otaLsCmd.Flags().StringP("pattern", "r", "", "Regex pattern to match payloadv2 files")
otaLsCmd.Flags().BoolP("bom", "b", false, "List the post.bom files")
otaLsCmd.Flags().StringP("key-val", "b", "", "Base64 encoded symmetric encryption key")
otaLsCmd.Flags().String("key-val", "", "Base64 encoded symmetric encryption key")
otaLsCmd.Flags().BoolP("json", "j", false, "Output in JSON format")
otaLsCmd.MarkFlagsMutuallyExclusive("payload", "bom")
viper.BindPFlag("ota.ls.pattern", otaLsCmd.Flags().Lookup("pattern"))
Expand Down

0 comments on commit d6acb0a

Please sign in to comment.