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

getResources return nil in new android version #90

Open
agvale opened this issue Aug 7, 2020 · 6 comments
Open

getResources return nil in new android version #90

agvale opened this issue Aug 7, 2020 · 6 comments

Comments

@agvale
Copy link

agvale commented Aug 7, 2020

when i user getResources returns nil , but i use the apk in examples it works well.

@pilif
Copy link

pilif commented Sep 30, 2021

this happens since the 2.0.3 update:

$p = new \ApkParser\Parser('some-apk-file.apk');
$l = $p->getManifest()->getApplication()->getLabel();
var_dump($p->getResources($l));

in 2.0.2, this returns an array with one element containing the application name. In 2.0.3, this returns false.

@pilif
Copy link

pilif commented Oct 1, 2021

according to git bisect, this was caused by 1282c68. I'll make a PR to fix this

@pilif
Copy link

pilif commented Oct 1, 2021

never mind - this was just a config change.

instantiate \ApkParser\Parser with ['manifest_only' => false] as its config argument to restore the previous behavior.

Maybe the release notes for 2.0.3 should be updated.

@nhitt-1337
Copy link

nhitt-1337 commented Dec 14, 2021

Hi everyone, I'm also getting this error right now.
Here is my code to get the label:

$labelResourceId = $apk->getManifest()->getApplication()->getLabel(); // result: 0x7f0f0065
$label = $apk->getResources($labelResourceId);

$label return false.
=((
I have tried with a number of different apk files and have the same results as above.
Please help me. Thanks

@songliqun
Copy link

我提交的那个拉取请求就是解决这个问题的,你可以试下

@afzafri
Copy link
Contributor

afzafri commented Apr 18, 2022

never mind - this was just a config change.

instantiate \ApkParser\Parser with ['manifest_only' => false] as its config argument to restore the previous behavior.

Maybe the release notes for 2.0.3 should be updated.

This helped. Thank you for pointing this out.
I created a PR #99 just to add this config to the example codes

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

No branches or pull requests

6 participants