apk validation by file size

by Lee » Mon, 07 Sep 2009 23:24:54 GMT


Sponsored Links
 I had the thought of checking for tampering with the apk by embedding
a couple of checks against it's size once installed on  the
device.

I was just a bit concerned that maybe the size would change dependent
on the device (e.g. different FS format or whatever).

Thanks,

Lee

p.s. no debates about whether this is worthwhile or not please :-)
--~--~---------~--~----~------------~-------~--~----~



apk validation by file size

by Dianne Hackborn » Tue, 08 Sep 2009 02:51:09 GMT


 The best way is to check the certificate it is signed with, since nobody can
sign with a certificate that they haven't been given the private key for.
That said, if they have tampered with your .apk, they can also tamper with
your code, and change whatever check you may have.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


apk validation by file size

by Lee » Tue, 08 Sep 2009 03:49:27 GMT


 > The best way is to check the certificate it is signed with, since nobody can

Is there system code that I can call for that ? Any keywords you could
throw in ?

My original question, is the APK size the same on any device once
created ?

Thanks again,

Lee
--~--~---------~--~----~------------~-------~--~----~



apk validation by file size

by Mark Murphy » Tue, 08 Sep 2009 04:16:56 GMT


 


PackageManager#getPackageInfo() returns a PackageInfo which has a
signatures field.


I don't think you have any supported means of figuring out the size of
the APK on the device.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~---------~--~----~------------~-------~--~----~



apk validation by file size

by Lee » Tue, 08 Sep 2009 15:11:21 GMT


 > PackageManager#getPackageInfo() returns a PackageInfo which has a

Thanks Mark, should've thought of PackageInfo ahem.


Well the thing is just lying around in the file system, it's easy to
test it's size.

Lee
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. ImageButton Icons

Hi,

Just tried using the ImageButton for the first time but I could really
do with some help on the masking of the image it uses. I currently
assign the image to the button in the XML file like so:

<ImageButton android:id="@+id/button_zoom_in"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/zoom_in"/>

The zoom_in image constists of a cross with a white background, when
the user clicks on the button I'd like the white background to be
invisible so only the cross is shown (with the white background
covered by the amber/orange highlight colour of the button). What is
the easiest way to do this? is there a way to alpha out the white or
maybe mask it out?

Thanks,
Steve

--~--~---------~--~----~------------~-------~--~----~

2. When an app issues an updated version, it gets on top of the Market's sort "by date" list

I notice that some old apps repeatedly get pushed to the top of the
sort "by date" list in Market.  It seems it's because the author
simply released an "updated" version.

If that is so, it seems to easy to get on top of the list, is it not?
Would it be unfair to authors who don't frequently release updates?

Just want to start a discussion.
--~--~---------~--~----~------------~-------~--~----~

3. can anyone help me how to create a Calendar.app?

4. Please add this capability to bluetooth headsets

5. "source not found" workaround

6. Emulator Calendar Code --What's up?

7. I wonder How can I get or Import com.google.googlenav package