apktools icon indicating copy to clipboard operation
apktools copied to clipboard

undefined method `unpack' for nil:NilClass

Open ohaleck opened this issue 6 years ago • 2 comments

I've been trying to open the APK file linked below with apktools 0.7.2, and get the following error from the constructor:

> ApkXml.new('/tmp/com.google.android.gms_11.9.51_(248-177350961)-11951248_minAPI21(arm64-v8a,armeabi-v7a)(480dpi)_apkmirror.com.apk')
NoMethodError: undefined method `unpack' for nil:NilClass
	from /Users/ohaleck/.rvm/gems/ruby-2.3.6@updateserver/gems/apktools-0.7.2/lib/apktools/apkresources.rb:399:in `read_string'
	from /Users/ohaleck/.rvm/gems/ruby-2.3.6@updateserver/gems/apktools-0.7.2/lib/apktools/apkresources.rb:447:in `parse_stringpool'
	from /Users/ohaleck/.rvm/gems/ruby-2.3.6@updateserver/gems/apktools-0.7.2/lib/apktools/apkresources.rb:157:in `initialize'
	from /Users/ohaleck/.rvm/gems/ruby-2.3.6@updateserver/gems/apktools-0.7.2/lib/apktools/apkxml.rb:118:in `new'
	from /Users/ohaleck/.rvm/gems/ruby-2.3.6@updateserver/gems/apktools-0.7.2/lib/apktools/apkxml.rb:118:in `initialize'
	from (irb):2:in `new'

Now it seems that, inside read_string, the offset is much higher than the size of data 5412929698 compared to 16357888.

https://www.apkmirror.com/apk/google-inc/google-play-services/google-play-services-11-9-51-release/google-play-services-11-9-51-248-177350961-android-apk-download/download/

ohaleck avatar Apr 30 '18 13:04 ohaleck

@ohaleck Did you ever get past this? Facing similar issue years later with v0.7.4

oneuptim avatar Apr 27 '22 16:04 oneuptim

@ohaleck Did you ever get past this? Facing similar issue years later with v0.7.4

I don't remember TBH, but I can't check because I changed my job. @irondnb can you help?

ohaleck avatar Apr 27 '22 20:04 ohaleck