New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup of remaining folders in /data/app #996

Closed
mzielinskim opened this Issue Jun 30, 2017 · 7 comments

Comments

2 participants
@mzielinskim

mzielinskim commented Jun 30, 2017

On my Samsung galaxy A5 (2019) i have the problem that when i update an app there are files left from the previous version:

e.g.
/data/app/com.garmin.android.apps.connectmobile-2
/data/app/com.garmin.android.apps.connectmobile-3

One of these folders has only one file in it:
/data/app/com.garmin.android.apps.connectmobile-2/oat/arm64/base.odex (date 26.06.2017)

the other folder has subfolder /lib/ and /oat/ - and this is the actual one - seems that due to a bug in android or Playstore the old base.odex file cant be deleted and remains there after an update and thats the reason android creates a complete new folder.
In the newer folder there is also a base.odex file in this example from 27.06.2017

i first installed the app at 26.06. and updated at 27.06.

@d4rken d4rken added this to the Next Tasks milestone Jun 30, 2017

@d4rken

This comment has been minimized.

Owner

d4rken commented Jun 30, 2017

Can you post the output of pm path com.garmin.android.apps.connectmobile ?

@mzielinskim

This comment has been minimized.

mzielinskim commented Jun 30, 2017

package:/data/app/com.garmin.android.apps.connectmobile-3/base.apk

@d4rken

This comment has been minimized.

Owner

d4rken commented Jun 30, 2017

Looks possible. Will check it out for one of the next updates.

@d4rken d4rken modified the milestones: v4.8.0, Next Tasks Sep 1, 2017

@d4rken

This comment has been minimized.

Owner

d4rken commented Sep 15, 2017

@mzielinskim If you have time to try a test build, can you mail me at support@...?

@d4rken

This comment has been minimized.

Owner

d4rken commented Sep 15, 2017

My idea for handling this:

For each potential owner SD Maid will now additionally check the used sourceDir:
https://developer.android.com/reference/android/content/pm/ApplicationInfo.html#sourceDir
if that sourcedir is similar, e.g.
/data/app/com.garmin.android.apps.connectmobile-

but not equal to the one used by the system (the one in the sourceDir variable):
/data/app/com.garmin.android.apps.connectmobile-3

then SD Maid should throw out com.garmin.android.apps.connectmobile as being the owner of
/data/app/com.garmin.android.apps.connectmobile-2

which would make that folder a folder without owner, and for items in /data/app that means it's considered a corpse.

In the logs it should look like this:

D/SDM:CSIAppApp: False positive owner match. Removing owner Owner(pkg=com.garmin.android.apps.connectmobile, flags=[]), because it's actually owning /data/app/com.garmin.android.apps.connectmobile-3/base.apk, not /data/app//data/app/com.garmin.android.apps.connectmobile-2

@d4rken d4rken closed this Sep 16, 2017

@d4rken

This comment has been minimized.

Owner

d4rken commented Sep 16, 2017

Log from @mzielinskim, working as expected.

Finds the corpse:

1505572112096 D/AppCorpseFilter: Checking:com.garmin.android.apps.connectmobile-2
1505572112099 D/CSIAppApp:SimilarityCheck: False positive match. Removing Owner(pkg=com.garmin.android.apps.connectmobile, flags=[]), because it's the owner of /data/app/com.garmin.android.apps.connectmobile-1/base.apk, not /data/app/com.garmin.android.apps.connectmobile-2
1505572112099 V/FileForensics: Location: 1ms (APP_APP), Processing: 2ms, avg. 1ms (/data/app/com.garmin.android.apps.connectmobile-2)
1505572112100 D/AppCorpseFilter: Corpse: com.garmin.android.apps.connectmobile-2
1505572112107 V/SmartIO: determineReadAccess([/data/app/com.garmin.android.apps.connectmobile-2]):ROOT
1505572112107 V/ShellReadTask: Reading:/data/app/com.garmin.android.apps.connectmobile-2
1505572112107 D/Shell:Interactive: runCommand(Command(commands=[$V5B9D812A9C51 test ! -e '/data/app/com.garmin.android.apps.connectmobile-2' || $V5B9D812A9C51 find '/data/app/com.garmin.android.apps.connectmobile-2' -mindepth 1 -print0 | $V5B9D812A9C51 xargs -0 -r -s 65536 $V5B9D812A9C51 stat -c "%a:%F:%d:%i:%u:%g:%s:%B:%b:%Z:%N"]))
1505572112108 V/Shell:Interactive: Input : $V5B9D812A9C51 test ! -e '/data/app/com.garmin.android.apps.connectmobile-2' || $V5B9D812A9C51 find '/data/app/com.garmin.android.apps.connectmobile-2' -mindepth 1 -print0 | $V5B9D812A9C51 xargs -0 -r -s 65536 $V5B9D812A9C51 stat -c "%a:%F:%d:%i:%u:%g:%s:%B:%b:%Z:%N"
1505572112108 V/Shell:Interactive: Input : echo 2be28e06-3503-4d21-8784-8b33bd76b228 $?
1505572112109 V/Shell:Interactive: Input : echo 2be28e06-3503-4d21-8784-8b33bd76b228 >&2
1505572112114 V/Shell:Interactive: Output: 755:directory:66321:1208155:0:0:4096:512:8:1505570958:`/data/app/com.garmin.android.apps.connectmobile-2/oat'
1505572112115 V/Shell:Interactive: Output: 755:directory:66321:1208156:0:0:4096:512:8:1505570958:`/data/app/com.garmin.android.apps.connectmobile-2/oat/arm64'
1505572112115 V/Shell:Interactive: Output: 777:regular file:66321:1208157:0:0:76624552:512:149672:1505570960:`/data/app/com.garmin.android.apps.connectmobile-2/oat/arm64/base.odex'
1505572112116 V/Shell:Interactive: Error : 2be28e06-3503-4d21-8784-8b33bd76b228
1505572112116 V/Shell:Interactive: Output: 2be28e06-3503-4d21-8784-8b33bd76b228 0
1505572112116 D/Shell:Interactive: runCommand(...): Command.Result(exitcode=0)
1505572112117 V/ShellReadTask: ShellReadTask(files=/data/app/com.garmin.android.apps.connectmobile-2) -> ShellReadResult(filecount=3)
1505572112117 D/SmartIO: read(result=ShellReadResult(filecount=3))

Matches the original correctly

1505572112544 D/AppCorpseFilter: Checking:com.garmin.android.apps.connectmobile-1
1505572112547 V/FileForensics: Location: 0ms (APP_APP), Processing: 1ms, avg. 1ms (/data/app/com.garmin.android.apps.connectmobile-1)
1505572112547 V/FileForensics: Matched /data/app/com.garmin.android.apps.connectmobile-1 to com.garmin.android.apps.connectmobile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment