New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep original 'IDs' around for string/file resource values #990

Closed
mmastrac opened this Issue Jul 7, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@mmastrac
Contributor

mmastrac commented Jul 7, 2015

The Android on-device implementation for TypedValue uses the underlying data value as a cache key in various places (ie: the Drawable cache in Resources). This allows it to ensure that the various configuration versions of a resource don't overwrite each other in the cache without having to compute a hash each time.

For projects where interacting with these on-device caches is important, we need a way to extract the raw version of the ResFileValue's data, ie: the index passed to mTableStrings to look up the string value in ARSCDecoder.java:

        return type == TypedValue.TYPE_STRING
                ? mPkg.getValueFactory().factory(mTableStrings.getHTML(data))
                : mPkg.getValueFactory().factory(type, data, null);

I can provide a patch for this if it's something you'd accept.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Jul 7, 2015

Owner

Yeah, if we are exposing some raw values, I will accept it. I'm pretty busy investigating some bugs, so a quick patch in a pull request would be quite helpful.

Owner

iBotPeaches commented Jul 7, 2015

Yeah, if we are exposing some raw values, I will accept it. I'm pretty busy investigating some bugs, so a quick patch in a pull request would be quite helpful.

@mmastrac

This comment has been minimized.

Show comment
Hide comment
@mmastrac

mmastrac Jul 7, 2015

Contributor

Closing in favour of PR #991

Contributor

mmastrac commented Jul 7, 2015

Closing in favour of PR #991

@mmastrac mmastrac closed this Jul 7, 2015

iBotPeaches added a commit that referenced this issue Jul 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment