Skip to content

cannot decode Clash Royale sc files #49

@lawleagle

Description

@lawleagle

what I did:

  • placed 55_CannoneerTaunt_FG.sc from Clash Royale apk into In-Compressed, then ran the program.
    => choosing 1 does nothing, choosing 3 crashes. (logs below in code tags)
  • I also placed the same file into In-Decompressed
    => choosing 1 or 3 does nothing.
  • I tried with other SC files from the same apk too.
-----------------------------------------------------------------------------------------------------------------------
Your choice: 1
-----------------------------------------------------------------------------------------------------------------------
[INFO] Completed in 0.00 seconds!
Press Enter to continue...
-----------------------------------------------------------------------------------------------------------------------
Your choice: 3
-----------------------------------------------------------------------------------------------------------------------
[INFO] File: 55_CannoneerTaunt_FG.sc. Collecting information...
[INFO] ZSTD compression detected

[0%] Cutting sprites... (1/208)[ERROR] ERROR! (builtins.SystemError: tile cannot extend outside image)
Traceback (most recent call last):

  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\ImageFile.py", line 643, in _save
    fh = fp.fileno()
          <PIL.PngImagePlugin._idat object at 0x000002207B92ABA0>

AttributeError: '_idat' object has no attribute 'fileno'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code

  File "C:\src\XCoder-2.7.6\xcoder\__main__.py", line 44, in <module>
    main()
     <function main at 0x000002207AE3A200>

  File "C:\src\XCoder-2.7.6\xcoder\__main__.py", line 34, in main
    handler()
     <function decode_and_render_objects at 0x000002207B86DEE0>

> File "C:\src\XCoder-2.7.6\xcoder\features\sc\decode.py", line 78, in decode_and_render_objects
    render_objects(swf, objects_output_folder)
                       WindowsPath('SC/Out-Sprites/55_CannoneerTaunt_FG')
                   <xcoder.swf.SupercellSWF object at 0x000002207B929400>
     <function render_objects at 0x000002207B86DF80>

  File "C:\src\XCoder-2.7.6\xcoder\features\cut_sprites.py", line 46, in render_objects
    rendered_shape.save(f"{output_folder}/shapes/{shape.id}.png")
                                                     0
                                                <xcoder.objects.shape.shape.Shape object at 0x000002207B929A90>
                          WindowsPath('SC/Out-Sprites/55_CannoneerTaunt_FG')
                   <function Image.save at 0x000002207B8BA8E0>
     <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>

  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\Image.py", line 2581, in save
    save_handler(self, fp, filename)
                         'SC\\Out-Sprites\\55_CannoneerTaunt_FG/shapes/0.png'
                      <_io.BufferedRandom name='SC\\Out-Sprites\\55_CannoneerTaunt_FG/shapes/0.png'>
                 <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>
     <function _save at 0x000002207BA12B60>
  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\PngImagePlugin.py", line 1492, in _save
    ImageFile._save(
              <function _save at 0x000002207B87A200>
     <module 'PIL.ImageFile' from 'C:\\Users\\<username>\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\xcoder-bYim4_8o-py3.13\\Lib\\...
  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\ImageFile.py", line 647, in _save
    _encode_tile(im, fp, tile, bufsize, None, exc)
                            65536
                       [_Tile(codec_name='zip', extents=(0, 0, 0, 0), offset=0, args='RGBA')]
                    <PIL.PngImagePlugin._idat object at 0x000002207B92ABA0>
                 <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>
     <function _encode_tile at 0x000002207B8A47C0>
  File "C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\xcoder-bYim4_8o-py3.13\Lib\site-packages\PIL\ImageFile.py", line 665, in _encode_tile
    encoder.setimage(im.im, extents)
                         (0, 0, 0, 0)
                      <property object at 0x000002207B8B0F90>
                    <PIL.Image.Image image mode=RGBA size=0x0 at 0x2207B927390>
            <method 'setimage' of 'ImagingEncoder' objects>
     <ImagingEncoder object at 0x000002207AF97EA0>

SystemError: tile cannot extend outside image

[INFO] Completed in 0.27 seconds!
Press Enter to continue...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions