Hack phone, puppy linux, FreeBSD, memo

This is memo for me. hacking smart phone, puppy linux.
How to copy data on SD in a phone to the other SD in the other phone

These 2 phone are connected with USB cables to mother PC.
After mounting, i tried to copy files from a windown to the other window. But Input Output error caused and I can't do it.

I try to use linux command directly, But I get same errors.

I knew that using dd command to make back up. This way may be available to make copy data to the other SD card directly.

At first, New partitions are made in new SD card. the block size is quite same to the original source. I use fdisk and Gparted.

# dd if=/dev/sdc1 of=/dev/sdh1 bs=1024k
# watch -n 60 pkill -USR1 dd

By the second command, we can know how it is progressing by each 1 minute.

I got input output error.

Input Output error

then changed the option of the command. I'm not sure whether the following command is right.

# dd if=/dev/sdc1 of=/dev/sdh1 bs=1024k skip=7766 conv=sync,noerror

This time, The written partition can't be read. The file system was broken. it seemes mother pc could'nt access to read SD card.

I setted Stay awake option of the phone.

# dd if=/dev/sdj1 of=/dev/sdh1 bs=2048k conv=sync,noerror

i had to change the path of read SD card.

The used size of partitions are different.

| jptreefrog | ST18i | 19:47 | comments(0) | trackbacks(0) | - | - |
how to odex and which file system is better ?
How to DeOdex/Odex any ROM in minutes with Titanium Backup Pro

I have not noticed that TitaniumBackupPro is available to make odex rom.

[Benchmarks] File System Performance: F2FS vs EXT4

I didn't know F2FS is speedy than EXT4. I have used EXT3 mainly for my SD card. But my phone can't detect F2FS partition. So I use EXT4.

| jptreefrog | ST18i | 20:42 | comments(0) | trackbacks(0) | - | - |
21th Feb 2015 stable custom rom for Xperia Ray
I checked XDA rom list for Sony Ericsson Xperia Mini, Mini Pro, Active now. I need not fat JB. I found the following JB roms. I'm not sure whether they are stable. First one is 4.1 and second one is 4.2. Stable KK roms have already made. I didn't know that. I want to try not fat KK. GB's custom rom got high score of benchmark. I don't have good impression for ICS. Good situation afer installed doesn't keep longer. Although I tried a few ICS custom rom. but each rom always use a little cache. I checked the performance of some of them.
  • Sprit: Dalvik:8450/ART:8276/ free memory 87.87 by Antutu benchmark
  • moPROJECT42: 1102/ free memory 271 by Quandrant Standard Edition
  • moAOKP: 1138/ free memory 409 by Quandrant Standard Edition
  • Super Jelly Bean v8: 844/ free memory 339 by Quandrant Standard Edition
  • Slim bean Ray: 1136/ free memory 408 by Quandrant Standard Edition
  • The slimbean 4.0: 1183/ free memory 391

Slim bean Ray works speedy and it has much free ram, and then, The slimbean 4.0 runs smoothly. The wifi works especially well. It has some apps I won't use them. so free memory will increase. I need to write down the link to get the newer version.

| jptreefrog | ST18i | 23:12 | comments(0) | trackbacks(0) | - | - |
V6Supercharger:patching service.jar
[V6U9RC13]For Your Lag(4x) Do it good, Good, GOOD, GOOD! SuperCharge Your Launchaaah!

This time, my installed rom is odex.

At first, V6Supercharger is booted then, chose 27 for to install servicejar.
Then, Phone and pc is connected USB. do along the above link.

The shell script auto patcher doesn't run. it stops with keeping show adb waiting devices.
so I do Manual way.

In linux mother PC

# cd /opt/patch/framework/
# adb pull /system/framework/ ./

This time, my installed rom is SuperleggeraV7 4.0.4. so api level is 15.

# cd ../
# cp framework/services* ./
# java -jar baksmali.jar -x -a 15 -d framework services.odex -o classout
# cd classout/com/android/server/am
# mv ActivityManagerService.smali /opt/patch/
# mv ProcessList.smali /opt/patch/
# ./ALL_ROMS_Ultimate_Jar_Power_Tools-Samali_patcher_RC9.sh
  • choose Die hard launcher
  • Test out Maximum multitasking YES
