yashsingh1/xdaforums huggingface dataset:
[Galaxy Y GT-S5360 General] halnovemila:
Hi Aaren11,

well, honestly I wasn't much confident the trick could work in your case (and in any Android 4.4 or above) because the failure would happen if in the folder the package installer is going to save the app apk file, there's already "something" (either a file or a folder) that already uses the same filename of the apk that has to be saved.

But given that the package installer makes a new empty folder where to store the apk, then there inside won't be anything that will interfere with the installer.

In earlier Android versions seems that the package installer doesn't recognize the existence of the dummy folder because, in order to chose the apk file name, the installer check only the existing FILES and there names, so it skip the folders... but when it's time to "write" the file, the presence of the folder with same name will make the installation to fail.

But in Android 4.4 for sure the package installer will check the folders name first, in order to chose the name of the folder that it will make to store the apk file inside.

So the dummy folder will be recognized and "skipped" by making a new empty folder with a different name.

So there's one last hope.

If in pre 4.4 Android the trick works because the installer check for existing files but not for existing folders, maybe in 4.4 the trick could work if the installer check ONLY for existing folders and NOT for existing files.

So here's the plan ;)

Delete all the dummy folders you made.

In /data/app make a dummy file (a empty text file) and give it the name of the folder the installer will likely use (com.android.vending, com.android.vending-1).

If the installer won't recognize it, then likely it will fail when it will attempt to make the folder.

If it recognize it and will delete it first, then you have to make it undeletable by power of the "immutable" flag that you can set on the file using the chattr +i command; given that the /data partition is formatted with an Ext filesystem.

Once again... good luck! ;)
[Galaxy Y GT-S5360 General] Aaren11:
Sadly, still no dice.

Even just using the installer apk for a more up to date version of Play Store, it simply creates a new folder, numerated after the files I've made. I created:

com.android.vending

com.android.vending-1

com.android.vending-2

As blank files without an extension. And the installer simply creates a 'com.android.vending-3' folder and installs there.

I'm going to try again with dummy base.apk files in the appropriate folders - but I doubt it'll work. The installer clearly seems capable of distinguishing dummy folders and files, and simply creating a new directory every time.

:(

Edit: No luck with that route either. The installer still simply creates a new, sequential directory and installs to that. At this stage it looks like the only way to get out of either app auto updating silently would be to block that process from starting entirley, because simply trying to trick it with misleading directories clearly isn't going to work. I think I'm going to have to give lucky patcher another go. Thanks google -_ -
[Galaxy Y GT-S5360 General] halnovemila:
Nah, I don't think the package installer cares about the files and folders it finds in /data/app, either real or dummy... what the installer does is just to check the existing filenames so to make a proper new one.

And the trick works only if the package installer can't "see" the dummy folder/file before its attempt to make the new folder/file.

So, seems that the package installer of Android 4.4 (and above) is a bit smarter than the one that comes with earlier versions.

I was wondering if there's a way to "hide" the dummy folder/file to the package installer so it will end up to make a new folder that will actually match the dummy filename incurring in a system error, and then the failure.

Unfortunately there's no such a "hidden" attribute to files/folders in Android OS.

Removing all the read,write,execute permissions on a file/folder doesn't prevent to list those file/folders along the rest of the directory content.

At this point I only wonder if the package installer might fail because the new folder name it has to make has a "split" number (-1,-2...) that exceed an internal limit.

So, let's say that package installer can handle names till two digits split (-99), what will happen if there's a dummy folder with name com.android.vending-99?

Will the installation fail? or the installer will go further and will make a com.android.vending-100 folder?

How about com.android.vending-999?

Can you try this?

Make dummy folders with name com.android.vending-9, com.android.vending-99,com.android.vending-999,com.android.vending-9999,com.android.vending-99999,com.android.vending-999999 and see what will happen once again ;)
[Galaxy Y GT-S5360 General] Aaren11:
No such luck, I honestly doubt it can be circumvented with file structures or attributes.

I created the directories:

com.android.vending

com.android.vending-1

com.android.vending-2

com.android.vending-3

com.android.vending-4

com.android.vending-5

com.android.vending-6

com.android.vending-7

com.android.vending-8

com.android.vending-9

com.android.vending-99

