Skip to content
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

Encountered typeIdOffset not 0? This is your report. #1728

Closed
iBotPeaches opened this issue Feb 16, 2018 · 11 comments
Closed

Encountered typeIdOffset not 0? This is your report. #1728

iBotPeaches opened this issue Feb 16, 2018 · 11 comments
Assignees

Comments

@iBotPeaches
Copy link
Owner

Hi there,

Apktool has intentionally output this error message because we need to find an application in the wild, like the application that sent you to this report.

Please attach the apk / email me (ibotpeaches (at) gmail (dot) c0m) so we can fix this issue.

@iBotPeaches iBotPeaches self-assigned this Feb 16, 2018
iBotPeaches added a commit that referenced this issue Feb 16, 2018
 - missing sample that experiences this
 - needs tests
 - samples requested: #1728
 - refs: iBotPeaches/platform_frameworks_base@f90f2f8
@iBotPeaches
Copy link
Owner Author

This warning has been merged into master - #1690. Next release will have it.

@iBotPeaches iBotPeaches changed the title Encountered typeIdOffset not null? This is your report. Encountered typeIdOffset not 0? This is your report. Feb 16, 2018
@iBotPeaches
Copy link
Owner Author

Going to close this, I still get notification, but one less bug.

@iBotPeaches iBotPeaches pinned this issue Nov 29, 2020
@Elmehdioub
Copy link

Going to close this, I still get notification, but one less bug.

You like to keep close issues with no fix, what a wonderful developer.

@Schoemiees666
Copy link

Schoemiees666 commented Dec 23, 2023 via email

@REAndroid
Copy link

Hello,
I was researching same for purpose of "type id offset" I couldn't find enough resources thus I made my assumption as:
type-id = typeIdOffset + typeIdOnSpecHeader. Then I generated three apks(using my tool) with typeIdOffset = 0, 1, 2 and tested on two devices API-16 (4.3) & API-28 (9.0)

Here is my results:

typeIdOffset API-16 API-28
0 OK OK
1 OK fail to load strings
2 OK fail to load all resources

I am guessing that typeIdOffset is abandoned by android after some version.

type-id-offset-apks.zip

@iBotPeaches
Copy link
Owner Author

very interesting - thanks @REAndroid. Guessing the various newer iterations of packing resources became a more optimized approach than type offsetting which was probably part of the sparse era of optimization.

@REAndroid
Copy link

Yeah, i also run my test with assumption type-id = typeIdOnSpecHeader i.e. ignore whatever value on typeIdOffset for calculation of resource id 0xpptteeee , the result was aapt2(recent 33.0.1) parses correctly but both old and new api devices fails to load resources. I couldn't find any setter code for typeIdOffset on AOSP

I guess android has bug on recent versions, anyways we shouldn't care much cus no real apk with such resources

@bzdnagao
Copy link

“What does this project look like after it starts? I see this(> Configure project :
Building SNAPSHOT (no .git folder found)
fatal: No names found, cannot describe anything.
) when I run it in IDEA, does it have any impact?”

@iBotPeaches
Copy link
Owner Author

“What does this project look like after it starts? I see this(> Configure project : Building SNAPSHOT (no .git folder found) fatal: No names found, cannot describe anything. ) when I run it in IDEA, does it have any impact?”

This looks to have nothing to do with typeIdOffset - I don't understand? What is the relevance to this thread?

@REAndroid
Copy link

REAndroid commented May 23, 2024

@iBotPeaches
Unrelated to this issue nor it is real issue to create new,

Do you have any idea how to handle styled string in xml attribute value ?
e.g:

<TextView android:text="<b>styled string</b>" />

I generated demo apk with styled string in xml string pool, and android device renders it correctly

Check res/layout/activity_main.xml
styled-string-in-xml-generated.zip

@iBotPeaches
Copy link
Owner Author

@REAndroid - Styled strings are the bane of my existence. The spec lies, apps lie, nothing makes sense.

In terms of what you are looking for though for compilation - I don't know. I just have to build something to handle disassembly and let aapt2 do the heavy lifting again. Our StyledString class has all the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants