davidedmundson / shashlik2

1 stars 0 forks source link

Could not get APK info. Broken setup? #2

Open Indomitable opened 8 years ago

Indomitable commented 8 years ago

Getting UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1219: ordinal not in range(128) when reading the apk info. From the command subprocess.check_output(args=["/opt/shashlik/bin/aapt", "dump", "badging", "./com.supercell.clashofclans_v8.332.9-769_Android-4.0.3.apk"], universal_newlines=True).encode('utf-8')

asghaier commented 7 years ago

This issue is caused by the following instruction: https://github.com/davidedmundson/shashlik2/blob/master/scripts/shashlik-install#L26

I have inspected shashlik-install python script and tested the failing instruction directly in a python console.

Here are the two APKs I have used and you can see the error on the python console bellow:

chess.com.zip

>>> aapt_output = subprocess.check_output(args=["/opt/shashlik/bin/aapt", "dump", "badging", "/home/asghaier/Downloads/apks/chess.com.apk"], universal_newlines=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 695, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.5/subprocess.py", line 1059, in communicate
    stdout = self.stdout.read()
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 707: ordinal not in range(128)

checkers.com.zip

>>> aapt_output = subprocess.check_output(args=["/opt/shashlik/bin/aapt", "dump", "badging", "/home/asghaier/Downloads/apks/checkers.com.apk"], universal_newlines=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 695, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.5/subprocess.py", line 1059, in communicate
    stdout = self.stdout.read()
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 610: ordinal not in range(128)

Following is the command executed manually from my terminal which seems to work fine:

➜  apks /opt/shashlik/bin/aapt dump badging chess.com.apk
package: name='uk.co.aifactory.chessfree' versionCode='84' versionName='2.45' platformBuildVersionName='5.0.1-1624448'
install-location:'auto'
sdkVersion:'9'
targetSdkVersion:'21'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
application-label:'Chess Free'
application-label-da:'Chess Free'
application-label-nb:'Sjakk Free'
application-label-de:'Schach Free'
application-label-fi:'Shakki Free'
application-label-nl:'Schaken Free'
application-label-fr:'Échecs Free'
application-label-es:'Ajedrez Free'
application-label-it:'Scacchi Free'
application-label-ru:'Шахматы Free'
application-label-sv:'Schack Free'
application-label-ca:'Chess Free'
application-label-fa:'Chess Free'
application-label-ja:'Chess Free'
application-label-ka:'Chess Free'
application-label-pa:'Chess Free'
application-label-ta:'Chess Free'
application-label-be:'Chess Free'
application-label-ne:'Chess Free'
application-label-te:'Chess Free'
application-label-af:'Chess Free'
application-label-bg:'Chess Free'
application-label-th:'Chess Free'
application-label-hi:'Chess Free'
application-label-si:'Chess Free'
application-label-vi:'Chess Free'
application-label-kk:'Chess Free'
application-label-mk:'Chess Free'
application-label-sk:'Chess Free'
application-label-uk:'Chess Free'
application-label-el:'Chess Free'
application-label-gl:'Chess Free'
application-label-ml:'Chess Free'
application-label-pl:'Chess Free'
application-label-sl:'Chess Free'
application-label-tl:'Chess Free'
application-label-am:'Chess Free'
application-label-km:'Chess Free'
application-label-bn:'Chess Free'
application-label-in:'Chess Free'
application-label-kn:'Chess Free'
application-label-mn:'Chess Free'
application-label-ko:'Chess Free'
application-label-lo:'Chess Free'
application-label-ro:'Chess Free'
application-label-sq:'Chess Free'
application-label-ar:'Chess Free'
application-label-hr:'Chess Free'
application-label-mr:'Chess Free'
application-label-sr:'Chess Free'
application-label-tr:'Chess Free'
application-label-ur:'Chess Free'
application-label-bs:'Chess Free'
application-label-cs:'Chess Free'
application-label-is:'Chess Free'
application-label-ms:'Chess Free'
application-label-et:'Chess Free'
application-label-lt:'Chess Free'
application-label-pt:'Chess Free'
application-label-eu:'Chess Free'
application-label-gu:'Chess Free'
application-label-hu:'Chess Free'
application-label-zu:'Chess Free'
application-label-lv:'Chess Free'
application-label-iw:'Chess Free'
application-label-sw:'Chess Free'
application-label-hy:'Chess Free'
application-label-ky:'Chess Free'
application-label-my:'Chess Free'
application-label-az:'Chess Free'
application-label-uz:'Chess Free'
application-label-fr-CA:'Échecs Free'
application-label-lo-LA:'Chess Free'
application-label-en-GB:'Chess Free'
application-label-bn-BD:'Chess Free'
application-label-et-EE:'Chess Free'
application-label-ka-GE:'Chess Free'
application-label-ky-KG:'Chess Free'
application-label-km-KH:'Chess Free'
application-label-zh-HK:'Chess Free'
application-label-si-LK:'Chess Free'
application-label-mk-MK:'Chess Free'
application-label-ur-PK:'Chess Free'
application-label-hy-AM:'Chess Free'
application-label-my-MM:'Chess Free'
application-label-zh-CN:'Chess Free'
application-label-ta-IN:'Chess Free'
application-label-te-IN:'Chess Free'
application-label-ml-IN:'Chess Free'
application-label-en-IN:'Chess Free'
application-label-kn-IN:'Chess Free'
application-label-mr-IN:'Chess Free'
application-label-mn-MN:'Chess Free'
application-label-ne-NP:'Chess Free'
application-label-pt-BR:'Chess Free'
application-label-gl-ES:'Chess Free'
application-label-eu-ES:'Chess Free'
application-label-is-IS:'Chess Free'
application-label-es-US:'Ajedrez Free'
application-label-pt-PT:'Chess Free'
application-label-zh-TW:'Chess Free'
application-label-ms-MY:'Chess Free'
application-label-kk-KZ:'Chess Free'
application-label-uz-UZ:'Chess Free'
application-icon-120:'res/drawable-ldpi-v4/launcher_icon.png'
application-icon-160:'res/drawable/launcher_icon.png'
application-icon-213:'res/drawable-hdpi-v4/launcher_icon.png'
application-icon-240:'res/drawable-hdpi-v4/launcher_icon.png'
application-icon-320:'res/drawable-xhdpi-v4/launcher_icon.png'
application-icon-480:'res/drawable-xxhdpi-v4/launcher_icon.png'
application-icon-640:'res/drawable-xxhdpi-v4/launcher_icon.png'
application-icon-65535:'res/drawable-xxhdpi-v4/launcher_icon.png'
application: label='Chess Free' icon='res/drawable/launcher_icon.png'
launchable-activity: name='uk.co.aifactory.chessfree.ChessFreeActivity'  label='Chess Free' icon=''
feature-group: label=''
  uses-feature: name='android.hardware.touchscreen'
  uses-implied-feature: name='android.hardware.touchscreen' reason='default feature for all apps'
provides-component:'app-widget'
provides-component:'wallpaper'
main
other-activities
other-services
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--' 'da' 'nb' 'de' 'fi' 'nl' 'fr' 'es' 'it' 'ru' 'sv' 'ca' 'fa' 'ja' 'ka' 'pa' 'ta' 'be' 'ne' 'te' 'af' 'bg' 'th' 'hi' 'si' 'vi' 'kk' 'mk' 'sk' 'uk' 'el' 'gl' 'ml' 'pl' 'sl' 'tl' 'am' 'km' 'bn' 'in' 'kn' 'mn' 'ko' 'lo' 'ro' 'sq' 'ar' 'hr' 'mr' 'sr' 'tr' 'ur' 'bs' 'cs' 'is' 'ms' 'et' 'lt' 'pt' 'eu' 'gu' 'hu' 'zu' 'lv' 'iw' 'sw' 'hy' 'ky' 'my' 'az' 'uz' 'fr-CA' 'lo-LA' 'en-GB' 'bn-BD' 'et-EE' 'ka-GE' 'ky-KG' 'km-KH' 'zh-HK' 'si-LK' 'mk-MK' 'ur-PK' 'hy-AM' 'my-MM' 'zh-CN' 'ta-IN' 'te-IN' 'ml-IN' 'en-IN' 'kn-IN' 'mr-IN' 'mn-MN' 'ne-NP' 'pt-BR' 'gl-ES' 'eu-ES' 'is-IS' 'es-US' 'pt-PT' 'zh-TW' 'ms-MY' 'kk-KZ' 'uz-UZ'
densities: '120' '160' '213' '240' '320' '480' '640' '65535'
native-code: 'arm64-v8a' 'armeabi' 'armeabi-v7a' 'mips' 'mips64' 'x86' 'x86_64'

I suppose we have to fix the instruction by adding unicode support or replace it with another method.