I have an aar package, I unzipped it, unzipped the classes.jar file as well, and now have a bunch of .kt and .class files a few of which I would like to edit. But all I see is class and method declaration with their body containing /* compiled code */
. Where do I find the Kotlin code so I can edit it like we used to in Java class files?
Now this is my first time handling kotlin and frankly i don't even know the language. I am using android studio to open the files, and i know how to generate a read-only decompiled java version to understand the inner workings. That's how i figured out which file i need to edit.
I have also found some answers on stack that mention how converting kotlin to java and back to kotlin after editing is not a good idea, since the java file is not a perfect decompilation.
Here is the file I want to edit as it appears in AS:
// IntelliJ API Decompiler stub source generated from a class file
// Implementation of methods is not available
package ru.aviasales.screen.results.view
public final class ResultItemView public constructor(context: android.content.Context, attributeSet: android.util.AttributeSet) : ru.aviasales.ui.views.CardView {
private final val segmentViews: kotlin.collections.MutableList<ru.aviasales.screen.results.view.ResultSegmentItemView> /* compiled code */
public final fun onFavouritesButtonClicked(onClick: () -> kotlin.Unit): kotlin.Unit { /* compiled code */ }
protected open fun onFinishInflate(): kotlin.Unit { /* compiled code */ }
public final fun setData(viewModel: ru.aviasales.screen.results.viewmodel.ResultItem.TicketViewModel): kotlin.Unit { /* compiled code */ }
private final fun setUpAvailableSeatsCount(seatsCount: kotlin.Int, type: ru.aviasales.screen.results.viewmodel.ResultViewType): kotlin.Unit { /* compiled code */ }
private final fun setUpFavouritesButton(favoritesEnabled: kotlin.Boolean, addedToFavourites: kotlin.Boolean): kotlin.Unit { /* compiled code */ }
private final fun setUpPrice(price: kotlin.Long, passengersCount: kotlin.Int): kotlin.Unit { /* compiled code */ }
private final fun setUpSegments(segments: kotlin.collections.List<ru.aviasales.screen.results.viewmodel.SegmentViewModel>): kotlin.Unit { /* compiled code */ }
}
Is it even possible to edit these type of files ? if yes then Do i need a different editor or is there a different method to open such files ?