IDEA社区版创建springboot web项目

IDEA社区版+springboot创建项目(图解流程0
Spring Boot 返回 JSON 数据及数据封装
Springboot启动后外部无法通过IP+端口方式访问,只能本地访问localhost
Springboot中使用Xstream进行XML与Bean 相互转换
ava开发之调用shell命令并获取执行结果(Mac)
Java ArrayList、string、string[]之间的转换
Springboot后台设置允许跨域的方法
org.springframework.web.HttpMediaTypeNotSupported...
user-agent对应的型号

获取JavaUDID上传

@RequestMapping(value = "/uploadUDID",method  = {RequestMethod.GET,RequestMethod.POST})
    public void uploadUDID(HttpServletRequest request,HttpServletResponse response){

        try {
            response.setContentType("text/html;charset=UTF-8");
            request.setCharacterEncoding("UTF-8");
            //获取HTTP请求的输入流
            InputStream is = request.getInputStream();
            //已HTTP请求输入流建立一个BufferedReader对象
            BufferedReader br = new BufferedReader(new InputStreamReader(is,"UTF-8"));
            StringBuilder sb = new StringBuilder();

            //读取HTTP请求内容
            String buffer = null;
            while ((buffer = br.readLine()) != null) {
                sb.append(buffer);
            }
            String content = sb.toString().substring(sb.toString().indexOf("")+8);
            //content就是接收到的xml字符串
            content = content.replaceAll("\t","");
            int from = content.indexOf("")+"".length();
            content = content.substring(from);
            int to = content.indexOf("");
            content = content.substring(0,to);
            content = content.replaceAll("","");
            content = content.replaceAll("","=");
            content = content.replaceAll("","");
            content = content.replaceAll("","#*#");
            HashMap plistMap = new HashMap();
            String[] list = content.split("#*#");
            for (String var : list){
                String[] keyVals = var.split("=");
               if(keyVals.length == 2){
                   plistMap.put(keyVals[0],keyVals[1]);
               }
            }
            System.out.println(plistMap);
            String udid = plistMap.get("UDID");
            response.setStatus(301); //301之后iOS设备会自动打开safari浏览器
            response.setHeader("Location", "http://192.168.3.57:8080/mysign/index2.html?UDID="+udid);
            //http://192.168.1.106:8080/udid.jsp 是用于显示udid的页面,也可以利用之前的下载mobileprofile文件页面
        }catch (Exception e){

        }

@RequestMapping(value = "/createUDIDConfig",method  = {RequestMethod.GET,RequestMethod.POST})
    public String createUDIDCnofig(){

        String cmd = "/bin/bash";
        String path = "/Users/tony/fastlane_workspace/SuperSign/test.sh";
        HashMap shParams = new HashMap();
        String uuid =  UUID.randomUUID().toString().replace("-", "");
        shParams.put("--playload_udid",uuid);
        shParams.put("--playload_url","http://192.168.3.57:8091/json/uploadUDID");
        shParams.put("--playload_name","红苹果绿菠萝");
        HashMap resultMap = exec(cmd,path,shParams);
        return (String) resultMap.get("msg");

    }

    public HashMap exec(String cmd,String path,HashMap params) {
        HashMap resultMap = new HashMap();

        ArrayList commandList = new ArrayList();
        commandList.add(cmd);
        commandList.add(path);
        for (String key : params.keySet()) {
            commandList.add(key+"="+params.get(key));
        }
        String[] commandArray = (String[])commandList.toArray(new String[commandList.size()]);
        int exitValue = 0;
        String resultString = "";
        try {
            Process process = Runtime.getRuntime().exec(commandArray);
            exitValue = process.waitFor();
            BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line;
            while ((line = input.readLine()) != null) {
                resultString = resultString + line + "
"; } input.close(); process.destroy(); }catch (Exception e){ e.printStackTrace(); } resultMap.put("code",exitValue); resultMap.put("msg",resultString); return resultMap; } @RequestMapping(value = "/createProvisioning",method = {RequestMethod.GET,RequestMethod.POST}) public String createProvisioning(){ String cmd = "/bin/bash"; String path = "/Users/tony/fastlane_workspace/SuperSign/create_provision.sh"; HashMap shParams = new HashMap(); String bundleId = "com.ak.rf.hoc.hello"; String device_udid = "942d4763983c8219082fd8218e5a4f53265495f8"; String provision_path = "abchhhh123.mobileprovision"; shParams.put("--bundleId",bundleId); shParams.put("--device_udid",device_udid); shParams.put("--provision_path",provision_path); HashMap resultMap = exec(cmd,path,shParams); return (String) resultMap.get("msg"); } private String getIpAdrress(HttpServletRequest request) { String agent = request.getHeader("user-agent"); System.out.println("user-agent: "+agent); String Xip = request.getHeader("X-Real-IP"); String XFor = request.getHeader("X-Forwarded-For"); if(XFor != null && !XFor.isEmpty() && !"unKnown".equalsIgnoreCase(XFor)){ //多次反向代理后会有多个ip值,第一个ip才是真实ip int index = XFor.indexOf(","); if(index != -1){ return XFor.substring(0,index); }else{ return XFor; } } XFor = Xip; if(XFor != null && !XFor.isEmpty() && !"unKnown".equalsIgnoreCase(XFor)){ return XFor; } if (XFor == null || XFor.isEmpty() || "unknown".equalsIgnoreCase(XFor)) { XFor = request.getHeader("Proxy-Client-IP"); } if (XFor == null || XFor.isEmpty() || "unknown".equalsIgnoreCase(XFor)) { XFor = request.getHeader("WL-Proxy-Client-IP"); } if (XFor == null || XFor.isEmpty() || "unknown".equalsIgnoreCase(XFor)) { XFor = request.getHeader("HTTP_CLIENT_IP"); } if (XFor == null || XFor.isEmpty() || "unknown".equalsIgnoreCase(XFor)) { XFor = request.getHeader("HTTP_X_FORWARDED_FOR"); } if (XFor == null || XFor.isEmpty() || "unknown".equalsIgnoreCase(XFor)) { XFor = request.getRemoteAddr(); } return XFor; } }

{
SERIAL=FK3VQJ6JJCL6,
CHALLENGE=4C1B718D-A51D-7430-2AE1-F02C9868CCB3_1566645538_49e7e7ebe0a1e399095960365c8a5d6d, PRODUCT=iPhone10,3,
VERSION=16G77,
UDID=942d4763983c8219082fd8218e5a4f53265495f8
}

#! /bin./bash

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
#脚本所在的文件夹
__filePath=$(dirname "$0")
__filePath2=`pwd`
__srcPath=$__filePath
__absolutePath="/Users/tony/fastlane_workspace/SuperSign"

source "$__srcPath/parseParams.sh"


bundleId=`parseParams $@ "--bundleId"`
device_udid=`parseParams $@ "--device_udid"`
provision_path=`parseParams $@ "--provision_path"`
provision_path=`echo "/Users/tony/fastlane_workspace/SuperSign/$provision_path"`
echo "========================
" echo "bundleId: $bundleId
" echo "device_udid: $device_udid
" echo "provision_path: $provision_path
" echo "=========通过UDID生成证书===============
" cd /Users/tony/fastlane_workspace/SuperSign fastlane custom_spaceship \ bundleId:$bundleId \ device_udid:$device_udid \ provision_path:$provision_path echo "============重签名===============" ipa_path="/Users/tony/fastlane_workspace/SuperSign/5d638d7045434.ipa" sign_identity="iPhone Distribution: Nevin Mia (H4ZBQUPR3Q)" output_path="$__absolutePath/hello.ipa" # fastlane sigh resign $ipa_path \ # --signing_identity "iPhone Distribution: Nevin Mia (H4ZBQUPR3Q)" \ # -p $provision_path #-c "iPhone Distribution: Nevin Mia (H4ZBQUPR3Q)" \ ./CoolResign \ -i $ipa_path \ -p $provision_path \ -c "$sign_identity" \ -o $output_path \ -b "com.ak.jd" echo "============生成下载描述文件===============" download_path="$__absolutePath/download.plist" cat > "$download_path" << END_TEXT items assets kind software-package url https://d-hk.ggonet.cn/ipasigned/5d638d7045434.ipa?s=c0aaddc450f110f7d1c41713348ae398 kind display-image needs-shine url https://static.app2.cn/icon/5d63a67a1f8d6.png kind full-size-image needs-shine url https://static.app2.cn/icon/5d63a67a1f8d6.png metadata bundle-identifier $bundle_id bundle-version 1.0.52 kind software subtitle title ak彩票本地 END_TEXT echo "====生成下载文件成功======" cat $download_path

JS跨域保存获取数据

  • js iframe跨域访问
    A网站的html


  
    
    
    
    
    
    
    
    
    
    
    
  
  
    ask
    
      

    

    
  

用于临时通信保存跨域访问的B网站的b.html



      
  


你可能感兴趣的:(IDEA社区版创建springboot web项目)