I would like to embed user-specific data on-the-fly when distributing an APK from my website (NOT from the Market).
My current idea is simply to embed a unique ID in the APK filename. This is simple enough and changing the filename doesn't break the code signing. My current issue is trying to retri开发者_StackOverflow中文版eve the filename (APK or DEX) so that I can read this ID.
I've tried most of the standard methods -- poking around PackageInfo, ApplicationContext, ProtectionDomain but I can't seem to get anything to work. Ideas?
APK filenames don't have much meaning in Android. I am not terribly surprised there is no spot in PackageInfo
for it. I don't even know if the APK file is stored on the device under its original name.
精彩评论