# mv ActivityManagerService.smali /opt/patch/classout/com/android/server/am
# mv ProcessList.smali /opt/patch/classout/com/android/server/am
# cd /opt/patch/
# java -Xmx512M -jar smali.jar classout -o classes.dex
# mv framework/services.jar ./
# cd ./
# zip services.jar classes.dex
# adb push services.jar /sdcard/
# adb shell
# cd /sdcard
# dexopt-wrapper services.jar services.odex $BOOTCLASSPATH
# ls -l services.odex
# busybox dd if=/system/framework/services.odex of=/sdcard/services.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
# ls -l services.odex
# exit

# adb remount
# adb shell

# cd /system/framework/
# cp /sdcard/services.odex ./
# chown 0.0 services.odex
# chmod 644 services.odex

Then return to V6SuperCharger 27.
Manual Yes. it looks for services.jar on sdcard, then the shell script says install services.jar ?
then answer No. and exit. choose 34 in driver console.
But the service.jar includes classes.dex. I deleted the included classes.dex.

| jptreefrog | ST18i | 11:06 | comments(0) | trackbacks(0) | - | - |
Install SuperleggeraV7

[ROM&KERNEL](RAY ICS) Arcatarc's SuperleggeraV6 L&U_Bootloader

At first, SuperleggeraV6 has been to installed.
The way is different to install custom rom ordinally.
We need backup and install from zip to install this SuperleggeraV6 rom.
After rebooting, go in to CWM recovery, then install update.zip as an update. Ofcourse the update.zip is for SupperleggeraV7.
The update.zip makes a directory "SuperleggeraV6 patch" on sdcard. for Xperia Ray, only Odexer is installed.

How to mount memory ? I have to search it.

Many mods are prepared for SuperleggeraV7.

  • Bravia
  • cybershot
  • AOKP
  • Servicepack

| jptreefrog | ST18i | 20:04 | comments(0) | trackbacks(0) | - | - |

V6 SuperCharger

To run the script, I needed add /system/xbin:/system/bin/:/sbin/ to the path from configuration of SManager. I also had to install zipalign from SuperCharger Starter Kit. It can be gotton from above URL.
Some of configuration should be check each ones. then we can get messages to make weekly routine or widget.

To use Die hard battery calibrator, I saw this page THIS IS ANOTHER WAY OF CALIBRATING BATTERY(im a cm titan w500 user).
It's easy. after charged 100%, with plugging, the script is kicked. then automatic mode is turned on. after 20 minutes, it will complete.

About Service.jar, [RC10] ULTIMATIC RC7T6![EXE]-=Ultimate Jar Power Tools=- w/Maximum MultiTasking Mods!

The full automatic tool didn't work perfectly. when adb connects to phone with this command: adb wait-for-device, it stops.
So, I did this manually. The guide is this. How to.

In my case, Gin2Kitkat rom is installed in my phone. it's deodex. so dexopt-wrapper doesn't needed.
I used patch program ALL_ROMS_Ultimate_Jar_Power_Tools-Smali_Patcher_RC9.sh.pdf. The first line is needed to change to fit own PC's shell.

