[MODULE] Detach3 - Detach Market Links

hinxnz

Senior Member
Jul 21, 2009
2,829
2,427
193
Detach3

Introduction

This Magisk module is for detaching apps from the Google Play Store.
It removes your defined packages from the 'My apps & games' section and disables them from auto-updates.

Installation
Flash module in Magisk Manager only.
No need to reboot after flashing this module.
This module is designed to flash as many times as you like.
It is configured with a *configuration file. You can create one before flashing this module to define your package(s) or the default one will be created instead, which detaches YouTube by default.
Add your package name(s) you would like to detach to the configuration file, with each package name on a new line.
You can add more package names to your configuration file or the default one at any time, then simply just flash module again to apply it. Again, no need to reboot or any other user interaction needed.
Read the log that Magisk Manager displays when flashing the module, it displays the detached package(s) for confirmation.
*configuration file directory /storage/emulated/0/Android/detach.cfg

Uninstallation
Simply wipe app data for Playstore, then open playstore and navigate to 'My apps & games' section and your detached package(s) will be populated.

Troubleshooting
Follow uninstallation method and then re-flash the module.

Changelog
v3.00
- Initial release
v3.01
- Disabled Fallback broadcast

FAQ
Q. Can I use the old detach.txt?
A. No, I decided to ditch it. It now uses a new method explained in the installation section.

Q. Where is the boot script installed?
A. There isn't one, actually there is nothing installed besides the module properties.

Q. Why does it even install the module properties then?
A. If not, some users may think it's not installed. It also shows what version was used.

Q. Does this break safetynet?
A. No, it doesn't conflict with safetynet at all.

Q. Why shouldn't I re-enable Play Protect?
A. It will interfere with the module's purpose.

Q. Will having Play Protect disabled, open me up to vulnerabilities?
A. No, the playstore scans their market apk's after developers upload them.

Q. I usually install after-market apks (modified ones) and I think play protects me from this?
A. You should scan your unknown apk with Total Virus.

Q. How do you find a package name?
A. Magisk Manager lists your apps with the package name underneath each one, in the Magisk Hide list.

Q. What Magisk version is needed?
A. The module template is designed for Magisk v20.4+

Download
See attached below -- detach-3.xx.zip

Previous versions

Detach Market Links for Theme Ready Apps *

Introduction
This Mod is for detaching apps from the Google Play Store that are included in the Theme Ready Apps zip and/or aroma installer from Team Black Out for CMTE and Substratum theme engines.
*Now also includes majority of all themed apps by Team Black Out by using an optional txt file.
The purpose is that updates will not show in your update list and also in update notifications from the Google Play Store.
This allows you to auto-update or the ability to use the update all button without the worry of updating Theme Ready Apps which will break your themes for those apps updated.
The Google apps that are detached if you're not using the optional txt file are Gmail, Google App, Google Plus, Hangouts, YouTube and Gboard (Google Keyboard).

Installation
Flash Mod in recovery, no need to wipe anything but if using SuperSU systemless mode or Magisk, flash this mod afterwards.
No need to flash again in-between ROM updates if using SuperSU systemless mode or Magisk or if your ROM supports addon.d scripts.
To detach more themed apps, place the detach.txt file either on root of your sdcard or internal storage and remove the comment from the apps you wish to detach and then flash Detach.zip
You can also use the optional detach.txt file to just selectively detach Theme Ready Apps.
If you don't use the supplied detach.txt file, only Theme Ready Apps will be detached.
To add your own custom packages (apps), read here > https://forum.xda-developers.com/showpost.php?p=72194332&postcount=147

Uninstallation
Rename detach.txt on sdcard to detach.remove, flash Detach.zip again and reboot.
This will remove all files related to installation, including the txt and custom file and restores all market links.

Note
If not using SuperSU or Magisk, you need to have init.d support.
The configured script doesn't execute until after 60 seconds when boot has completed, this also includes the remove script too.
This Mod has been tested by myself on Android 6 and 7.
You still have the ability to update your Theme Ready Apps via Google Play Store but you'll need to use the search function instead.

Changelog
v1.0
- Initial release
v1.1
- Changed detach method
v1.2
- Disabled service for database
v1.3
- Bug fixes
v1.4
- Added static sqlite binary
v2.0
- Added themed apps to detach with configuration txt file (optional)
v2.1
- Cleaned up installation script
- Added mod removal option
v2.2
- Magisk compatible (systemless installation)
- SuperSU systemless mode compatible (systemless installation)
- Fixed init.d detection
- Fixed market links reappearing
- Updated detach.txt (added Wallpapers, Pixel Launcher, Capture (GoPro))
v2.3
- Updated script and detach.txt (added Gboard, Clock, Camera, Google Connectivity Services, Google VR Services, Google Play Services)
v2.4
- Updated script and detach.txt (added Google Carrier Services and the ability to add custom packages)
v2.5
- Fixed market links reappearing
v2.6
- Main script updated for removal process
- Disabled code for a playstore service that no longer needs to be disabled
- Removed Contacts, Phone and Photos from default install
 

Attachments

Last edited:

sunanulh

Senior Member
Jan 1, 2012
377
58
0
Surabaya
Thanks @hinxnz, I'll try the newest one.

Report 1.3: My theme ready gapps were detached except Google Calendar. I installed Black Google Calendar from TBO. Is there something I can do for this?
 
Last edited:
  • Like
Reactions: hinxnz

hinxnz

Senior Member
Jul 21, 2009
2,829
2,427
193
Thanks @hinxnz, I'll try the newest one.

Report 1.3: My theme ready gapps were detached except Google Calendar. I installed Black Google Calendar from TBO. Is there something I can do for this?
I was thinking about adding more themed apps to detach but would have to either use a config file on sdcard for example or probably better to make an aroma version but I would need all the package names first.
 

sunanulh

Senior Member
Jan 1, 2012
377
58
0
Surabaya
I was thinking about adding more themed apps to detach but would have to either use a config file on sdcard for example or probably better to make an aroma version but I would need all the package names first.
I think a "fulfilled" config file is simpler. So the users have just to add/remove '#' symbol.
For the name of the apps, maybe you can ask to TBO.

Cheers
 
  • Like
Reactions: hinxnz

hinxnz

Senior Member
Jul 21, 2009
2,829
2,427
193
It's still not working on Stock rooted N. Thanks for trying.
Could you call script manually with Terminal Emulator and post output

Glad I saw your post that you put this thread up!

I downloaded 1.3 and flashed it and rebooted and waited for two minutes, but YouTube is still showing an update.
But the first version still works for you?
YouTube hasn't been updated for awhile AFAIK, what version is showing an update?
Are the other theme ready apps showing in your 'My apps & games' list?
Do you have any apps in your 'Wishlist', found in side menu?
 

cmo220

Senior Member
Aug 26, 2010
1,288
393
103
Could you call script manually with Terminal Emulator and post output


But the first version still works for you?
YouTube hasn't been updated for awhile AFAIK, what version is showing an update?
Are the other theme ready apps showing in your 'My apps & games' list?
Do you have any apps in your 'Wishlist', found in side menu?
I couldn't get a /su.d folder so I put it in /system/su.d, which was already there and working. Here is the output.

angler:/ $ su
angler:/ # /su.d/99-detach.sh
sush: /su.d/99-detach.sh: not found
127|angler:/ # /system/su.d/99-detach.sh
angler:/ # Component {com.android.vending/com.google.android.finsky.services.DailyHygiene$DailyHygieneService} new state: disabled
CANNOT LINK EXECUTABLE "sqlite3": cannot locate symbol "u_setDataDirectory_55" referenced by "/system/xbin/sqlite3"...
Aborted
CANNOT LINK EXECUTABLE "sqlite3": cannot locate symbol "u_setDataDirectory_55" referenced by "/system/xbin/sqlite3"...
Aborted

And a bunch more of the same error.
 
  • Like
Reactions: hinxnz

RED ZMAN

Senior Member
The first version? I've deleted the previous versions .zips.

I've installed 1.0, 1.2, and 1.3.

Youtube has been showing this way for about a week, even after reboots.

11.32.53 is what's showing on Google Play, I've got 11.29.55 installed from TBO Theme Ready Apps v 21.
com.google.android.youtube

Showing up in the My apps & games list as installed...

Gmail
Google App
Google+
Google Photos
Hangouts

Wishlist, yes, I've got several.
 
  • Like
Reactions: hinxnz

hinxnz

Senior Member
Jul 21, 2009
2,829
2,427
193
The first version? I've deleted the previous versions .zips.

I've installed 1.0, 1.2, and 1.3.

Youtube has been showing this way for about a week, even after reboots.

11.32.53 is what's showing on Google Play, I've got 11.29.55 installed from TBO Theme Ready Apps v 21.
com.google.android.youtube

Showing up in the My apps & games list as installed...

Gmail
Google App
Google+
Google Photos
Hangouts

Wishlist, yes, I've got several.
Could you call script in Terminal Emulator and post output too.
For example:
Code:
su
/system/su.d/99-detach.sh
 

Surge1223

Recognized Contributor
Nov 6, 2012
2,603
7,396
203
Florida
Could you call script in Terminal Emulator and post output too.
For example:
Code:
su
/system/su.d/99-detach.sh
Is there any reason you are using a dynamically linked sqlite in your zip? the error the user is getting is because of that I believe. Idk I would try to use a static sqlite binary. Ill attach one so you/someone can have, but in case anyone is curious how to quickly compile sqlite3 statically ill post it in the spoiler tags below.

oh and just to note, I forgot to rename it from sqlite3 to sqlite before uploading



Im not going to explain the lines though, pretty straight forward imho
/opt/androideabi is my ndk toolchain prefix

Code:
mkdir sqlite3-static
cd sqlite3-static 

wget https://sqlite.org/2016/sqlite-amalgamation-3140100.zip

unzip sqlite-amalgamation-3140100
cd sqlite-amalgamation-3140100

export PATH=$PATH:/opt/androideabi/bin

cp $(ANDROID_BUILD_TOP)/bionic/libdl/libdl.c .
cp /opt/androideabi/sysroot/usr/include/android/dlext.h . 
cp /opt/androideabi/sysroot/usr/include/dlfcn.h .

arm-linux-androideabi-gcc -static -I./  -L./ -ldl *.c -o ../sqlite3

cd ../

file ./sqlite3
 

Attachments

davidwilson83

Retired Forum Moderator / Inactive Recognized Them
Apr 20, 2012
4,150
12,708
263
37
Perth
Is there any reason you are using a dynamically linked sqlite in your zip? the error the user is getting is because of that I believe. Idk I would try to use a static sqlite binary. Ill attach one so you/someone can have, but in case anyone is curious how to quickly compile sqlite3 statically ill post it in the spoiler tags below.

oh and just to note, I forgot to rename it from sqlite3 to sqlite before uploading



Im not going to explain the lines though, pretty straight forward imho
/opt/androideabi is my ndk toolchain prefix

Code:
mkdir sqlite3-static
cd sqlite3-static 

wget https://sqlite.org/2016/sqlite-amalgamation-3140100.zip

unzip sqlite-amalgamation-3140100
cd sqlite-amalgamation-3140100

export PATH=$PATH:/opt/androideabi/bin

cp $(ANDROID_BUILD_TOP)/bionic/libdl/libdl.c .
cp /opt/androideabi/sysroot/usr/include/android/dlext.h . 
cp /opt/androideabi/sysroot/usr/include/dlfcn.h .

arm-linux-androideabi-gcc -static -I./  -L./ -ldl *.c -o ../sqlite3

cd ../

file ./sqlite3
Thank you Surge! :highfive:
 

hinxnz

Senior Member
Jul 21, 2009
2,829
2,427
193
Is there any reason you are using a dynamically linked sqlite in your zip? the error the user is getting is because of that I believe. Idk I would try to use a static sqlite binary. Ill attach one so you/someone can have, but in case anyone is curious how to quickly compile sqlite3 statically ill post it in the spoiler tags below.

oh and just to note, I forgot to rename it from sqlite3 to sqlite before uploading



Im not going to explain the lines though, pretty straight forward imho
/opt/androideabi is my ndk toolchain prefix

Code:
mkdir sqlite3-static
cd sqlite3-static 

wget https://sqlite.org/2016/sqlite-amalgamation-3140100.zip

unzip sqlite-amalgamation-3140100
cd sqlite-amalgamation-3140100

export PATH=$PATH:/opt/androideabi/bin

cp $(ANDROID_BUILD_TOP)/bionic/libdl/libdl.c .
cp /opt/androideabi/sysroot/usr/include/android/dlext.h . 
cp /opt/androideabi/sysroot/usr/include/dlfcn.h .

arm-linux-androideabi-gcc -static -I./  -L./ -ldl *.c -o ../sqlite3

cd ../

file ./sqlite3
Cheers, thanks and yeah that's definitely the reason :)
 
  • Like
Reactions: Surge1223

robot_head

Senior Member
Jun 13, 2015
1,593
587
0
las vegas
Super idea, this would of been good a few months ago when google pushed their framework update and it broke some apps that i kept from updating,,, @Shaftamle google keyboard is the main on one, thank you

3GotoM ym morf tneS
 

hinxnz

Senior Member
Jul 21, 2009
2,829
2,427
193
How to add Black Google Calendar and Black Keep in the list?
Just remove the comments from those two as well as the other theme apps you flash.
Here's an example, theme ready apps, calendar and keep will be detached.
Code:
Contacts 
Gmail 
Google App 
Google Plus 
Hangouts 
Phone 
Photos 
YouTube 
#Inbox 
#Duo
#Dropbox 
#PushBullet 
Calendar 
Keep 
#Telegram 
#Swiftkey 
#Translate
 

rignfool

Senior Member
Dec 8, 2010
5,010
2,729
253
The Poconos
I have tried installing your script... And no matter how I go about... I cannot get the script to populate the su.d directory like it should...

And... Since I don't understand your flashable... I can't pull what I want out of it...

Could you explain how to install said script without recovery?

Thanks
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone