How to move apps from internal to external storage?


Question

I'm trying to move with Lucky Patcher (also with app2sd and Samsung stock app) some apps from internal to external storage, but everytime with every apps movable I got this message:



java.lang.IllegalArgumentException: New installs into ASEC containers no longer supported


I have a Samsung Galaxy S7 with Android 8.0 and root.



Do you now why this happens? Maybe, Android 8.0 doesn't allow anymore this?


Answer

Native app2sd method - which placed encrypted .asec files in .android_secure folder on external SD card - was available only up to Android 5. For details see Why root cannot access “.android_secure” directory on external SD card?



Starting with Marshmallow, the native method of moving apps to external SD card works only if SD card is formatted as Adoptable Storage (1, 2):




ASEC containers have been deprecated since MNC, which is when we
introduced the "adoptable storage" feature. Adoptable storage is a
much better user experience, since we move both the APK and private
app data together as a single unit.




* MNC is Macadamia Nut Cookie; code name for Android Marshmallow (6.x).

And:




new installs into ASEC containers are no longer supported; use adoptable storage instead.




Adoptable Storage is a Full Disk Encrypted SD card, completely managed by vold, not visible to user as external SD card. See here how it differs from traditional Portable Storage. You can format SD card as partially Adoptable and partially Portable too.



Like the pre-Marshmallow app2sd phenomenon (3), apps only with installLocation set to preferExternal or auto in app's manifest are moveable:




Apps can be placed on adopted storage media only when the developer has indicated support through the android:installLocation attribute.




For apps with install location auto, default install location (set using pm set-install-location) decides where app will be installed. See this answer for details.



If you want to move all apps, use a third party solution like Apps2SD or Link2SD.



PS:

An even better approach is to move /data/media instead of apps. Create an extra partition on external SD card and on post-fs-data mount it to /data/media using an init.d script or Android's init service. Other bigger directories /data/app or /data/data can also be moved in the same way.



If you want to keep files encrypted on external SD card, this can be achieved through native methods dm-crypt (Android's FDE) for block device encryption, ecryptfs for stacked filesystem encryption, or third party solution like EncFS for stacked encryption. New native method of filesystem encryption fscrypt (Android's FBE) may also work, but I haven't tried. See details in this answer.






RELATED:




Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes