Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8980265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:02:35+00:00 2026-06-15T20:02:35+00:00

The background: In trying to make the codebase (C/C++) for my app more portable,

  • 0

The background:

In trying to make the codebase (C/C++) for my app more portable, I would like to minimize my use of android’s native AAssetManager and switch to libzip for loading assets from the APK. I had a look at libzip; merged it into the project and – lo and behold – I can read my files directly from the APK using libzip.

Now, I would like to obfuscate my assets (or at least make access to them non-trivial), so I thought I’d package them into an encrypted zip archive and include that archive in the APK (basically, a zip in a zip).

My question:

What would be the easiest/most effective way to access the files in the archive directly from within the APK using native code?

I was hoping for a similar approach as with libzip, where I can simply specify a filename and then get a buffer with uncompressed data.

I have tried opening the compressed archive directly from within the APK using libzip, but I’m coming up empty… it appears libzip will only open a zip file using a directory and not from a buffer in memory (which is as far as I got).

I suppose zlib would be an obvious choice, but I admit I have no clue how to go about it.

I also thought about copying the archive out of the APK, but I would like to waste as little space as possible (lots of assets == big archive). Delivery of the assets as a separate download is also something I’d like to avoid.

Helpful suggestions or pointers are welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:02:36+00:00Added an answer on June 15, 2026 at 8:02 pm

    From your question it sounds like you’ve already got past getting to the asset stream in your APK, so I’ll jump right to this: As you say, zlib is an obvious choice. There are tons and tons of examples online to process in-memory streams. For example, In Memory Decompression: GZIP. With zlib you also have the benefit that it’s already available via the NDK (e.g. you don’t need to build and link in your own).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make the background of my web browser transparent like wb.setBackground(Color.transparent) in
I am trying to make a button with background image. <Button android:layout_width=wrap_content android:layout_height=wrap_content android:layout_marginLeft=5px
I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
I'm trying to make the background of my app have randomly floating bubbles. I've
I'm trying to make a button, to switch the site background once clicked. And
I am trying to make a tabview in android that has icon alongwith background.
Im trying to make a countdown timer run in the background of my activity,
I'm trying to make a css background flash between two colours. The best solution
I am trying to make my background image move in the opposite direction as
I'm trying to make simple website with content background combined from 3 images: top

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.