com.android.vending-999

com.android.vending-9999

com.android.vending-99999

com.android.vending-999999

And the installer simply makes a 'com.android.vending-10' directory and installs there. The lucky patcher replacement .apk also gets overwritten, at this stage I don't think there's really any way to get around this short of maybe decompiling the apk for the playstore and google services - and stripping out the code that enables auto updates.

At this point I have almost no interest in using my phone anymore. I understand googles desire to install updates and keep clients at the same version. But I don't trust them not to farm my personal info, or suck the life out of my battery.
[Galaxy Y GT-S5360 General] Aaren11:
Yes it can! Is the answer.

Again the installer simply creates a 'com.android.vending-100' directory, and installs there. (I'm not surprised.) I expect there is no lazy coding of a limited directory algorithm, and if we kept going up to -1,000,000 it would still simply create a new directory.

I've already got a bunch of services disabled in MyAndroidTools, in an attempt to block both the battery drain and the autoupdate. Even with both the receivers disabled for CheckWifiAndAutoUpdate, and the service disabled as well, the Store still updates itself.

Following the advice here I decompiled Phonesky.apk and edited the suggested line before resigning and recompiling. Unfortunatley I fear I either did something wrong or the modification itself no longer works, as play store simply crashes when replaced with this modded Phonesky.apk. I'm going to try simply decompiling and recompiling without the edit to try and pin down the error, but it's still largely a shot in the dark.

Edit: Decompiling and recompiling the play store without editing that one line allows it to run again. So likely that fix no longer works with the version of play store I'm using.

Thanks again for your suggestions.
[Galaxy Y GT-S5360 General] halnovemila:
Yes, I agree.

I guess we have tried all we could have tried in order to spot a way to make the installation fail due to a file/folder name conflict.

Anyway thanks for the many attempts and the feedback Aaren11, I also learn something I didn't know.

So you even know how to decompile, edit and recompile the Apps packages ah?

That's great! :D

Even if this is going to be somewhat OT can you please upload the SelfUpdateScheduler.smali file somewhere and pass me the link (eventually in PM)?

I'd like to have a look at it and join your battle for freedom from Google's self updates till the very end ;)
[Galaxy Y GT-S5360 General] halnovemila:
I just had one new idea... it might make the update installation to fail ;)

If GPS is installed as sytem app, the update will install as additional app and stored in /data/app and the old one is left untouched stored in /system.

But if GPS is installed as user app, the package installer will then try to remove the old installation after it has saved the updated version in a new folder.

What if you set the base.apk file of the old GPS as "immutable"?

The package installer will likely fail while in the attempt to delete the old app and that might cause the whole update installation to fail.

It make sense... doesn't it?

IMHO it worth a try ;)
[Galaxy Y GT-S5360 General] Ri9000:
there is a post around here somewhere which describes in detail, even providing the tools: howto edit your framework-res to disable updates.

the filename is "fix-your-own-framework.zip". Hopefully google will fill in the blanks.

below is an extract showing some edits . .

<string-array name="config_disabledComponents">

<item>com.google.android.gsf/com.google.android.gsf.update.SystemUpdateActivity</item>

<item>com.google.android.gsf/com.google.android.gsf.update.SystemUpdateService$Receiver</item>

<item>com.google.android.gsf/com.google.android.gsf.update.SystemUpdateService$SecretCodeReceiver</item>

<item>com.google.android.gms/com.google.android.gms.update.SystemUpdateActivity</item>

<item>com.google.android.gms/com.google.android.gms.update.SystemUpdateService$Receiver</item>

<item>com.google.android.gms/com.google.android.gms.update.SystemUpdateService$ActiveReceiver</item>

<item>com.google.android.gms/com.google.android.gms.update.SystemUpdateService$SecretCodeReceiver</item>

</string-array>
[Galaxy Y GT-S5360 General] halnovemila:
Thx for the hint Ri9000,

So, according to the extract you posted, it should be possibile to achieve the same result by using MyAdroidTools (https://play.google.com/store/apps/d...oidtools&hl=en) and disabling Google Services Framework SystemUpdateActivity (Activity) and SystemUpdateService (Service)
[Galaxy Y GT-S5360 General] Aaren11:
I'd temper your excitement halonove, at least just test it out for yourself.

On my versions of google play / services, I've had all of those receivers, services and activities disabled since the beginning of owning my device. And I've continued to have silent background autoupdates.

I may have found something that actually does the trick. But it seems to be causing crashes of the google play service, so I need to figure out if that leak can be plugged or not.
[Galaxy Y GT-S5360 General] halnovemila:
Hi Aaren11,

I don't think I had put any excitement while replying to Ri9000 post.

I just thought an alternative way to the one offered by Ri9000, which is to use MyAdroidTools instead of dealing with decompiling-edit-recompiling of Google Services FRAMEWORK.

Actually I can't test by myself (I would love to do it) as my phone is running Android 2.3 and I'm ok with my "dummy folder" trick (eventhough it doesn't prevent the download of the update, but it prevent the installation); so my friend, as of now, you are the one "in charge" for testing I'm afraid ;)

But please, pay attention that the extract posted by Ri9000 refer to service and activity exposed by Google Services Framework along with Google Play Services, which are two different apk.

So I wonder if you tried to disable too the service and activity within Google Services Framework.

Anyway sounds to me that you skipped to read a couple of my previous post as your last post doesn't address at all what I wrote, so please be sure to read those of my posts as it might be of help.

For your convenience I copy here the links the posts of mine you might have missed to read.

#24 http://xdaforums.com/showpost.php?p=64319564&postcount=24

#25 http://xdaforums.com/showpost.php?p=64320810&postcount=25
[Galaxy Y GT-S5360 General] Aaren11:
I hadn't skipped any of your posts hal, thanks for your concern.

I have indeed already tried uninstalling Google Play Services as a system app, although I didn't try and make it immudable, it's unlikely to work with the versions of Gplay services and Gplay Store I have - as making either user app, causes Services to constantly crash. I presume because it no longer has access to certain permissions it requires.

When I said previously:

I meant all three Google apks. Store, Services, and framework, sorry if that wasn't immediatley clear.

MyAndroidTools is an excellent app, but for a quicker way to batch disable many of the troublesome Google services, receivers and activies, I've found this to be quite useful. Init.d support isn't nessacary, as it must be run seperatley from a console emulator, and changes stick after reboot.
[Galaxy Y GT-S5360 General] halnovemila:
Well... I've learnt another new thing today! :D

I didn't know that Package Manager (pm) can be used to freeze selected components (Services, Activities...) within a given app.

Yes, definitely using a script is a better way than manually disable each service; it not only is quicker but it's also useful as a note/memo of all the disabled components.

I guess Choristav chose to make the script to run at every boot via init.d because in the "hidden" part of his post he stated that

Anyway I keep mentioning MyAdroidTools because I always have a thought for the average Android user which likely isn't familiar with use of scripts, terminal emulators, and command line; but I now certainly recognize you as an advanced Android user Aaren11... an expert ;)

So you already tried to convert Google Play STORE to user app, and it crashes?

Or it is the Google Play SERVICE that crashes if it's converted to user app?

I know it's not going to solve your problem as you need a solution that address both GP Service and Play apps self updating, but could you try to convert GP STORE only as user app, see if it still works, make the base.apk immutable, and then try to manually update the app and see if the installation fails or if it doesn't fail what happens to the base.apk (it's still there but ignored as another apk with split name is been saved in the folder?).

I really would love to try it by myself but, as I said, I don't have a phone that runs Android 4.4 or above.

Anyway, for the record, I have to say that me too I've experienced continuous GP STORE crash after installing the update to the last version 6.0.5 (on Android 2.3.1 and GP SERVICES ver. 5.0.89, usually frozen).
[Galaxy Y GT-S5360 General] pranciskus2:
I noticed sequence:

I created com.android.vending.apk-1 folder. Then it works. Deleted this folder and reboot. Updates again active. Then I done this trick again and it not works. After that I tried to reboot and got bootloop. (Sony xperia e2303 5.0 android lollipop):). So you must to make extract and save your rom after these tricks;)
[Galaxy Y GT-S5360 General] halnovemila:
Thanks for your feedback.

It's interesting to note that the trick still works with lollipop on Sony Experia while it doesn't with lollipop on HTC M7 (as reported ealier here by user Aaren11), that means that same Android versions might have been equipped with different package installers.

