Add support for 9-patch drawables #112

Closed
iBotPeaches opened this Issue Mar 17, 2015 · 9 comments

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 17, 2015

Original issue 2 created by iBotPeaches on 2010-03-02T10:40:24.000Z:

9-patch data is written directly into an image binary, it is somewhat harder
to get it and this data is currently not decoded. apktool modifies names of
9-patch files to normal .png, so they are acceptable by aapt, but then they
will stretch like a normal images.

Currently there is workaround for this: after apk building you could copy 9-
patch images from original to new apk. Of course you need to modify names,
as apktool did.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #1 originally posted by iBotPeaches on 2010-04-02T19:06:27.000Z:

Apktool 1.0 automatically workarounds this issue, but 9-patch images are still
undecoded.

Owner

iBotPeaches commented Mar 17, 2015

Comment #1 originally posted by iBotPeaches on 2010-04-02T19:06:27.000Z:

Apktool 1.0 automatically workarounds this issue, but 9-patch images are still
undecoded.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #2 originally posted by iBotPeaches on 2010-06-11T01:48:21.000Z:

I was just thinking about this, would it be possible to skip 9 patch altogether? Or is that going to create problems?

Owner

iBotPeaches commented Mar 17, 2015

Comment #2 originally posted by iBotPeaches on 2010-06-11T01:48:21.000Z:

I was just thinking about this, would it be possible to skip 9 patch altogether? Or is that going to create problems?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #3 originally posted by iBotPeaches on 2010-06-11T07:14:19.000Z:

What do you mean by "skip"? Just unpack them as any other image? Then aapt will throw errors, because it will find *.9.png files without 9patch borders.

Owner

iBotPeaches commented Mar 17, 2015

Comment #3 originally posted by iBotPeaches on 2010-06-11T07:14:19.000Z:

What do you mean by "skip"? Just unpack them as any other image? Then aapt will throw errors, because it will find *.9.png files without 9patch borders.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #4 originally posted by iBotPeaches on 2010-06-11T07:14:20.000Z:

What do you mean by "skip"? Just unpack them as any other image? Then aapt will throw errors, because it will find *.9.png files without 9patch borders.

Owner

iBotPeaches commented Mar 17, 2015

Comment #4 originally posted by iBotPeaches on 2010-06-11T07:14:20.000Z:

What do you mean by "skip"? Just unpack them as any other image? Then aapt will throw errors, because it will find *.9.png files without 9patch borders.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #5 originally posted by iBotPeaches on 2010-06-12T19:38:00.000Z:

Let me know, how it works. If there will be some errors, then you will have to wait for fix or move back to 1.2.0. There is no way to disable this feature.

Owner

iBotPeaches commented Mar 17, 2015

Comment #5 originally posted by iBotPeaches on 2010-06-12T19:38:00.000Z:

Let me know, how it works. If there will be some errors, then you will have to wait for fix or move back to 1.2.0. There is no way to disable this feature.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #6 originally posted by iBotPeaches on 2010-06-12T20:09:52.000Z:

As I can see, it creates .9.png files in main res tree, instead of separate 9patch dir.
Can anyone explain what for?
In any way it works well, as it did before. I fully decoded and rebuild rom without any problems.

Can anyone point me to good info about 9patch? (don't understand how it works)

Owner

iBotPeaches commented Mar 17, 2015

Comment #6 originally posted by iBotPeaches on 2010-06-12T20:09:52.000Z:

As I can see, it creates .9.png files in main res tree, instead of separate 9patch dir.
Can anyone explain what for?
In any way it works well, as it did before. I fully decoded and rebuild rom without any problems.

Can anyone point me to good info about 9patch? (don't understand how it works)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #7 originally posted by iBotPeaches on 2010-06-12T20:18:12.000Z:

http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch

Later apktool didn't support decoding these files, so you couldn't modify them. 9patch dir was a workaround, now you could use these files, as you would be an author of an app.

Owner

iBotPeaches commented Mar 17, 2015

Comment #7 originally posted by iBotPeaches on 2010-06-12T20:18:12.000Z:

http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch

Later apktool didn't support decoding these files, so you couldn't modify them. 9patch dir was a workaround, now you could use these files, as you would be an author of an app.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #8 originally posted by iBotPeaches on 2010-06-12T20:21:44.000Z:

*Later -> Earlier ;-)

Owner

iBotPeaches commented Mar 17, 2015

Comment #8 originally posted by iBotPeaches on 2010-06-12T20:21:44.000Z:

*Later -> Earlier ;-)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 17, 2015

Owner

Comment #9 originally posted by iBotPeaches on 2010-06-12T20:44:50.000Z:

Thanks for the link.
Now I see those stretch/padding markers.
Great job!

By the way, I decoded legend rom without any problems too.
1.3 rocks!

I didn't try repacked rom on the real device yet. Hope there won't be any surprises.

Owner

iBotPeaches commented Mar 17, 2015

Comment #9 originally posted by iBotPeaches on 2010-06-12T20:44:50.000Z:

Thanks for the link.
Now I see those stretch/padding markers.
Great job!

By the way, I decoded legend rom without any problems too.
1.3 rocks!

I didn't try repacked rom on the real device yet. Hope there won't be any surprises.

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