Then changed the permission to 755.
V6SuperCharger had been activated for these work. services.jar is in phone's /system/framework/
# adb shell
# busybox mount -o remount,rw /system
# cp /system/framework/services.jar /system/framework/services.jar.org
I used adb shell to pick it up. then used baksmali.
# adb pull /system/framework/services.jar ./
# java -jar baksmali.jar -x services.jar -o classout 
# cd classout/com/android/server/am/ActivityManagerService.smali
To patch the above file, the script and the smali file is same directory.
# mv ALL_ROMS_Ultimate_Jar_Power_Tools-Smali_Patcher_RC9 ./
# ./ALL_ROMS_Ultimate_Jar_Power_Tools-Smali_Patcher_RC9
I chose Die-Hard for Launcher and Yes for test out Maximum Multitasking.
I didn't get ProcessList.smali in GB. When I patched services.jar of ICS, I found ProcessList.smali.
Then in case of ICS, we need replacing variables. The following list from this script maker.
System                -16                     (stock)
Persistent Process    -12                     (stock)
ForeGround app          0                     (stock)
Home Launcher           1 (Die-Hard Launcher) (stock=6)
Perceptible app         2                     (stock)
Visible app             3                     (stock=1)
Heavyweight app         4                     (stock=3)
Previous app            5                     (stock=7)
Service                 6                     (stock=5)
Backup app              7                     (stock=4)
Service_b               8                     (stock)
Hidden app min          9                     (stock)
Hidden app max         15                     (stock)
We need to write them in hexadecimal.
In ActivityManagerService.smali
.line 8594
    const-string v0, "    SYSTEM_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/16 v0, -0xf

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8595
    const-string v0, "    PERSISTENT_PROC_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/16 v0, -0xc

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8596
    const-string v0, "    FOREGROUND_APP_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x0

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8597
    const-string v0, "    VISIBLE_APP_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x3

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8598
    const-string v0, "    PERCEPTIBLE_APP_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x2

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8599
    const-string v0, "    HEAVY_WEIGHT_APP_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x4

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8600
    const-string v0, "    BACKUP_APP_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x7

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8601
    const-string v0, "    SERVICE_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x6

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8602
    const-string v0, "    HOME_APP_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x1

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8603
    const-string v0, "    PREVIOUS_APP_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/4 v0, 0x5

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8604
    const-string v0, "    SERVICE_B_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/16 v0, 0x8

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8605
    const-string v0, "    HIDDEN_APP_MIN_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    sget v0, Lcom/android/server/am/ProcessList;->HIDDEN_APP_MIN_ADJ:I

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(I)V

    .line 8606
    const-string v0, "    HIDDEN_APP_MAX_ADJ: "

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const/16 v0, 0xe
In ProcessList.smali
# static fields
.field static final BACKUP_APP_ADJ:I = 0x7

.field static final CONTENT_APP_IDLE_OFFSET:J = 0x3a98L

.field static final EMPTY_APP_IDLE_OFFSET:J = 0x1d4c0L

.field static final FOREGROUND_APP_ADJ:I = 0x0

.field static final HEAVY_WEIGHT_APP_ADJ:I = 0x4

.field static final HIDDEN_APP_MAX_ADJ:I = 0xe

.field static HIDDEN_APP_MIN_ADJ:I = 0x9

.field static final HOME_APP_ADJ:I = 0x1

.field static final MAX_HIDDEN_APPS:I = 0x46

.field static final MIN_CRASH_INTERVAL:I = 0xea60

.field static final MIN_HIDDEN_APPS:I = 0xf

.field static final PAGE_SIZE:I = 0x1000

.field static final PERCEPTIBLE_APP_ADJ:I = 0x2

.field static final PERSISTENT_PROC_ADJ:I = -0xc

.field static final PREVIOUS_APP_ADJ:I = 0x5

.field static final SERVICE_ADJ:I = 0x6

.field static final SERVICE_B_ADJ:I = 0x8

.field static final SYSTEM_ADJ:I = -0xf

.field static final VISIBLE_APP_ADJ:I = 0x3
Next, New dex file was made with smali and classout included patched ActivityManagerService.smali. Back to the directory which includes classout.
# java -Xmx512M -jar smali.jar classout -o classes.dex
then, with zip and unzip, I added new classes.dex to services.jar. services.jar and new classes.dex should be in same directory.
# mkdir pack
# mv service.jar pack
# cd pack
# move services.jar services.zip
# unzip -l services.zip
# zip services.zip -d classes.dex
# mv ../classes.dex ./
# zip services.zip classes.dex
# mv services.zip services.jar
The new services.jar was pushed back to phone.
# adb shell
# mount -o remount,rw /system
# exit
# adb push services.jar /system/framework/
# adb shell
# cd /system/framework/
# chown 0.0 services.jar
# chmod 644 services.jar
At last back to V6SuperCharger, chose 34 SuperClean ( wipe dalvik cache ) and reboot and then 35.
Reboot phone.

