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

Android studio 3.0 apks #66

Closed
Mutalistik opened this issue Nov 20, 2017 · 8 comments
Closed

Android studio 3.0 apks #66

Mutalistik opened this issue Nov 20, 2017 · 8 comments

Comments

@Mutalistik
Copy link

Mutalistik commented Nov 20, 2017

Hello I'm getting an error using apkParser since I have update to android studio 3.0 It seems that something has change in the apk compiler, maybe the encoding o something like that. The error is

ErrorException in XmlParser.php line 244:
Undefined offset: 4476

I looked the function and its trying to get a position greater of the array length
I tried with other versions of the same apk compiled with older android studio versions and it works

I make a test apk for you to test it
app-debug.apk.zip

Regards

@achretien
Copy link
Contributor

can you test since 4d23e0f ?

@ronzyfonzy
Copy link

Have the same problem after building with AndroidStudio 3.0. Tested out 4d23e0f and I'm getting

Unrecognized tag code '0' at offset 10400

@peterchaula
Copy link

peterchaula commented Jan 2, 2018

@achretien 4d23e0f fixed the issue for me

composer require tufanbarisyildirim/php-apk-parser:dev-master#4d23e0f87b7e2db77b7f9d7d69f9da08a22b9e1c

@WebSabaki
Copy link

WebSabaki commented Jan 17, 2018

Hello. I face similar issues with latest version:

Unrecognized tag code '0' at offset 10400

or

Unrecognized tag code '100' at offset 10288

@Mutalistik
Copy link
Author

In my case all works well with the last versión.

@ronzyfonzy
Copy link

ronzyfonzy commented Feb 21, 2018

Tested again (with the 4d23e0f) and still getting error:

Fatal error: Uncaught exception 'Exception' with message 'Unrecognized tag code '0' at offset 9436' in /vendor/tufanbarisyildirim/p
hp-apk-parser/lib/ApkParser/XmlParser.php:194
Stack trace:
#0 /vendor/tufanbarisyildirim/php-apk-parser/lib/ApkParser/XmlParser.php(330): ApkParser\XmlParser->decompress()
#1 /vendor/tufanbarisyildirim/php-apk-parser/lib/ApkParser/XmlParser.php(345): ApkParser\XmlParser->getXmlString()
#2 /vendor/tufanbarisyildirim/php-apk-parser/lib/ApkParser/Manifest.php(156): ApkParser\XmlParser->getXmlObject('\\ApkParser\\Mani.
..')
#3 /vendor/tufanbarisyildirim/php-apk-parser/lib/ApkParser/Manifest.php(108): ApkParser\Manifest->getXmlObject()
#4 /vendor/tufanbarisyildirim/php-apk-parser/lib/ApkParser/Manifest.php(74): ApkParser\Manifest->getAttribute('versionName')
#5 /v in /vendor/tufanbarisyildirim/php-apk-parser/lib/ApkParser/XmlParser.php on line 194

I ran this code:

try{
   $apk = new \ApkParser\Parser($apk_path);
} catch(Exception $e){
   print_r($e);
}

$apk->getManifest()->getVersionName(); // <-- The error happens here

@bealebe
Copy link

bealebe commented Jul 12, 2018

Just wanted to share how I resolved this.

The AndroidManifest.xml actually had a syntax error in it. The APK still would build and run on a device, but would break here when uploading because the XML syntax was bad.

Hopefully this will help someone!

@GustavoEmmel
Copy link

Just wanted to share how I resolved this.

The AndroidManifest.xml actually had a syntax error in it. The APK still would build and run on a device, but would break here when uploading because the XML syntax was bad.

Hopefully this will help someone!

the same happens to me, there was a lost [ on manifest.
Apk still building and running, but show to error above when parsing.

@tufanbarisyildirim tufanbarisyildirim closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2022
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

8 participants