FORUMS
Remove All Ads from XDA

[MOD][XPOSED] Pictures2SD (v1.0.7) - makes Camera/Focal store photos on external SD

478 posts
Thanks Meter: 600
 
Post Reply Email Thread
This mod makes Camera and Focal apps to save pictures/videos to external SD card.

Currently this mod may not work on some Android 4.4 ROMs. Support for wider range of Android 4.4 ROMs most likely will be added in future.

Technically it works by attaching to Camera, Focal and some other apps (for full list see below), hooking getExternalStorageDirectory() and getExternalStoragePublicDirectory() Android system methods and making them return path to external SD card (first colon separated part of SECONDARY_STORAGE environment variable). Simply saying - this mod makes Camera and Focal apps to treat external SD card as internal.

Pictures2SD usually doesn't affect Camera applications that have built-in ability to save pictures/videos to external SD card.

This mod requires Xposed framework to be set up and Pictures2SD enabled as Xposed module.
Disclaimer: I am not responsible for anything that may happen as a result of using this mod.


I will be glad to hear any reviews (please also provide information on what ROM the mod was tested).

Pictures2SD has been tested on Samsung Galaxy S3 running CM 10.2.0 (actually it was created for CM 10.2 nightlies). If this mod doesn't work on your device/ROM, please follow tips in troubleshooting section to report the issue.

Full list of supported apps (and package names):
* Camera (com.android.gallery3d, com.google.android.gallery3d, com.android.camera2, com.google.android.GoogleCamera)
* Focal (org.cyanogenmod.focal, fr.xplod.focal)
* Snapseed (com.niksoftware.snapseed)
* Instagram (com.instagram.android)
* PixtoCam (com.pixtogram.wear.zicam)

Changelog:
v 1.0.7
* Added support for PixtoCam ("com.pixtogram.wear.zicam").
* Code refactoring.
* Improved APK size (by removing unused v4 Support Library).
* Made open-source.
v 1.0.6
* Added support for Instagram ("com.instagram.android") due to user's request.
v 1.0.5
* Added support for KitKat camera ("com.android.camera2" and "com.google.android.GoogleCamera").
v 1.0.4 (unreleased)
* Added support for Snapseed ("com.niksoftware.snapseed") due to user's request.
v 1.0.3
* Added support for new package name of Focal ("fr.xplod.focal").
v 1.0.2
* Fixed compatibility with ROMs having Camera package name "com.google.android.gallery3d".
v 1.0.1
* Fixed compatibility issues with ROMs having more than one secondary storage.
v 1.0
* Initial release.

Troubleshooting steps:
1. Check whether Camera app of your ROM supports storing pictures on external SD card out of the box (usually this can be enabled under Settings -> More Options -> Storage). If there is such an option, there is no need to use Pictures2SD (except for third party applications).
2. Open Xposed Installer and ensure that Xposed framework is installed and Pictures2SD is enabled as Xposed module. Please note, that after installing Xposed framework or enabling Xposed module it is required to reboot the device.
3. If Pictures2SD still doesn't work, please reproduce the problem, and post in this thread (along with description of the problem) name/model of your device, name of ROM it is running (if possible also link where the ROM was downloaded) and output of the following commands
Code:
su
mount
logcat -d | grep Pictures2SD
echo $SECONDARY_STORAGE
Xposed Module Repository page:
http://repo.xposed.info/module/lv.id.dm.pictures2sd

Download:
Attached Files
File Type: apk Pictures2SD_107.apk - [Click for QR Code] (34.0 KB, 2532 views)
The Following 80 Users Say Thank You to DavisNT For This Useful Post: [ View ]
 
 
17th August 2013, 05:59 AM |#2  
Member
Thanks Meter: 27
 
More
Worked for me with 4.2 camera and with focal on my note 2 running slim rom

