Archives

All posts for the month July, 2013

These are some of the apps I like.

  • Please don’t ask me for support, these are not my apps. I will not be forwarding support requests to their respective devs. I will also refuse any requests for free paid apps.
  • Some apps require special installation steps, please follow them to the letter.
  • Some apps only work on specific devices, ROMs, or Android versions and most of the following require a rooted device.
  • These are mainly for rooted devices and I’m not listing “fun” apps or “social” apps. Y’all can make your own decisions on those. The links are not necessarily to the free version. Some do have a free version.
  • Titanium Backup – Backs up apps and their data. The best backup solution I have found.
  • Root Explorer – As the name suggests, it’s a file explorer.
  • Greenify – Stops the chosen apps from running in the background.
  • Xposed Framework – Modifies the framework so one can do things. It doesn’t do anything by itself. It just provides a bridge for other people to write modules.
  • Jota Text Editor – A plain text editor that doesn’t truncate large files. Also color codes some scripting/programming languages like PHP and Java.
  • Partition Table – Shows you the exact size of your device’s eMMC partitions.
  • Screen Notification – Turns on the screen when a chosen app adds a notification.
  • Link2SD – Moves APK, DEX, and library files to a second partition on your SD card.
  • FolderMount – Moves data from one folder to another then binds them to trick the system into using the new location. It is intended to move data from the internal SD card to the external SD card as some apps don’t let you chose where you want them to put their shit.
  • ROM Toolbox – Provides a centralized interface for some system tweaks like boot animations and DPI settings.
  • Tasker – Does chosen things when chosen things happen.
  • Nottach – You can change numerous visual settings on the stock ROM. Works only on the SGS4. It was written for AT&T’s variant, but also works on Sprint’s.
  • WiFi ADB – Access ADB over WiFi.
  • Xposed App Settings – Override multiple settings on a per app basis. Settings include font size, DPI, and resolution and you can revoke permissions. You can also get other Xposed modules from this same link.
  • ADBd Insecure – Allows ADB root on stock kernels.
  • File Converter – Convert one type of file to another. E.g. .MPG to .MP3 (rip the audio track).
  • Muti-DPI Play Store – Google has this weird restriction on some apps when the device’s DPI is not stock. This is the workaround. Comes in white (standard) and black (inverted).
  • Wanam Xposed – Like Nottach, but with some other options.

Make ADB localhost Work on Your Jelly Bean 4.2.2 DeviceIn Jelly Bean 4.2.2, ADB now uses RSA keys to explicitly allow certain clients. This poses a problem when attempting to use ADB on your phone locally and the ADB daemon won’t write its RSA key to disk due to the file system being read-only. This is the easiest way to make it work.

Disclaimer: I am not responsible for you doing this wrong and breaking your phone.

This will not work on Android 4.1.2 or older.

  1. Make /data/.android.
  2. Do one of the following:
    1. If you’re using a custom ROM with init.d, put the following into an init.d script.
      #!/system/bin/sh
      if [ ! -e "/.android" ]; then
          busybox mount -o rw,remount /
          mkdir /.android
          mount -o bind /data/.android /.android
          busybox mount -o ro,remount /
      fi
    2. If you have hacked in init.d support by hooking the debuggerd binary, add the script above to your debuggerd script *or* an init.d script.
  3. Reboot the device (if you used option 2 in the previous step, restart the debugger (“stop debuggerd; start debuggerd“)).
  4. After the phone boots completely, check /.android for contents. If it’s empty, restart usb debugging (either from Developer Options (toggle USB Debugging off and back on) or via the command line (“stop adbd; start adbd“)). There should now be stuff in /.android.
  5. Append the contents of /.android/adbkey.pub to /data/misc/adb/adb_keys (“cat /.android/adbkey.pub >> /data/misc/adb/adb_keys; echo “” >> /data/misc/adb/adb_keys“).
  6. Start the ADB server on the phone from the command line using ADB on your PC or a terminal emulator.

    root@android:/ # adb start-server
  7. The phone should pop the authentication dialog – click OK. If the authentication dialog doesn’t pop, follow the striked out steps above.

Edit [08/02/2014]: Turns out two of the above steps aren’t required. Steps amended above.

