Package com.android.testutils.apk
Class Apk
- java.lang.Object
-
- com.android.testutils.apk.Zip
-
- com.android.testutils.apk.AndroidArchive
-
- com.android.testutils.apk.DexAndroidArchive
-
- com.android.testutils.apk.Apk
-
- All Implemented Interfaces:
java.lang.AutoCloseable
@Immutable public class Apk extends DexAndroidArchive
-
-
Field Summary
-
Fields inherited from class com.android.testutils.apk.AndroidArchive
CLASS_FORMAT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetContentsSize()Returns the total size of all the contents in the APK.java.nio.file.PathgetJavaResource(java.lang.String name)java.lang.StringtoString()-
Methods inherited from class com.android.testutils.apk.DexAndroidArchive
containsMainClass, containsSecondaryClass, getAllDexes, getClass, getMainDexFile, getSecondaryDexFiles
-
Methods inherited from class com.android.testutils.apk.AndroidArchive
checkValidClassName, containsClass, getResource
-
Methods inherited from class com.android.testutils.apk.Zip
close, exists, getEntries, getEntries, getEntry, getEntryAsZip, getFile
-
-
-
-
Method Detail
-
getJavaResource
@Nullable public java.nio.file.Path getJavaResource(@NonNull java.lang.String name) throws java.io.IOException- Specified by:
getJavaResourcein classAndroidArchive- Throws:
java.io.IOException
-
getContentsSize
public long getContentsSize() throws java.io.IOExceptionReturns the total size of all the contents in the APK. This is usually different from the size of the APK file itself (which also contains some meta-data). This method is useful for comparing APK files where the file sizes have changed (probably due to changes in meta-data) but the contents remain the same.- Throws:
java.io.IOException
-
-