Sent from my SPH-L900 using Tapatalk 4
The Following User Says Thank You to kroewe For This Useful Post: [ View ] Gift kroewe Ad-Free
17th August 2013, 09:13 PM |#3  
I[E's Avatar
Senior Member
Thanks Meter: 32
 
More
SGS4 running 8/16 build of CM 10.2 I get the following:

Gallery version 1.1.40012

Sent from my SGH-M919 using Tapatalk 4
17th August 2013, 10:02 PM |#4  
DavisNT's Avatar
OP Recognized Developer
Flag Riga
Thanks Meter: 600
 
Donate to Me
More
Quote:
Originally Posted by I[E

SGS4 running 8/16 build of CM 10.2 I get the following:


Gallery version 1.1.40012

Sent from my SGH-M919 using Tapatalk 4

Can you please execute the following commands after opening camera and post output here (or send me via PM)?
Code:
su
mount
logcat -d | grep Pictures2SD
echo $SECONDARY_STORAGE
17th August 2013, 10:35 PM |#5  
I[E's Avatar
Senior Member
Thanks Meter: 32
 
More
Code:
127|root@android:/ # logcat -d|grep Pictures2SD
I/Pictures2SD(19291): Loaded camera package com.android.gallery3d
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStoragePublicDirectory("DCIM") will return /storage/sdcard1:/storage/usbdisk0/DCIM
[1] + Done (255)           logcat -d |
      Done (127)           grepPictures2SD
root@android:/ # echo $SECONDARY_STORAGE
/storage/sdcard1:/storage/usbdisk0
Sent from my SGH-M919 using Tapatalk 4
The Following User Says Thank You to I[E For This Useful Post: [ View ] Gift I[E Ad-Free
17th August 2013, 11:34 PM |#6  
ruvort's Avatar
Senior Member
Thanks Meter: 413
 
More
Quote:
Originally Posted by DavisNT

Can you please execute the following commands after opening camera and post output here (or send me via PM)?

Code:
su
mount
logcat -d | grep Pictures2SD
echo $SECONDARY_STORAGE

I have the same issue. Pacman rom sgs3.

Code:
u0_a48@android:/ $ su
u0_a48@android:/ # mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
tmpfs /storage tmpfs rw,relatime,mode=050,gid=1028 0 0
tmpfs /storage/emulated tmpfs rw,nosuid,nodev,relatime,mode=050,gid=1028 0 0
/dev/block/vold/179:33 /storage/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
/dev/block/dm-0 /mnt/asec/com.blackout1911.theme.BlackedOutTheme-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-1 /mnt/asec/com.ryanmkelly.me.flatro-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-2 /mnt/asec/com.keramidas.TitaniumBackupPro-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-3 /mnt/asec/com.oasisfeng.greenify.pro-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-4 /mnt/asec/com.gau.go.launcherex.theme.smplwhite-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-5 /mnt/asec/biz.bokhorst.xprivacy.pro-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-6 /mnt/asec/com.bubblesoft.android.bubbleupnp.unlocker-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/fuse tmpfs rw,relatime,mode=775,gid=1000 0 0
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/efs /efs ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,discard,journal_checksum,journal_async_commit,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,relatime,fmask=0177,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/0/Android/obb fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /storage/emulated/legacy/Android/obb fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
u0_a48@android:/ # logcat -d | grep Pictures2SD
D/Pictures2SD( 4294): getExternalStorageDirectory() will return /storage/sdcard1
u0_a48@android:/ # echo $SECONDARY_STORAGE
/storage/sdcard1
u0_a48@android:/ #
Huge Wallpaper Collection
18th August 2013, 01:12 AM |#7  
DavisNT's Avatar
OP Recognized Developer
Flag Riga
Thanks Meter: 600
 
Donate to Me
More
New version (with bugfix) released.

Quote:
Originally Posted by I[E

Code:
127|root@android:/ # logcat -d|grep Pictures2SD
I/Pictures2SD(19291): Loaded camera package com.android.gallery3d
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStorageDirectory() will return /storage/sdcard1:/storage/usbdisk0
D/Pictures2SD(19291): getExternalStoragePublicDirectory("DCIM") will return /storage/sdcard1:/storage/usbdisk0/DCIM
[1] + Done (255)           logcat -d |
      Done (127)           grepPictures2SD
root@android:/ # echo $SECONDARY_STORAGE
/storage/sdcard1:/storage/usbdisk0
Sent from my SGH-M919 using Tapatalk 4

This should be fixed in new version (1.0.1).
Could you please test it?
18th August 2013, 01:25 AM |#8  
DavisNT's Avatar
OP Recognized Developer
Flag Riga
Thanks Meter: 600
 
Donate to Me
More
Quote:
Originally Posted by ruvort

I have the same issue. Pacman rom sgs3.

According to output of commands you shouldn't have issue when no sdcard is detected. Can you please post screenshot and ROM download URL?
18th August 2013, 02:02 AM |#9  
drivel2787's Avatar
Senior Member
Thanks Meter: 77
 
More
Forced closes on focal and camera

Cm 10.2 based Quantum Rom.


1.1.40012

Sent from my sexy Android 4.3 thanks PWNCAKES
18th August 2013, 02:35 AM |#10  
I[E's Avatar
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by DavisNT

New version (with bugfix) released.


This should be fixed in new version (1.0.1).
Could you please test it?

Both camera and focal are saving to the external SD card.

Sent from my SGH-M919 using Tapatalk 4
18th August 2013, 10:24 AM |#11  
seavers11's Avatar
Senior Member
Thanks Meter: 235
 
More
Works for me Note 2 with Slimbean 4.3 beta2

Gesendet von meinem GT-N7100 mit Tapatalk 4
The Following 2 Users Say Thank You to seavers11 For This Useful Post: [ View ] Gift seavers11 Ad-Free
Post Reply Subscribe to Thread

Tags
camera, cm 10.2, focal, xposed, xposed module

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes