Code example for ZipFile

Methods: getEntry

		boolean toRet = false;
		if(pi != null){
			ApplicationInfo ai = pi.applicationInfo;
			ZipFile zf;
				try { 
					zf = new ZipFile(ai.sourceDir);
					//check for the existence of a DSA or RSA file, which will be the public key of whatever we're supposedly signed with  
					ZipEntry ze = zf.getEntry("META-INF/CERT.DSA");
					ZipEntry zr = zf.getEntry("META-INF/CERT.RSA");
					//TODO: enumerate through META-INF and check for *.RSA/*DSA, since we can be signed with multiple files and there's no guarantee for names. 99.999% of people will just sign once though.  
					toRet = (ze != null) || (zr != null);
				} catch (IOException e) {
		return toRet;
	 * Static call to check if we are running in the emulator (a.k.a. development), 
Stop searching for code, let great code find you!  Add Codota to your java IDE