On the other hand I don't see any reason that removing or adding an empty folder might cause a bootloop.

So, I suspect that something else, unrelated to the folder trick, has happened on your phone at the same time you were doing your experiments and caused the bootloop.

Eventually you shutdown your phone while there was some system updates running in background and one of them has left incomplete and corrupted causing a system crash at boot time.
[Galaxy Y GT-S5360 General] pranciskus2:
Yes. I rebooted while update was incomplete.
[Galaxy Y GT-S5360 General] phoenix.505:
thanks for the guide, tried some variations using your steps, lets just hope that GPS doesn't update itself again.
[Galaxy Y GT-S5360 General] X-weApon-X:
I was asked to post this in here for somebody else, I hope I have done this correctly:

Note that this was in response to a specific question from another forum, and so some of this might not seem to relate..

======quoted post==>>

I apologize for this huge tome of a response, here is some of my device info:

From Aida64

Android Version 5.1 (Lollipop)

API Level 22

Rooted Device Yes

Android ID b5880d9eb9be50db

Codename REL

alps/full_ios6735_66ct_c_l1/ios6735_66t_c_i1:5.1/LMY47D/1464074867:user/test-keys

Kernel

3.10.65+ (soft@soft) (gcc version 4.9.x-google 2140827 (mtk-20150409) (GCC) ) #2 SMP PREEEMPT Tu May 24 15:30:56 CST 2016

I'm pretty sure what happened, I had created the folders #System/Data/App/com.google.vending-1.apk/ AND com.google.vending-2.apk, which was not needed.

The system created the folder /com.google.vending-3.apk/ and there was a base.apk file in there along with a /Lib folder. I deleted /com.google.vending-2.apk AND vending-3.apk,

and this removed my Market app.

After I rebooted and installed Google Play v6.1.12 (which was the original stock market app), I simply created ONLY /data/app/com.google.vending-1.apk,

And I have had no new updates of the market app ever since.

My other issue was the inability to install any version of com.google.android.googlequicksearchbox, in that case, I created a folder named

/com.google.android.googlequicksearchbox-1/ (without the ".apk" extension). I have documented my solution to that in this thread.

I also bricked the device again late last night when running Vicki Bonick's kr2su-apps2sd script, after I flashed the device

I re-rooted it and recreated all of these folders and reinstalled the Search Box app again, using the same method.

I had tried just installing it from Play Store and it was -505 error again, So I just repeated what I did earlier.

I'm not sure why it works, I'm just glad it did, because I like to use Google Now Launcher and it won't run without the Google SearchBox App.
[Galaxy Y GT-S5360 General] halnovemila:
Yes, it's me, the OP of this thread (and inventor of the "dummy folder" trick), who asked X-weApon-X to repost here what he earlier posted on this thread.

Delete, Disable, Downgrade and prevent update of Google Play Services [ROOT]

I think his case is pretty close to what reported here above by user Aaren11 where the package installer was also making new folders on which the update were installed, preventing the dummy folder trick to be effective.

X-weApon-X (apparently) success story maybe of help to others.
[Galaxy Y GT-S5360 General] X-weApon-X:
Well, I found out today that "vending" aka google play is sneaking past the folder block I have, but using variations of the package name, for instance, /com.android.google.vending-1, or /com.google.android.vending-1 as well as the default /com.google.vending-1 (??) folder. So each time I notice I have had an unwanted play store update, I find it in system/data/apps/ and take note of the new name. Then I go in and uninstall the update, and before i reboot, I add a new folder with the last package name used.

I have had sporadic success using the variant on the google play services fix, and in some cases, 2 to 3 days free of the forced Market update. But it is a tenacious update, sneaking in using variants of the "com.android.vending" name. As soon as I discover them, I create a folder with that name. So far, I have seen "com.google.android.vending-x".

I just applied this method right now, and when I activated Wifi, there was no update - So this MAY still work:

I also created dummy APK's in /system/system/app, not folders, but empty files. Because I had seen the Play Services app get written in there with a zero-byte file, after I applied the Play Services fix.
[Galaxy Y GT-S5360 General] gna212:
creating a dummy folder works.... but GP still downloads the update to cache

