alexrintt / kanade

Android app to extract apks from installed apps.
https://alexrintt.io/kanade
MIT License
299 stars 16 forks source link

initial fastlane structure #15

Closed IzzySoft closed 1 year ago

IzzySoft commented 1 year ago

as discussed in #13 – and here are some hints to it:

Enjoy!

IzzySoft commented 1 year ago

Thanks! If you need a badge to link to your app in my repo, be welcome to take your pick :smiley:

alexrintt commented 1 year ago

Thanks! I added to the repo readme. And I'll improve the fastlane docs even more later on this week, really thanks for your pr!

I've only a doubt about the permission section, I didn't find any info in your repo about: how do you define the permissions required by an app? image

Screenshot from apt.izzysoft.de/fdroid/index/apk/io.alexrintt.kanade.

Those versions (v0.2.1 and v0.3.0) it has only QUERY_ALL_PACKAGES permission.

So maybe it was queried from the past versions? (v0.1.0) when these permissions were still required?

IzzySoft commented 1 year ago

I added to the repo readme

Cool, thanks!

how do you define the permissions required by an app?

I do not define permissions. Fdroid reads those from the APKs (Manifest IIRC). To compare, here's the output of aapt d badging:

package: name='io.alexrintt.kanade' versionCode='3' versionName='0.3.0' platformBuildVersionName='12' platformBuildVersionCode='31' compileSdkVersion='31' compileSdkVersionCodename='12' sdkVersion:'19' targetSdkVersion:'30'
uses-permission: name='android.permission.QUERY_ALL_PACKAGES'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
…

Obviously some dependency drags in the other two (yes, I saw your original Manifest only has the first). If you'd ask me to guess, I'd pick shared_storage from your pubspec.yaml. Good guess for number 2, huh?

<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="io.alexrintt.sharedstorage">
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>

I have another good guess whom you could ask on that plugin :see_no_evil: But that still doesn't tell us where WRITE comes from. Except if you included your example as well that is:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.alexrintt.sharedstorage.example">
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <application android:icon="@mipmap/ic_launcher" android:label="Shared Storage Example">

:man_shrugging:

alexrintt commented 1 year ago

I'm really confuse after debugging these apks. As you said it is probably coming from the third-party dependencies, so I removed all permissions from the shared storage example and the shared storage plugin itself, and then I compiled again... and it still prints WRITE and EXTERNAL permissions storage! lol. I'm using apktool to decompile the apk apktool d shared-storage-example-without-any-permissions-declared.apk:

<!-- Final apk AndroidManifest.xml -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

I even tried to find some subplugin/subpackages in the dependency tree that uses these permissions but I didn't find any (because the only dependency is shared storage itself and another dart based package which doesn't even has native android code).

I'll investigate further tomorrow, find some answer, cause SAF is not intended to be something I would require permissions (at least in my head from what I understood, but probably I understood wrong).

But thanks for your explanation, it helped a lot!

IzzySoft commented 1 year ago

That's really strange. Good luck then finding the culprit!

alexrintt commented 1 year ago

Ok. I found: https://github.com/anggrayudi/SimpleStorage/blob/master/storage/src/main/AndroidManifest.xml. It's a native Android library used by shared_storage plugin. I completely forget about it, lol. Thanks man.

IzzySoft commented 1 year ago

Glad the riddle solved!