line / line/line-sdk-android

Optimize app size for line SDK

Open
#172 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
149
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Is it a security issue?

If you believe you have discovered a vulnerability or have an issue related to security, please send us a mail to dl_oss_dev@linecorp.com instead of opening a public issue.

What did you do?

When implementing line sdk for login, we see significant increased on our app size. It is particulary because this rules added:

https://github.com/line/line-sdk-android/blob/master/line-sdk/consumer-proguard-rules.pro#L10
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

This causing lot of our app class cannot be obfuscate/optimized. I already confirm it by removing/adding this rules on our app and it will keep lot of classes implementing parcelable class.

What did you expect?

This rules can be simplified to:
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
Or
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator CREATOR;
}

This would saving 1-2mb on uncompressed dex size on our app.

I also find some additional library like picasso added after implemented line sdk. It would be great if line provide lite version for sdk, like line-login library.

Let me know if you need additional info. Thank you

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with line-sdk/consumer-proguard-rules.pro, especially the Parcelable keep rule linked in the issue. Reproduce the reported app-size impact with and without that rule, then evaluate the proposed keepclassmembers alternatives. Done means the SDK's shrinking rules preserve required behavior while avoiding the reported 1–2 MB increase; the requested lite SDK is a separate, broader consideration.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.