导航:首页 > 操作系统 > android解压代码

android解压代码

发布时间:2022-09-14 18:55:27

android 怎么使用命令解压文件 就像java 使用winrar的命令似的

winrar的命令怎么会在android上有呢?
参考一下这个吧:http://orz.iteye.com/blog/110842

Ⅱ Android项目代码包生成的apk文件 能再解压成原来的项目代码包吗 (能看里面的src文件也行)

如果原来的代码没有进行混淆,那么利用反编译工具差不多可以原样反编译出来;
如果是有设置代码混淆,那么反编译出来的东西可能不一定看得懂了。
还有就是如果原来的apk用了第三方的加密工具(如爱加密或梆梆加密)之类的,或者自己写了非常规的apk加密,要反编译就更难了。
常用反编译工具apktool 还有些有界面的反编译工具

Ⅲ android 压缩文件

不清脆……

Ⅳ Android解压中文乱码

在Android中内置有解压的工具,一般可以使用下面的方法解压:

�注意import的包:

但是在解压遇到中文的时候,解压出来中文会变成乱码,把上面的编码改成啥都没用。

这时候可以使用apache-ant-zip的解压包来解决:

然后使用这个包中的引用:

Ⅳ android中如何代码压缩音频视频文件呢

知道怎么压缩文件,音视频文件应该差不多吧O.O
package com.once;

import java.io.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;

/**
* Java utils 实现的Zip工具
*
* @author once
*/
public class ZipUtils {
private static final int BUFF_SIZE = 1024 * 1024; // 1M Byte

/**
* 批量压缩文件(夹)
*
* @param resFileList 要压缩的文件(夹)列表
* @param zipFile 生成的压缩文件
* @throws IOException 当压缩过程出错时抛出
*/
public static void zipFiles(Collection<File> resFileList, File zipFile) throws IOException {
ZipOutputStream zipout = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(
zipFile), BUFF_SIZE));
for (File resFile : resFileList) {
zipFile(resFile, zipout, "");
}
zipout.close();
}

/**
* 批量压缩文件(夹)
*
* @param resFileList 要压缩的文件(夹)列表
* @param zipFile 生成的压缩文件
* @param comment 压缩文件的注释
* @throws IOException 当压缩过程出错时抛出
*/
public static void zipFiles(Collection<File> resFileList, File zipFile, String comment)
throws IOException {
ZipOutputStream zipout = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(
zipFile), BUFF_SIZE));
for (File resFile : resFileList) {
zipFile(resFile, zipout, "");
}
zipout.setComment(comment);
zipout.close();
}

/**
* 解压缩一个文件
*
* @param zipFile 压缩文件
* @param folderPath 解压缩的目标目录
* @throws IOException 当解压缩过程出错时抛出
*/
public static void upZipFile(File zipFile, String folderPath) throws ZipException, IOException {
File desDir = new File(folderPath);
if (!desDir.exists()) {
desDir.mkdirs();
}
ZipFile zf = new ZipFile(zipFile);
for (Enumeration<?> entries = zf.entries(); entries.hasMoreElements();) {
ZipEntry entry = ((ZipEntry)entries.nextElement());
InputStream in = zf.getInputStream(entry);
String str = folderPath + File.separator + entry.getName();
str = new String(str.getBytes("8859_1"), "GB2312");
File desFile = new File(str);
if (!desFile.exists()) {
File fileParentDir = desFile.getParentFile();
if (!fileParentDir.exists()) {
fileParentDir.mkdirs();
}
desFile.createNewFile();
}
OutputStream out = new FileOutputStream(desFile);
byte buffer[] = new byte[BUFF_SIZE];
int realLength;
while ((realLength = in.read(buffer)) > 0) {
out.write(buffer, 0, realLength);
}
in.close();
out.close();
}
}

/**
* 解压文件名包含传入文字的文件
*
* @param zipFile 压缩文件
* @param folderPath 目标文件夹
* @param nameContains 传入的文件匹配名
* @throws ZipException 压缩格式有误时抛出
* @throws IOException IO错误时抛出
*/
public static ArrayList<File> upZipSelectedFile(File zipFile, String folderPath,
String nameContains) throws ZipException, IOException {
ArrayList<File> fileList = new ArrayList<File>();

File desDir = new File(folderPath);
if (!desDir.exists()) {
desDir.mkdir();
}

ZipFile zf = new ZipFile(zipFile);
for (Enumeration<?> entries = zf.entries(); entries.hasMoreElements();) {
ZipEntry entry = ((ZipEntry)entries.nextElement());
if (entry.getName().contains(nameContains)) {
InputStream in = zf.getInputStream(entry);
String str = folderPath + File.separator + entry.getName();
str = new String(str.getBytes("8859_1"), "GB2312");
// str.getBytes("GB2312"),"8859_1" 输出
// str.getBytes("8859_1"),"GB2312" 输入
File desFile = new File(str);
if (!desFile.exists()) {
File fileParentDir = desFile.getParentFile();
if (!fileParentDir.exists()) {
fileParentDir.mkdirs();
}
desFile.createNewFile();
}
OutputStream out = new FileOutputStream(desFile);
byte buffer[] = new byte[BUFF_SIZE];
int realLength;
while ((realLength = in.read(buffer)) > 0) {
out.write(buffer, 0, realLength);
}
in.close();
out.close();
fileList.add(desFile);
}
}
return fileList;
}

/**
* 获得压缩文件内文件列表
*
* @param zipFile 压缩文件
* @return 压缩文件内文件名称
* @throws ZipException 压缩文件格式有误时抛出
* @throws IOException 当解压缩过程出错时抛出
*/
public static ArrayList<String> getEntriesNames(File zipFile) throws ZipException, IOException {
ArrayList<String> entryNames = new ArrayList<String>();
Enumeration<?> entries = getEntriesEnumeration(zipFile);
while (entries.hasMoreElements()) {
ZipEntry entry = ((ZipEntry)entries.nextElement());
entryNames.add(new String(getEntryName(entry).getBytes("GB2312"), "8859_1"));
}
return entryNames;
}

/**
* 获得压缩文件内压缩文件对象以取得其属性
*
* @param zipFile 压缩文件
* @return 返回一个压缩文件列表
* @throws ZipException 压缩文件格式有误时抛出
* @throws IOException IO操作有误时抛出
*/
public static Enumeration<?> getEntriesEnumeration(File zipFile) throws ZipException,
IOException {
ZipFile zf = new ZipFile(zipFile);
return zf.entries();

}

/**
* 取得压缩文件对象的注释
*
* @param entry 压缩文件对象
* @return 压缩文件对象的注释
* @throws UnsupportedEncodingException
*/
public static String getEntryComment(ZipEntry entry) throws UnsupportedEncodingException {
return new String(entry.getComment().getBytes("GB2312"), "8859_1");
}

/**
* 取得压缩文件对象的名称
*
* @param entry 压缩文件对象
* @return 压缩文件对象的名称
* @throws UnsupportedEncodingException
*/
public static String getEntryName(ZipEntry entry) throws UnsupportedEncodingException {
return new String(entry.getName().getBytes("GB2312"), "8859_1");
}

/**
* 压缩文件
*
* @param resFile 需要压缩的文件(夹)
* @param zipout 压缩的目的文件
* @param rootpath 压缩的文件路径
* @throws FileNotFoundException 找不到文件时抛出
* @throws IOException 当压缩过程出错时抛出
*/
private static void zipFile(File resFile, ZipOutputStream zipout, String rootpath)
throws FileNotFoundException, IOException {
rootpath = rootpath + (rootpath.trim().length() == 0 ? "" : File.separator)
+ resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), "GB2312");
if (resFile.isDirectory()) {
File[] fileList = resFile.listFiles();
for (File file : fileList) {
zipFile(file, zipout, rootpath);
}
} else {
byte buffer[] = new byte[BUFF_SIZE];
BufferedInputStream in = new BufferedInputStream(new FileInputStream(resFile),
BUFF_SIZE);
zipout.putNextEntry(new ZipEntry(rootpath));
int realLength;
while ((realLength = in.read(buffer)) != -1) {
zipout.write(buffer, 0, realLength);
}
in.close();
zipout.flush();
zipout.closeEntry();
}
}
}

Ⅵ 从android 的boot.img解压出来的kernal.gz怎么解压

