删除反编译工具生成的/* 1 */
2019独角兽企业重金招聘Python工程师标准>>>
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;/*** 删除项目中* * @author Sheamus**/
public class Delete {//static String tartgetDir = "D:\\";static String tartgetDir = "D:\\Test1\\itjds_server\\";//static String sourceDir = "C:\\Users\\Sheamus\\Desktop\\";static String sourceDir = "D:\\Test\\itjds_server\\";//static String projectName = "itjdsTest";static String projectName = "src";static String encoding = "utf-8";public static void main(String[] args) {//C:\\Users\\Sheamus\\Desktop\\itjds_org (项目路径信息)//源String sourcePath = sourceDir + projectName;refreshFileList(sourcePath);}public static void refreshFileList(String sourcePath) {File dir = new File(sourcePath);File[] files = dir.listFiles();if (files == null){System.out.println("该目录下没有任何一个文件!");return;}for (int i = 0; i < files.length; i++) {if (files[i].isDirectory()) {//拼接路径String absolutePath = files[i].getAbsolutePath();String replace = absolutePath.replace(sourceDir, tartgetDir);//System.out.println(replace);File repFile = new File(replace);//创建文件夹if(!repFile.exists()) {repFile.mkdirs();}refreshFileList(files[i].getAbsolutePath());}else {String strFileName = files[i].getAbsolutePath();
// if(strFileName.endsWith(".java")){//拼接路径String replace = strFileName.replace(sourceDir, tartgetDir);//System.out.println(replace);File repFile = new File(replace);if(!repFile.exists()) { try { repFile.createNewFile(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } InputStreamReader read = null;BufferedReader bufferedReader = null;OutputStreamWriter out = null;BufferedWriter writer = null;try {read = new InputStreamReader(new FileInputStream(files[i]),encoding);bufferedReader = new BufferedReader(read);String lineTxt = null;out = new OutputStreamWriter(new FileOutputStream(repFile),encoding);writer = new BufferedWriter(out);while((lineTxt = bufferedReader.readLine()) != null){if(lineTxt.startsWith("/*") && lineTxt.contains("*/") ) {String substring = lineTxt.substring(lineTxt.indexOf("*/") + 2);writer.append(substring+"\n");writer.flush();} else {writer.append(lineTxt + "\n");writer.flush();}/*if(lineTxt.startsWith("/* Location:") || lineTxt.startsWith(" * Qualified Name:") || lineTxt.startsWith(" * JD-Core Version:")||) {}*/}} catch (Exception e) {System.out.println("读取文件内容出错");e.printStackTrace();}finally{if(writer != null) {try {writer.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}if(out != null) {try {out.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}if(bufferedReader != null) {try {bufferedReader.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}if(read != null) {try {read.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}
// }}}}
}
转载于:https://my.oschina.net/Sheamus/blog/648658
删除反编译工具生成的/* 1 */相关推荐
- Apktool|ShakaApktool 简体中文汉化版|APK反编译工具(更新)
Apktool|ShakaApktool 简体中文汉化版|APK反编译工具 ShakaApktool源码:https://github.com/rover12421/ShakaApktool 作者:r ...
- java反编译工具真的很强大!
以前只听说过有反编译工具,但从来没用过,昨天我的项目指导老师让我帮他调一个汇编演示器的java程序,是从linux下直接拷贝过来的,里面全是二进制字节-class文件,我当时脑袋就蒙了,这怎么调试.直 ...
- Java代码混淆案例(附反编译工具)
我们开发的软件上线后,经常会遇到核心代码不希望给别人抄袭,但系统是用Java开发的,又无法避免被反编译的情况,这样可以用代码混淆的方式来解决. 一.编译 顾名思义,就是将我们写的代码运行一遍,然 ...
- jsc反编译工具编写探索之路
对于经常做游戏安全逆向的读者来说,可能会经常遇到Cocos2dx编写的游戏.这个国产开源的游戏开发引擎支持多种编程语言进行游戏开发:发括主流的C/C++/JavaScript/Lua,之前,与大家讨论 ...
- 三种常用的Apk反编译工具
apk反编译工具: 1.apktool 利用命令行查看Java代码,需配合GUI 查看代码 缺点:查看Java代码时,需要先把apk文件变成zip文件,获取到dex文件,运行命令行d2j-dex2ja ...
- java反编译工具_如何保护Java程序 才能防止Java反编译
简介:Java是一种跨平台的.解释型语言.Java 源代码编译中间"字节码"存储于class文件中.Class文件是一种字节码形式的中间代码,该字节码中包括了很多源代码的信息,例如 ...
- Java后端知识之代码混淆-避免反编译工具获取原码
java, 代码混淆, 编译, 反编译 本文是向大家介绍java后端小知识,它能够实现编译后的class代码加密,能够避免使用反编译工具获取源码. 本文介绍java代码编译成class后,怎么避免用反 ...
- Android反编译工具及使用
文章目录 1. 工具 2. 步骤 3. 资源反编译 4 反编译出来的APK重新打包 5. 反编译工具jadx 1. 工具 Android反编译需要以下两款工具 dex2jar-- 这个工具用于将 de ...
- bat小工具_小程序反编译工具在windows系统下的调用脚本
点击上方蓝字可以订阅哦 之前的文章中介绍了小程序的反编译工具,工具在 Linux 系统下使用时执行bingo.sh [xxx.wxapkg]就可以. 有小伙伴不知道在windows系统下如何使用,这里 ...
最新文章
- 谷歌如何利用人工智能重塑美国医疗行业?
- python字符串endswith,Python字符串| 具有示例的endswith()方法
- linux下载哪个python版本-Linux下切换Python版本的几种方法
- python中变量的基本使用及命名规则
- D3js(五):tooltips
- 11.11 ntsysv:管理开机服务
- 干货!专治设计师没灵感没创意没素材
- oracle中每月调用一次,JOB——手工指定Oracle中job执行的时间间隔
- C语言实现大数计算器
- CSS选择器优先级以及权重计算方法
- maven 常用命令
- [转]Linux下的虚拟光驱和虚拟软驱
- 防火墙结构之屏蔽主机体系结构
- 惠普HP LaserJet Pro M15a 打印机驱动
- TI-RTOS学习笔记(三)—— 驱动程序框架
- 计算机硬件品牌的调研报告,计算机硬件市场调查报告.doc
- 浅谈入职两个半月心得和感受
- 机器学习历程——人工智能基础与应用导论(8)(神经网络——感知机模型)
- 给菜鸟站长的全面易懂的建站教程!
- qq音乐获取歌曲源链接地址