Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by dcariola · Jul 26, 2012 at 01:36 PM · androidapkpropertiesin-app-purchase

How to add .properties files to apk root programmatically?

I'm having an issue with the SamsungApps inApp purchase library (plasma). The code works as expected, but it looks that Unity is dropping all the localization files of the plasma.jar when building the apk.

Plasma library uses .properties files placed under a "l18n" folder in the apk root. I was able to check it by unpacking the apk generated by the sample code distributed with the SDK. The apk I build with unity misses the l18n folder and the dialogs only present me the string used as id.

I cannot alter the plasma sdk to use another localization method, so I'm trying to add the l18n folder in my apk through unity.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dcariola · Jul 30, 2012 at 05:24 PM 0
Share

I resolved the issue by creating a custom PostprocessBuild script that adds the files and resign the apk. I will post it as soon as it's in a clean state.

avatar image LeXuSMalus · Sep 10, 2012 at 02:10 PM 0
Share

Can you share information on how you did it?

avatar image dcariola · Oct 01, 2012 at 07:11 PM 0
Share

I've used the Ionic Zip library ( dotnetzip.codeplex.com ) to open and edit the apk without extracting in the PostProcessBuildPlayer callback. After manual edit, it will also require to clean the sign files before saving by deleting the contents of $$anonymous$$ETA-INF directory.

Then jarsign and zipalign again to have a working apk.

ps. This dll is very useful and complete for "inline" archive edit, but I found there is a small issue on directory paths on OSX (there's already an open ticket), so it's better to use AddFile in a foreach loop than AddFolder if you work in a multiplatform environment.

Hope this's useful. If still in trouble, just ask for more.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by $$anonymous$$ · Oct 01, 2012 at 03:19 PM

@dcariola , any updates? Btw, would you consider sharing the plugin or putting it to asset store?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dcariola · Oct 01, 2012 at 07:16 PM 0
Share

Take a look at the last comment, hot this helps. The plugin is not ready to be shared, cause I'm fixing it to have a common interface through all the IAP plugins I'm working on.

avatar image $$anonymous$$ · Oct 01, 2012 at 07:23 PM 0
Share

Ah I see, thx anyway!

avatar image
0

Answer by sz-Bit-Barons · Apr 14, 2014 at 04:48 PM

How about now? is your code doing what it should do? And is it possible with "split application binary" enabled?

Would be nice if you could share your work :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Google Play Store - multiple files for large apk 1 Answer

How do I build apk that works on galaxy s8 aspect ratio (18.5/9)? 0 Answers

Difficulty with Android IMarketBillingService 1 Answer

Can't generate apk 1 Answer

Onmouse event handlers preventing me from building an apk? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges