Repository navigation
Remove dead code, resources and build config - #75
Merged
Merged
Conversation
Nothing injects Call.Factory: Retrofit gets the OkHttpClient from provideOkHttp. The unused client also logged full bodies, unredacted, in debug builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
:model never minifies (false is also the library default) and does not list the file as a consumer ProGuard file, so its rules never reached R8. Its only line was also malformed: `-keep com...model.**` has no class specification keyword. The app's proguard-rules.pro is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
TestDispatcher(s)Module, TestCryptoModule and TestDataStoreModule are @TestInstallIn/@Installin modules, but no test is a @HiltAndroidTest and the test source set has no Hilt annotation processor, so Hilt never builds a test component that would use them. The tests construct their dependencies directly (InMemoryDataStore stays: tests use it). With the modules gone nothing uses hilt-android-testing, so drop that dependency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
Nothing references these (Kotlin R.*, XML @string/@drawable/@Mipmap, or getIdentifier, which the app never calls), and lint's UnusedResources check reports each of them: - strings instructions, open, role, unauthorized, cancel and shop_name_is_required, from values/ and values-ja/ together; - drawable ic_placeholder_default; - mipmap ic_launcher_round: the manifest sets no android:roundIcon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
- Shopkeeper: no code decodes or builds it (sign-in, sign-up and profile responses use LoggedInShopkeeper). - Shopkeepers and Relationships.shopkeepers: organization membership, which the Free edition does not have; nothing reads the field. - Attributes.shopkeeperId, ownerId, ownerName, isAdmin and shopsCount: decoded but never read. - Data.getCreatedAt and ItemTag.getCreatedAt: no callers. Every Json that decodes these models sets ignoreUnknownKeys (networkJson for Retrofit, and the demo repositories' Json in tests), so responses that still carry those keys decode exactly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
No :app source uses @parcelize; the Parcelable model classes are compiled in :model, which keeps the plugin. The release R8 seeds are unchanged apart from the classes removed in this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
R8 reads OkHttp's rules (-dontwarn org.conscrypt.**, org.bouncycastle.**, okhttp3.internal.platform.**) and Retrofit's (keep Response and kotlin.coroutines.Continuation), so the app's copies changed nothing: the release classes.dex built without them is byte-identical to the one built with them, and R8 reports no missing classes. The retrofit2.Call, GeneratedMessageLite and @parcelize rules stay; dropping the Call or Parcelize rule does change the dex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
sent_reset_password_instruction and sent_confirmation_instruction read "An email has been sent the email containing ...", the reset one with a stray ". Say what values-ja says: an email with the instructions has been sent. SentInstructionsMessagesTest (as in the paid edition) failed on the old text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3 (dead code removal). Every deletion was checked by grepping Kotlin, XML, the manifest, navigation, Gradle and ProGuard files. Reflection was ruled out too: the app never calls
getIdentifier, and every Json that decodes the models setsignoreUnknownKeys.Changes
NetModule.okHttpCallFactory(): nothing injectsCall.Factory; Retrofit usesprovideOkHttp. This unused client also logged full request and response bodies, unredacted, in debug builds.model/proguard-rules.pro: no build reads it.:modeldoesn't minify and doesn't list it inconsumerProguardFiles. Its only line,-keep com...model.**, was malformed: it has no class keyword. Removed the file and the no-oprelease {}block that pointed to it.TestDispatcherModule,TestDispatchersModule,TestCryptoModule,TestDataStoreModule): no test is@HiltAndroidTestand the test source set has no Hilt processor, so Hilt never installs them. With them gone nothing useshilt-android-testing, so I removed it fromapp/build.gradle.ktsand from the version catalog.InMemoryDataStorestays because tests use it.UnusedResourcesreported all of them):instructions,open,role,unauthorized,cancel,shop_name_is_required, removed fromvaluesandvalues-jatogetherdrawable/ic_placeholder_defaultmipmap/ic_launcher_round: the manifest has noandroid:roundIconShopkeeperis never used; sign-in and sign-up useLoggedInShopkeeper.ShopkeepersandRelationships.shopkeepersare for organizations, which the Free edition doesn't have; nothing reads them.Attributes.shopkeeperId,ownerId,ownerName,isAdminandshopsCountare never read.Data.getCreatedAtandItemTag.getCreatedAthave no callers.kotlin.parcelizeplugin in:app: no app source uses@Parcelize.:modelkeeps the plugin. The release R8 seeds are unchanged apart from the deleted classes.-dontwarnlines for bouncycastle, conscrypt and openjsse are covered by OkHttp's own rules, and theResponse/Continuationkeeps by Retrofit's. With these rules removed, the releaseclasses.dexis byte-identical (same md5). Theretrofit2.Call,GeneratedMessageLiteand@Parcelizerules stay: removing the Call or Parcelize rule does change the dex.sent_reset_password_instructionandsent_confirmation_instructionread "An email has been sent the email containing ...", and the reset one had a stray". Both now say what the Japanese text already says. The test was ported from paidSentInstructionsMessagesTest. Red check: both tests failed on the old strings, then passed after the fix.Not done (considered)
docs/images/nfc.gif(15 MB),screenshots_nfc.pngandoverview_before/after.pngare not referenced in the repo, but they may be linked from outside (website or blog), so I left them.ItemTag.getPosition/getShopName/getShopId/getState,Attributes.createdAt/updatedAt,Meta.totalCount). They mirror the API schema, so I left them.Checks
./gradlew :app:compileDebugKotlinbuilds with no warnings.lintDebug,:app:minifyReleaseWithR8andtestall pass. The Gradle daemon crashed during lint because of concurrent builds, so I re-ran those steps with--no-daemon.:model)../gradlew :app:assembleReleasepasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH