導航:首頁 > 操作系統 > 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解壓代碼相關的資料

熱點內容
視頻專用加密器哪個好用 瀏覽:295
app無法使用網路哪裡設置 瀏覽:847
紅旗linux怎麼安裝 瀏覽:136
各種破車窗工具測試解壓 瀏覽:933
優格手錶app如何使用 瀏覽:716
docker進入容器命令 瀏覽:497
先河私有雲伺服器價格 瀏覽:458
java字體代碼 瀏覽:829
linux前台運行 瀏覽:617
0到99c語言編程 瀏覽:874
放飲料的櫃子沒壓縮機好嗎 瀏覽:523
linux能搭建什麼游戲伺服器地址 瀏覽:272
電腦解壓到當前文件夾是什麼意思 瀏覽:903
pdf無量之網 瀏覽:253
程序員發16個月工資 瀏覽:296
const是java的關鍵字 瀏覽:672
怎麼加密wifi路由器 瀏覽:349
電腦演算法怎麼寫 瀏覽:837
現在安卓是用什麼開發語言 瀏覽:655
雲伺服器性能怎麼看 瀏覽:739