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. A Simple Layout question

Hi,
I want to add admob add in my application, I want to make application for
every screensize, I am having a problem with is, I want to arrange a layout
such that, ad comes on the top the rest of which should be webview. I can do
it for normal screen sizes by hardcoding the screen size to desired px but
it is not working on bigger screensizes, I want to add this in layout.xml
please advice.

Thank You,
Abdul Ma{*filter*}.

2. ImageSpan not supported in RemoteViews ?

hi,

one of the component of my app widget is TextView which i want to be
{*filter*} rich one: ForegroundSpan seems to be working but i cannot see
ImageSpan to appear.

is it by purpose?

thanks,
pskink

-- 

3. Impending market upgrade?

4. EditTextPreference: how to make it single-line?

5. addToMyContactsGroup does not seem to work on HTC Hero

6. tanya update andoroid

7. I am a german market developer. How can I see the english comments to my program?