macho/macho-go/internal/wrapper/action/rewrite_imports.go

26 lines
474 B
Go
Raw Permalink Normal View History

2023-07-11 10:06:59 +07:00
package action
import (
. "ios-wrapper/internal/wrapper/ofile"
)
2023-07-12 13:37:54 +07:00
type rewriteImports struct {
symbols []string
2023-07-11 10:06:59 +07:00
}
func (action *rewriteImports) withMacho(mf *MachoFile) error {
2023-07-12 13:37:54 +07:00
mc := mf.Context()
mc.RewriteImportsTable(action.symbols)
2023-07-11 10:06:59 +07:00
return nil
}
func (action *rewriteImports) withFat(ff *FatFile) error {
return defaultWithFat(action, ff)
}
func NewRewriteImportsWithKeepSymbolsAction(symbols []string) *rewriteImports {
return &rewriteImports{
2023-07-12 13:37:54 +07:00
symbols,
}
2023-07-11 10:06:59 +07:00
}