another option: setting> data usage> media (scroll down and find it) > tick "Restrict background data"

cons: you can not download any App from GP..... u have to remove the "tick" for that

cheers....
[Galaxy Y GT-S5360 General] ale5000:
Can you please give me some info about this update app?

Where is it located?
[Galaxy Y GT-S5360 General] Xkhoax:
I created com.android.vending.apk-1 folder. The Play Store not updated immediately as normal but when screen of it still updated to the newest version, the folder disappeared even I set the folder permission with no any access,

Mi 5 / MIUI 8
[Galaxy Y GT-S5360 General] lebigmac:
Hi. Does this trick still work with the latest Google Play Store version 7.7.31.O-all ???

The Google Play updated itself yet again today without my consent.

Now i've got:

Google Play services (198 MB)

Google Play services for Instant Apps (13.57 MB)

Google Play Store (30.04 MB)

This is really annoying. I want a very light-weight Google Play Store app that doesn't phone home all the time and auto-update itself.

Can I just delete Google Play Services? It's really huge almost 200 MB !!!
[Galaxy Y GT-S5360 General] halnovemila:
it doesn't work on all those Android where the package installer stores the new installed apps (including updates) in a dedicated subfolder of /data/app (and rename the app package to base.apk).

It should still work on those systems where the newly installed apps have their package stored directly in /data/app folder.

Have a look at your /data/app folder and you'll find out what works for you.

As far as I know Google Play Service can be uninstalled and eventually reinstalled as user app and moved to SD card storage
[Galaxy Y GT-S5360 General] dtriguero:
I think i managed to stop playstore from self updating. Its version 7.8.15.p-all [o][pr]15448550. I decompiled phonesky.apk found in /system/priv-app/phonesky/. I found two .smali files located in com/google/android/finsky/selfupdate/ named selfupdatecheckerscheduler i opened both and searched for 0x0 both only had one entry so changed the 0x0 to 0x1 in both and rebuilt/signed the apk. I replaced the original apk in /system/priv-app/phonesky with modded one set permissions to rw-r-r and rebooted. Cleared app data and all seems to be working but did have a couple times app stopped but was prior to clearing app data. It did pop up in my notifications off and on saying downloading google play like was updating but then would just go away as if the update was cancelled. So far google play has not been able to self update but can update my other apps auto or manually as well as install new apps. Hopefully this can help others looking to stop google play from self updating.
[Galaxy Y GT-S5360 General] lebigmac:
Hi [MENTION=4039011]dtriguero[/MENTION]

Thanks for posting your technique.

Congratulations for figuring it out.

Can you please post a fool-proof tutorial on how to do it?

Or can you please upload the patched Google Play Store app and post a link here?

And what about the Google Play services for Instant Apps (13.57 MB) and Google Play services (198 MB)? Did you also patch them to prevent them from phoning-home and updating themselves?

Thank you for your support!
[Galaxy Y GT-S5360 General] dtriguero:
Sorry it didn't work as should it stopped it from self updating but caused issues with google apps. They thought google play services wasn't installed even though it was and get saying device wasn't compatible to download it. I haven't messed with trying again lately but i may one day as for the other two u asked about i haven't even looked in to them. If u still wanna play around with playstore below is a link to thread where i had attached the one i was attempting with. It works for not updating its self but cause google apps to have issues u'll see if u read that post or try it out. If u do try it be sure to keep a copy of ur original one.

https://xdaforums.com/showthread.php?t=1580827&p=72493554
[Galaxy Y GT-S5360 General] MicrosoftSam:
I tried making the folder in Total Commander. I will let you know whether it works or not.

:p
[Galaxy Y GT-S5360 General] MicrosoftSam:
Cool! Also I am going to share a method of mine, what I did was use Total Commander with root privileges and navigated to /data/app/ folder and created the file there and it worked
[Galaxy Y GT-S5360 General] Niccolò Paganini:
Hi people.

Why don't you simply install a Firewall (like AFWall+ or NetGuard) and deny Internet access to Google Play Store (and Google Play services, if you wish) ?
[Galaxy Y GT-S5360 General] Fahrilubis:
Hei u have trick for stop auto updated then what about to force auto update? Cause my google play store stop giving update store