# Plugin-Small-Framework **Repository Path**: czmz/Plugin-Small-Framework ## Basic Information - **Project Name**: Plugin-Small-Framework - **Description**: 快速集成small的框架 - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-01-18 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #Plugin-Small-Framework 模拟更新请求 /** * 增量更新 * @return */ @RequestMapping(path = "/checkupgrade",method=RequestMethod.GET) public ModelAndView checkupgrade(@RequestParam("versions") String versions){ HashMap map =new HashMap(); ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally try { Map versionsData = mapper.readValue(versions, Map.class); for(Entry da:versionsData.entrySet()){ if(da.getKey().equals("com.czmc.smalldemo.app.main")){ if((int)da.getValue()<=1){ Map manifest = new HashMap(); ArrayList bundles = new ArrayList(); Map bundle1 = new HashMap(); bundle1.put("uri","lib.core"); bundle1.put("pkg","com.czmc.smalldemo.lib.core"); bundles.add(bundle1); Map bundle2 = new HashMap(); bundle2.put("uri","lib.other"); bundle2.put("pkg","com.czmc.smalldemo.lib.other"); bundles.add(bundle2); Map bundle3 = new HashMap(); bundle3.put("uri","main"); bundle3.put("pkg","com.czmc.smalldemo.app.main"); bundles.add(bundle3); manifest.put("version", "1.0.0"); manifest.put("bundles",bundles); ArrayList data = new ArrayList(); Map updates = new HashMap(); updates.put("pkg", "com.czmc.smalldemo.app.main"); updates.put("url","http://192.168.0.112:8080/DataTest/file/libcom_czmc_smalldemo_app_main.so"); data.add(updates); map.put("manifest", manifest); map.put("updates", data); map.put("status", "success"); map.put("code", "200"); map.put("need", true); }else{ map.put("status", "success"); map.put("code", "200"); map.put("need", false); } } } } catch (IOException e) { // TODO Auto-generated catch block map.put("code", 404); map.put("status", "fail"); e.printStackTrace(); } return new ModelAndView(new MappingJackson2JsonView(),map); }