Notes:

  • Don’t delete /data/.android or the contents therein.
  • Tested on my SGS4 with hacked-in init.d support.
  • You can also find the abdkey.pub file on your Windows’ PC here, C:\Users\[user name]\.android\abdkey.pub. Copy it to your device, then append it to /data/misc/adb/adb_keys and you won’t need to initially use the USB to allow the PC connection.

Before:

root@android:/ # adb shell ls
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device offline
255|root@android:/ #

 

After:

root@android:/ # adb shell ls
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
MSM8960_lpm.rc
acct
cache
carrier
charger
config
d
data
data_1
data_2
data_3
default.prop
dev
efs
etc
extSdCard
file_contexts
firmware
firmware-mdm
fstab.qcom
init
init.carrier.rc
init.goldfish.rc
init.qcom.class_core.sh
init.qcom.class_main.sh
init.qcom.early_boot.sh
init.qcom.lpm_boot.sh
init.qcom.rc
init.qcom.ril.sh
init.qcom.sh
init.qcom.syspart_fixup.sh
init.qcom.usb.rc
init.qcom.usb.sh
init.rc
init.target.rc
init.trace.rc
init.usb.rc
mnt
mnt_1
persdata
preload
proc
property_contexts
res
root
sbin
sdcard
seapp_contexts
sepolicy
storage
sys
system
tombstones
ueventd.goldfish.rc
ueventd.qcom.rc
ueventd.rc
vendor
root@android:/ #

jb-bannerLittle Known Jelly Bean Features

Here are some features in Jelly Bean 4.1.2 and up that I’ve discovered that you may or may not be aware of:

  • Two-finger swipe down on a notification: If it’s expandable it will expand giving you more options. Two-finger swipe up will collapse it.
  • Swip a notification left or right to dismiss it. This does not work on persistent notifications.
  • Long-tap a notification to get a link to “App info” which takes you directly to the app’s info screen where you can uninstall, force-stop, or clear its cache, data, or defaults. Also handy for determining which app put it there.
  • Long-tap the app on the “Recent apps” dialog for the same “App info” link.
  • You can turn off notifications for spammy apps (or any app) from its app info screen. You cannot turn off notifications for some system apps.
  • Long-tap a toggle on the top of the notification pull-down for direct access to that item’s settings screen.
  • Press either volume button to show the volume scale and tap the grey gear to expand it.
  • Tap the grey gear above the toggles on the notification pull-down to access the system settings.
  • Tap the grey clock above the toggles on the notification pull-down to access the world clock.
  • If you have no Search soft-key, you You can long-tap the Menu soft-key to access Search. This only works from the home/launcher screen. May not work in all apps.
  • You can add contacts to the Emergency Dialer by adding them to the “ICE – emergency contacts” contacts group then tap the “+” on the Emergency Dialer. You can add as many contacts as you want to the group; however, you can only add four to the Emergency Dialer at a time (only JB 4.2.2 and up).
  • Easter egg: Jelly Bean Bag. Execute the following from the command line. Root required. This is actually one of the Daydream modes (BeanFlinger) – still cool, though.
    su -c am start com.android.systemui.BeanBag

Note: I have not confirmed that these features are not available on older Android OS’s, they could very well be.

Random Boot Sound Using Notification SoundsPreboot requires init.d. See the OP for enabling it if you are on a stock rooted ROM and requires the file to be readable and executable (“chmod 755” works fine).
Postboot requires an app such as Scripter (ROM Toolbox) or Script Manager to execute the script at boot.

Requires the variable $RANDOM. You can make sure it’s available from the command line (“echo $RANDOM”).

Use this script at your own risk. I provide no warranties or guarantees.

What does this script do?

  1. Check for carrier boot up sounds (sub folders in the “/system/media/audio/ui” folder) and copies them to “/system/media/audio/notifications” renaming them as needed.
  2. Create symlinks in the above folders to “/system/media/audio/ui/PowerOn.ogg”.
  3. Check if “/system/media/audio/notifications/PowerOn.ogg” is present and copies “/system/media/audio/ui/PowerOn.ogg” there if it’s not.
  4. Count the number of files in “/system/media/audio/notifications”.
  5. Grab a random number between 1 and the number of files found inclusive (math notation: “[1, numFiles]”).
  6. Go through “/system/media/audio/notifications” and copy the file at index random to “/system/media/audio/ui/PowerOn.ogg”.

