2026-05-08 18:16:07 +08:00
|
|
|
//go:build !emptytemplates
|
|
|
|
|
// +build !emptytemplates
|
|
|
|
|
|
2022-10-28 00:46:54 +08:00
|
|
|
package pkg
|
2026-05-19 10:48:37 -07:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
_ "embed"
|
|
|
|
|
|
|
|
|
|
"github.com/chainreactors/utils/encode"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//go:embed data/spray_rule.bin
|
|
|
|
|
var sprayRuleData []byte
|
|
|
|
|
|
|
|
|
|
//go:embed data/spray_common.bin
|
|
|
|
|
var sprayCommonData []byte
|
|
|
|
|
|
|
|
|
|
//go:embed data/spray_dict.bin
|
|
|
|
|
var sprayDictData []byte
|
|
|
|
|
|
|
|
|
|
//go:embed data/extract.bin
|
|
|
|
|
var extractData []byte
|
|
|
|
|
|
|
|
|
|
//go:embed data/port.bin
|
|
|
|
|
var portData []byte
|
|
|
|
|
|
|
|
|
|
var RandomDir = "/g8kZMwp4oeKsL2in"
|
|
|
|
|
|
2026-05-08 18:16:07 +08:00
|
|
|
func loadEmbeddedConfig(typ string) []byte {
|
2026-05-19 10:48:37 -07:00
|
|
|
if typ == "spray_rule" {
|
|
|
|
|
return encode.MustDeflateDeCompress(sprayRuleData)
|
|
|
|
|
}else if typ == "spray_common" {
|
|
|
|
|
return encode.MustDeflateDeCompress(sprayCommonData)
|
|
|
|
|
}else if typ == "spray_dict" {
|
|
|
|
|
return encode.MustDeflateDeCompress(sprayDictData)
|
|
|
|
|
}else if typ == "extract" {
|
|
|
|
|
return encode.MustDeflateDeCompress(extractData)
|
|
|
|
|
}else if typ == "port" {
|
|
|
|
|
return encode.MustDeflateDeCompress(portData)
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|