Code example for ZipEntry

Methods: getTime

		ApplicationInfo ai = pi.applicationInfo;
		ZipFile zf;
		try { 
			zf = new ZipFile(ai.sourceDir);
			ZipEntry ze = zf.getEntry("classes.dex");
			long time = (ze.getTime() / 1000);  //time classes.dex was built will remain the same throughout installs (removing last 4 zeros to match appblade)
			toRet = toRet + time;
		} catch (IOException e) {
			//error grabbing build time. append "debug" instead 
			toRet = toRet + "debug";
		return toRet;
	 * A helper method to generate a SHA256 hash of a given file inside a package. 
	 * @param pi The PackageInfo that will provide the source directory in which to look.  
	 * @param filename String name of the file, from within the base source directory, that we want to generate our hash. 
	 * @return The (SHA256) of the given filename, or null if the file could not be found. 
Contextual code suggestions in your IDE  Get Codota for Java