| jptreefrog | ST18i | 14:25 | comments(0) | trackbacks(0) | - | - |
Trying some more ROM based on GB
I'm gnoing to try some more ROM. Because I need to keep long battery. Then, I found 2 ROMs based on Gingerbread for that.
  • IlluminativeThis is stock based ROM. Russian developper team made it firstly. it's dieted very much. 3Dcamera work.
  • Gin2kitkatThis one is released at April 2013. it's fresh GB rom.+Lupus GB kernelI found the benchmark of Gin2jellybean and Lupus. it's very high score. Gin2kitkat is new one.
  • I try to use Gin2kitkat + Lupus kernel at first. After flashing boot, the rom is installed in recovery mode. then boot OS and reboot in to recovery mode again. This is the time to install wifi mod !
    | jptreefrog | ST18i | 18:12 | comments(0) | trackbacks(0) | - | - |
    could not be installed free up some space and try again
    I converted system file manager to user app. then I converted user file manager to system file. after rebooting, I can't find the file manager converted to system app. the app is OI file manager. I tried to install it again. But I can't do it. Error message: Could not be installed. free up some space and try again. With Link2SD, my phone has enough free space. What's the problem ? I can't find any things in /data. For these days, my phone's speed becomes slower and slower. I found this topic. "... not enough space to install this item" Fix permission on Rom Manager. boot Rom manager, in advanced menu - wipe Dalvik cache in mounts and format - format cache then reboot. Installing starts but never progress. I try to delete cache of Googla Play and F-droid. but the buttons are disable. I can put delete data buttons. then reboot. I click F-droid, it takes about 5 minutes to prepare. then I install OI file manager again. I see synclonizing icon is status bar. altough I turn off Back ground data and auto synclonize. I got same error OI File Manager could not be installed. Free up some space and try again. in Manage application, I find the app in the last line. then I delete it. I can install OI File Manager at last. But I need root file manager, now. 800MB swap seemes to be too bigger for this android. I found the following topic. Use of swap size while partitioning? Then, depending on it, I try to use 32MB swap file instead of 800MG swap partition. I feel smooth moving of launcher. At last, the partition size is 13G for 1st FAT32, 3G for 2nd ext3.
    | jptreefrog | ST18i | 18:56 | comments(0) | trackbacks(0) | - | - |
    Link2SD versus Link2SD plus
    What's the defference ? The proversion can moved data, too. In that case, 2nd partition of SD card have to be formatted with ext2,ext3,ext4,etc with permission control. used Link2SD free: Internal 22% Free 93.28M SD 51% Free 6G SD 2nd partition 70% Free 1.4G /system 61% Free 246M I installed Link2SD plus then link data of app to 2nd partition. Internal 49% Free 210M SD 51% Free 6G SD 2nd partition 64% Free 1.3M /system 61% Free 246M
    | jptreefrog | ST18i | 20:29 | comments(0) | trackbacks(0) | - | - |
    Partition of SD card
    I installed Link2SD. My first partition of SD card is this. 1st 13G FAT32 2nd 1G FAT32 3rd 130M Linux Swap. Then I think that more swap is needed and 1st partitiion is a little less isn't problem. My new partition of SD card is this. 1st 12G FAT32 2nd 2G ext3 3rd 870M Linux Swap. To move DATA of app on android, 2nd partition is needed to format with ext2, ext3, ext4, etc with permission control. Link2SD needs remaking startup script and rebooting. I used Gparted on Linux to connect to smartphone as storage. It's useful partitionning tool. we can resize the partition not to affect the data inside it.
    | jptreefrog | ST18i | 20:09 | comments(0) | trackbacks(0) | - | - |
    << January 2018 >>
    FreeBSDコマンドブック ビギナーズ
    FreeBSDコマンドブック ビギナーズ (JUGEMレビュー »)
    小野 斉大, 前田 雄一郎, 田谷 文彦, 細川 達己
    SHARP ザウルス SL-C3100
    SHARP ザウルス SL-C3100 (JUGEMレビュー »)

    改訂版 FreeBSD徹底入門
    改訂版 FreeBSD徹底入門 (JUGEMレビュー »)
    衛藤 敏寿, のだ まさひで, 細川 達己, 内川 喜章, 天川 修平, 三田 吉郎, ゆっぴぃ
    FreeBSDビギナーズバイブル (MYCOM UNIX Books)
    FreeBSDビギナーズバイブル (MYCOM UNIX Books) (JUGEMレビュー »)
    後藤 大地
    + MOBILE
    + LINKS