这个kernel已经是zImage了,可以继续解压成Image。有些系统如果使用uboot引导的话,recovery的代码修改成uImage+uramdisk好了,不一定要使用andoid原生态的做法。 Image为内核映像文件,而zImage为内核的一种映像压缩文件,gzip弄开就好了。貌似你刚开始嵌入式开发啊,慢慢练习1年就好了。

Ⅶ [转载]新手必学:如何解包apk得到里面的源代码!

APK是AndroidPackage的缩写,即Android安装包(apk)。APK是类似Symbian Sis或Sisx的文件格式。通过将APK文件直接传到Android模拟器或Android手机中执行即可安装。apk文件和sis一样,把android sdk编译的工程打包成一个安装程序文件,格式为apk。 APK文件其实是zip格式,但后缀名被修改为apk,通过UnZip解压后,可以看到Dex文件,Dex是DalvikVM executes的简称,即Android Dalvik执行程序,并非Java ME的字节码而是Dalvik字节码。

APK解压的目录:
1. META-INF\ (注:Jar文件中常可以看到);
2. res\ (注:存放资源文件的目录) ;
3. AndroidManifest.xml (注:程序全局配置文件) ;
4. classes.dex (注:Dalvik字节码);
5. resources.arsc (注:编译后的二进制资源文件)。

apk反编译就是通过使用apk编译工具将apk文件中的源文件和资源反编译出来,得到的源文件和资源文件可以进行处理后再进行编译,以达到个性化定制,汉化apk等目的。
apk反编译工具
1、最典型的apk编译工具的核心是apktool,但是因为操作需要调用cmd命令,所以出现了很多具有可视化界面的各种编译工具,像easyapk,apkdb,doapk
2、dex2jar.jar,将apk中的classes.dex转化成Jar文件,再通过jd-gui工具反编译jar文件。
apk编译方法,使用apkdb编译apk文件只需要在安装apkdb后直接右击反编译就可以将apk文件反编译出来

apk编译方法
使用apkdb编译apk文件只需要在安装apkdb后直接右击反编译就可以将apk文件反编译出来
1、使用原生apktool工具,需要将apktool的两个文件释放到window目录下,在cmd中使用 apktool d apk文件名 命令来编译apk文件,此时命令行的执行目录与apk文件所在目录必须一致。
2、首先将apk文件,将后缀改为zip,解压,得到其中的classes.dex,它就是java文件编译再通过dx工具打包而成的;将classes.dex复制到dex2jar.bat所在目录。在命令行下定位到dex2jar.bat所在目录,运行 dex2jar.bat classes.dex。

Ⅷ 如何让安卓手机可以解压7z格式的压缩包

7z 是一种主流高效的压缩格式,它拥有极高的压缩比,7z的压缩包后缀名为“.7z”。在一些安卓手机上解压7z文件需要专门的解压缩工具,比如老牌压缩软件RAR。

1.在手机应用市场中安装RAR;

Ⅸ android 应用软件apk用压缩包打开后xml文件乱码,怎么解决

为了保护安装程序代码,对xml进行了加密。所以解压缩后显示乱码。
你想看到代码,只能想办法破译。但是你不知道它采用的加密算法,所以几乎不可能破译。
在android系统上
安装应该没有问题

没有加密的apk程序实际上是一个zip压缩包。解压后能看到代码的

阅读全文

与android解压代码相关的资料

热点内容
各大网站的服务器地址 浏览:368
服务器连接不到因特网什么意思 浏览:739
如何在文件夹中显示页码 浏览:354
云服务器登不上qq 浏览:417
程序员四级工程师 浏览:715
薄荷app怎么把体重清零 浏览:644
草料二维码加密怎么制作 浏览:851
04s519隔油池图集pdf 浏览:242
程序员搞测试 浏览:552
苹果app应用隐藏了怎么办 浏览:660
PDF调取 浏览:199
独立柱加密需要什么条件 浏览:814
php培训出来找不到工作 浏览:106
小程序克隆源码 浏览:448
python整数整除负数 浏览:880
遮天用什么小说app看 浏览:645
什么可以发类似朋友圈的app 浏览:495
cmd查找命令行 浏览:661
如何申请域名需要虚拟服务器 浏览:497
气体流量的算法 浏览:634