Notes:

  • The stock file is included. If you want a different sound in its place, you can either comment out that line in the script and delete the “/system/media/audio/notifications/_PowerOn.ogg” files from “/system/media/audio/notifications” or just replace “/system/media/audio/notifications/PowerOn.ogg” with some other sound file and still delete the “/system/media/audio/notifications/_PowerOn.ogg” files from “/system/media/audio/notifications”.
  • If you want more sounds, just copy them to “/system/media/audio/notifications” (OGG files only).
  • The script does not check for valid files and blindly renames the destination file to “PowerOn.ogg”.
  • It does not look in “/sdcard/media/audio/notifications” or anywhere else for audio files.
  • I do not recommend using alarms or ringtones files as they are usually looped which can cause the media scanner to get stuck and overheat your phone or tablet – those files may continue to play even if you can’t hear them.
  • If you can’t hear a sound on boot, it is likely that the file is either invalid or has no audio (ex: my /system/media/audio/ui/BST/PowerOn.ogg has no audio).
  • It was tested and works on a Samsung Galaxy S2 (stock JB 4.1.2) and a Samsung Galaxy S4 (stock JB 4.2.2) both from Sprint and using stock kernels.
  • There’s no obvious reason it won’t work on other phones and tablets with other ROMs from other carriers.
#!/system/bin/sh

mount -o remount,rw /system

cd /system/media/audio/ui
for X in "BST" "SPR" "VMU" "XAS"; do
 if [ $(realpath "/system/media/audio/ui/$X/PowerOn.ogg") = "/system/media/audio/ui/$X/PowerOn.ogg" ]; then
  mv "/system/media/audio/ui/$X/PowerOn.ogg" "/system/media/audio/notifications/${X}_PowerOn.ogg"
  ln -s "/system/media/audio/ui/PowerOn.ogg" "/system/media/audio/ui/$X/PowerOn.ogg"
 fi
done

if [ ! -f "/system/media/audio/notifications/PowerOn.ogg" ]; then
 cp "/system/media/audio/ui/PowerOn.ogg" "/system/media/audio/notifications/PowerOn.ogg";
 chmod 644 "/system/media/audio/notifications/PowerOn.ogg"
fi

cd /system/media/audio/notifications
FILES=0
for Y in *; do
 let FILES=$FILES+1;
done

let X=$RANDOM%$FILES
let X=$X+1

FILES=0
for Y in *; do
 let FILES=$FILES+1;
 if [ $FILES = $X ]; then
  cp "/system/media/audio/notifications/$Y" "/system/media/audio/ui/PowerOn.ogg";
  chmod 644 "/system/media/audio/ui/PowerOn.ogg"
 fi
done

mount -o remount,ro /system

Creative use of ADBInstall an app onto one device (B) from another device (A) using your computer.

  • Rooted Android Devices:
    • Enable ADB over wifi.
  • Windows PC:
    • Go to Android SDK folder
    • Connect to device A (adb connect [ip address]:[port]).
    • Access the shell and “su” to root (adb -s [ip address]:[port] shell).
  • Device A (still using Windows’ command prompt):
    • Connect to device B (adb connect [ip address]:[port]).
    • Install app to device B (adb -s [ip address]:[port] install /data/app/[app’s file name]).
  • Device B:
    • Check applications for your newly installed app.
    • Enjoy running your newly installed app.
C:\android-sdk\platform-tools>adb connect 192.168.1.6:5555
connected to 192.168.1.7:5555
C:\android-sdk\platform-tools>adb -s 192.168.1.6:5555 shell
shell@android:/ $ su
su
root@android:/ # adb connect 192.168.1.7:5555
connected to 192.168.1.7:5555
root@android:/ # adb -s 192.168.1.7:5555 install /data/app/com.electricsheep.asi-1.apk
405 KB/s (478636 bytes in 1.151s)
        pkg: /data/local/tmp/com.electricsheep.asi-1.apk
Success
root@android:/ #