开发者

Programmatically determining running APK (or DEX)'s filename?

开发者 https://www.devze.com 2022-12-24 18:46 出处:网络
I would like to embed user-specific data on-the-fly when distributing an APK from my website (NOT from the Market).

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消