Skip to content

Commit

Permalink
Update tc.go
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Oct 5, 2024
1 parent ba13d0d commit 4b11320
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmd/ipsw/cmd/fw/tc.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,18 @@ var tcCmd = &cobra.Command{
os.Remove(f)
}
} else {
if ok, _ := magic.IsIm4p(filepath.Clean(args[0])); ok {
if ok, _ := magic.IsImg4(filepath.Clean(args[0])); ok {
log.WithField("file", filepath.Clean(args[0])).Debug("Processing IMG4 file")
img4, err := img4.OpenImg4(filepath.Clean(args[0]))
if err != nil {
return fmt.Errorf("failed to open img4: %v", err)
}
tc, err := fwcmd.ParseTrustCache(img4.IM4P.Data)
if err != nil {
return fmt.Errorf("failed to parse trust cache: %v", err)
}
tcs[filepath.Clean(args[0])] = tc
} else if ok, _ := magic.IsIm4p(filepath.Clean(args[0])); ok {
log.WithField("file", filepath.Clean(args[0])).Debug("Processing IM4P file")
im4p, err := img4.OpenIm4p(filepath.Clean(args[0]))
if err != nil {
Expand Down

0 comments on commit 4b11320

Please sign in to comment.