MCPcopy Create free account
hub / github.com/c0ny1/captcha-killer / encdoeLable

Method encdoeLable

src/main/java/utils/LableParser.java:90–121  ·  view source on GitHub ↗
(String type,String str)

Source from the content-addressed store, hash-verified

88
89
90 private String encdoeLable(String type,String str){
91 String encodeStr = "";
92
93 switch (type){
94 case "BASE64":
95 if(str.startsWith("[base64]")){
96 str = str.replace("[base64]","");
97 encodeStr = base64Encode(base64Decode(str));
98 }else {
99 encodeStr = base64Encode(str);
100 }
101 break;
102 case "URLENCODE":
103 if(str.startsWith("[base64]")) {
104 str = str.replace("[base64]","");
105 byte[] byteRes = base64Decode(str);
106 encodeStr = URLEncode(new String(byteRes));
107 }else {
108 encodeStr = URLEncode(str);
109 }
110 break;
111 case "IMG_RAW":
112 //注意:byte[]转string后,string再转byte[]无法还原的,故该地方采用base64编码存储byte[],等到使用时在解码为byte[]。
113 String base64Img = base64Encode(byteImage);
114 encodeStr = "[base64]" + base64Img + "[base64]";
115 break;
116 default:
117 encodeStr = str;
118 break;
119 }
120 return encodeStr;
121 }
122
123 public static void main(String[] args) {
124// String str = "a<@URLENCODE><@BASE64>1</@BASE64></@URLENCODE>b<@BASE64>sd<@IMG_RAW></@IMG_RAW>sds\n\rsdsdd</@BASE64>";

Callers 2

parseOneLableMethod · 0.95

Calls 3

base64EncodeMethod · 0.80
base64DecodeMethod · 0.80
URLEncodeMethod · 0.80

Tested by

no test coverage detected