Modding odex'ed framework files - Galaxy S III General

hi.. ive been having trouble trying to odex a modded andriod.policy.jar .. i keep getting bootloops
so im kind of desperate for help right now
currently im just uploading my modified android.policy.jar and running these commands
dexopt-wrapper <source jar> <target odex> $BOOTCLASSPATH
busybox dd if= <original odex> of=<target odex> bs=1 count=20 skip=52 seek=52 conv=notrunc
what am i doing wrong?
im getting repeating bootloops with something about bad dependencies etc...
i must be doing SOMETHING wrong here.. but i just cant figure it out !
any help would be appreciated...

Here is a thread that helped me re-odex modes deodex files without an issue http://forum.xda-developers.com/showpost.php?p=16447676&postcount=1 very helpful thread.

Tenacius D said:
Here is a thread that helped me re-odex modes deodex files without an issue http://forum.xda-developers.com/showpost.php?p=16447676&postcount=1 very helpful thread.
Click to expand...
Click to collapse
Nice post. Bookmarked
Thank you.
Sent from my Galaxy S3

no joy.. still same issue , this is what logcat is giving me :
D/dalvikvm( 2084): DexOpt: incorrect opt magic number (0xf6 0e 49 19)
E/dalvikvm( 2084): /system/framework/android.policy.jar odex has stale dependencies
I/dalvikvm( 2084): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
D/dalvikvm( 2084): Unable to process classpath element '/system/framework/android.policy.jar'
I/SurfaceFlinger( 2083): EventThread ready to run.
I/dalvikvm( 2084): DexOpt: Some deps went away
E/dalvikvm( 2084): /system/framework/services.jar odex has stale dependencies
I/dalvikvm( 2084): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
D/dalvikvm( 2084): Unable to process classpath element '/system/framework/services.jar'
D/WVMDrmPlugIn( 2086): WVMDrmPlugin:nGetSupportInfo : 0
E/Trace ( 2083): error opening trace file: No such file or directory (2)
I/SurfaceFlinger( 2083): id=1(1) createSurf 0x40daff24 (720x1280),4 flag=0, =pid_2441>
I/dalvikvm( 2084): DexOpt: Some deps went away
E/dalvikvm( 2084): /system/framework/apache-xml.jar odex has stale dependencies
I/dalvikvm( 2084): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
D/dalvikvm( 2084): Unable to process classpath element '/system/framework/apache-xml.jar'
D/ICD ( 2092): icd (1)
I/dalvikvm( 2084): DexOpt: Some deps went away
E/dalvikvm( 2084): /system/framework/sec_edm.jar odex has stale dependencies
I/dalvikvm( 2084): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
D/dalvikvm( 2084): Unable to process classpath element '/system/framework/sec_edm.jar'

Well not sure what's wrong there do you have any errors during re-odexing.

none.. it reodex'es even to the same size as the original.. i just get this message no matter what i do..

Is the BOOTCLASSPATH correct?
This BOOTCLASSPATH is from s3 init.rc file
Code:
/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar

this is my current bootclasspath :
Code:
echo $BOOTCLASSPATH
/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bo
uncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system
/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework
/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/sy
stem/framework/seccamera.jar
this is the result from trying to odex android.policy.jar :
Code:
--- BEGIN '/system/framework/android.policy.jar' (bootstrap=0) ---
--- waiting for verify+opt, pid=28455
--- would reduce privs here
--- END '/system/framework/android.policy.jar' (success) ---
C:\apk_tools>CALL adb shell busybox dd if=/sdcard/original_framework/android.policy.odex of=
/system/framework/android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
20+0 records in
20+0 records out
20 bytes (20B) copied, 0.005834 seconds, 3.3KB/s
so far i tried
Code:
dexopt-wrapper <source> <target> /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar
Code:
dexopt-wrapper <source> <target> $BOOTCLASSPATH
Code:
dexopt-wrapper <source> <target>
same error.. nothing seems to work BUT restoring the original android.policy.odex that came with the rom..
i also tried deodexing the android.policy.odex then reodexing it, same thing... something is missing here and i cant figure out what..

Everything is looking as it should so really dont know where is the issue here.

hey just got on a pc
in this step
Code:
C:\apk_tools>CALL adb shell busybox dd if=/sdcard/original_framework/android.policy.odex [COLOR="Red"]of=
/system/framework/android.policy.odex[/COLOR] bs=1 count=20 skip=52 seek=52 conv=notrunc
20+0 records in
20+0 records out
20 bytes (20B) copied, 0.005834 seconds, 3.3KB/s
is the patched odext file that was created with first command in this command of=
/system/framework/android.policy.odex
if yes did you tray doing this on a phone without renaming anything or transferring from a phone.

yes, also nothing was transferred / renamed..
im going nuts here !

Maybe trying this command
Code:
dexopt-wrapper /system/framework/XXX.jar customjar.odex /system/framework/patched_XXX.odex $BOOTCLASSPATH
insted of this command
Code:
dexopt-wrapper /system/framework/android.policy.jar /system/framework/patched_android.policy.odex /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar
If that don't work then i don't know what else to tray.

SabrWolf said:
yes, also nothing was transferred / renamed..
im going nuts here !
Click to expand...
Click to collapse
for the last command cud you tray running this
C:\apk_tools>CALL adb shell busybox dd if=/sdcard/original_framework/android.policy.odex of=
/system/framework/patched_android.policy.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
and now file named patched_android.policy.odex is your patched file just remove patched_ from file name and it shod work.

Related

apps on sdcard -- can't install apps anymore

I'm having a strange problem. I'm trying to update a few apps and I keep getting errors. I have a rooted RC33 and I have the apps on /system/sd/app.
It looks like I have space:
Code:
# busybox df -h
busybox df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 48.4M 0 48.4M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock3 67.5M 67.2M 284.0K 100% /system
/dev/block/loop0 1.5M 1.5M 0 100% /system/modules
/dev/block/loop1 3.1M 3.1M 0 100% /system/xbin
/dev/mmcblk0p2 1.0G 63.1M 913.9M 6% /system/sd
/dev/block/mtdblock5 74.8M 60.1M 14.7M 80% /data
/dev/block/mtdblock4 67.5M 1.4M 66.1M 2% /cache
/dev/block/mmcblk0p1 6.4G 4.6G 1.8G 73% /sdcard
#
Most apps seem to install OK, but there are a few I've tried to install today (qsearch, mybackup, quickoffice) that give me errors. It will say install unsuccessful and the error is either "insufficient storage available" (which seems odd) or "could not delete old application" (which also seems strange).
Any ideas? I'm stumped.
And yes, I've rebooted several times.
Thanks
P.S. Is it normal that my /data/app-private is empty? I just noticed that...
Oh, also, here's the debug log:
Code:
D/PackageParser( 58): Scanning package: /data/app/vmdl23451.tmp
W/PackageManager( 58): Package source /data/app-private/com.qo.android.am.apk does not exist.
I/installd( 37): unlink /data/dalvik-cache/[email protected]@[email protected]
D/dalvikvm( 58): GC freed 15380 objects / 698304 bytes in 442ms
I/vending ( 483): com.android.vending.AssetDownloader$DownloadManagerBroadcastReceiver$MyPackageInstallObserver.packageInstalled(): Package install from content://downloads/download/336 failed: Could not delete old application.
-- more info --
So I tried chmod 777 app-private and then created an empty file com.qo.android.am.apk since that is what it was complaining about. Then I tried installing again. The debug log shows:
Code:
D/PackageParser( 58): Scanning package: /data/app/vmdl23453.tmp
D/PackageManager( 58): Scanning package com.qo.android.am
I/PackageManager( 58): /data/app/vmdl23453.tmp changed; unpacking
D/installd( 37): DexInv: --- BEGIN '/data/app/vmdl23453.tmp' ---
D/dalvikvm( 1564): DexOpt: load 541ms, verify 2688ms, opt 214ms
D/installd( 37): DexInv: --- END '/data/app/vmdl23453.tmp' (success) ---
D/PackageManager( 58): Services: com.qo.android.quickoffice.NotifyingService com.qo.android.ipc.RemoteServiceQW com.qo.android.ipc.RemoteServiceQS
D/PackageManager( 58): Receivers: com.qo.android.quickoffice.MyStartupIntentReceiver
D/PackageManager( 58): Activities: com.qo.android.quickoffice.NotifyingDialogActivity com.qo.android.am.Quickoffice com.qo.android.quickoffice.Quickoffice com.qo.android.am.EulaActivity com.qo.android.quicksheet.Quicksheet com.qo.android.quickword.Quickword
I/installd( 37): move /data/dalvik-cache/[email protected]@[email protected] -> /data/dalvik-cache/[email protected]@[email protected]
E/PackageManager( 58): Couldn't move package file to: /data/app-private/com.qo.android.am.apk
I/installd( 37): unlink /data/dalvik-cache/[email protected]@[email protected]
W/PackageManager( 58): Package source /data/app-private/com.qo.android.am.apk does not exist.
D/PackageManager( 58): Removing package com.qo.android.am
D/PackageManager( 58): Services: com.qo.android.quickoffice.NotifyingService com.qo.android.ipc.RemoteServiceQW com.qo.android.ipc.RemoteServiceQS
D/PackageManager( 58): Receivers: com.qo.android.quickoffice.MyStartupIntentReceiver
D/PackageManager( 58): Activities: com.qo.android.quickoffice.NotifyingDialogActivity com.qo.android.am.Quickoffice com.qo.android.quickoffice.Quickoffice com.qo.android.am.EulaActivity com.qo.android.quicksheet.Quicksheet com.qo.android.quickword.Quickword
D/ActivityManager( 58): Uninstalling process com.qo.android.am
I/vending ( 483): com.android.vending.AssetDownloader$DownloadManagerBroadcastReceiver$MyPackageIns
tallObserver.packageInstalled(): Package install from content://downloads/download/338 failed: Insufficient storage available.
At this point, I am getting the insufficient space message (as shown in the log). Previously, I was getting the could not delete app message (as shown in the log above this one).
I get this error occasionally too... I don't know why it happens, but it's usually for protected apps.
EDIT: Also, I have my /data/app folder on an ext2 partition on my miccroSD card, but the app-private remains on the phone. I don't know what's going on... I want to buy dxTop, but I don't think that it will install...
I got the same error while trying to install parkmark free. I've been contemplating moving everything back to the phone to install and then move them back to the SD. PITA but I would like to nab it before it is no longer available.
Blarg -- there must be a way, no? Maybe they got smart and are checking to see if /data/app is a symlink? JesusFreke, help us!
It's happening for every protected app which gets installed in the /data/app-private directory...
I don't get it though. I haven't even touched that folder. I've just symlinked /data/app to /system/sd/app
amgupt01 said:
It's happening for every protected app which gets installed in the /data/app-private directory...
I don't get it though. I haven't even touched that folder. I've just symlinked /data/app to /system/sd/app
Click to expand...
Click to collapse
Same here -- that's the only symlinking I did (well, aside from the caches).
I wonder if un-symlinking the apps dir (putting it back to "normal"), installing and then re-symlinking (and copying the new stuff) would work. Does that seem risky? So maybe something like:
Temporarily rename the symlink to app.DISABLED
Create a new app directory (a "real" directory)
Install the new app(s)
Copy whatever is in the new ("real") app directory to the symlinked (now named "app.DISABLED") directory
Remove the "real" app directory and rename the symlink back to app
I'm just wondering if it is dangerous to rename the app directory while apps may be running as suddenly they won't be able to find themselves and that could upset things.
I'll try that. If it works, I'll make a GScript out of it and I'll post the two .sh scripts (one for before installing, one for after) here.
amgupt01 said:
I'll try that. If it works, I'll make a GScript out of it and I'll post the two .sh scripts (one for before installing, one for after) here.
Click to expand...
Click to collapse
I got bold and tried it and it worked (I did get a few errors about some apps force-closing because I moved directories around). Here's what I did:
cd /data
mv app app.SDCARD
mkdir app
chmod 771 app
chown 1000:1000 app
Went to Market and installed the app that wouldn't install earlier
busybox cp -a app/* /system/sd/app
mv app app.ORIGINAL
mv app.SDCARD app
Voila! My newly installed app works. A reboot should resolve any background apps (like the caller-ID app) that were running while I moved the directories.
If you wanna make some scripts out of that, I'm sure it would help others. A quick "run this" then install then "run that" kind of operation.
EDIT: That worked for a new app. To replace an existing app, I had to do this:
Code:
busybox cp -a /system/sd/app/<old-app> /data/app
before updating so that it could delete the old app. That worked for a replacement (update).
mlevin said:
Blarg -- there must be a way, no? Maybe they got smart and are checking to see if /data/app is a symlink? JesusFreke, help us!
Click to expand...
Click to collapse
I'm wondering if they are checking to see if /data/app is a symlink -- or maybe if /data/app and /data/app-private are on the same filesystem (which could be solved by moving both app and app-private over to the card). Hmm...
I'll try putting app-private to SD card...
EDIT: ARE YOU KIDDING ME? Every single app that wasn't working before, is now working once I moved the app-private to /system/sd as well...
I feel retarded.
amgupt01 said:
I'll try putting app-private to SD card...
EDIT: ARE YOU KIDDING ME? Every single app that wasn't working before, is now working once I moved the app-private to /system/sd as well...
I feel retarded.
Click to expand...
Click to collapse
Wow. That was easy. I'll do that on mine as well. Cool.
EDIT: Yup, after symlinking and a quick reboot, that worked for me as well!
HELP PLEASE:
Cant update or download new apps from market to SD card.
I can only download & update apps on internal storage and then move them to SD... But If I have app on SD I cannot update or install app.. I always get - Installation Unsuccessful
I am using Leedroid NOA2SD 2.4.1. Tried to format SD card, unmount and mount SD.. nothing helps.
Titanium Backup:
Internal: 23 MB free
SD card: 1.29 GB free
SD card (a2sd): 1.90 MB free
Can you help me with any idea?
Tnx
I have a log file but I cant send it :|

Need Dump of /sbin

I'm trying to get the FM radio working (if the hardware is there) on the Captivate, whenever I attempt to install the FMRadio.apk I get a /sbin/sh: pm: not found. Could someone pull the /sbin directory off of the I9000 and upload it? Thanks.
There is no /sbin/sh there is however an sh file in /system/bin
pulled it all anyway.
cant post links sorry
mega upload com /?d=0LCR05GJ
Excellent!!!! for those of you who get ActivityManager: /sbin/sh: am: not found just do cp /system/bin/sh /sbin in adb

[ADDON][NDK] Built the Android NDK for Android. Want to port a lot of GNU tools.

Hi,
For description, look here http://my-android-travels.blogspot.com/2012/02/android-build-system-ndk-toolchain.html and here http://my-android-travels.blogspot.com/2012/02/android-build-system-ndk-toolchain_21.html
https://docs.google.com/open?id=0B2qClbkV-4gpYWY5ZTE5NWYtYmU0ZC00MTAzLWIwN2MtNjQ4YTZmNzgyNTZj
Just place it on your sdcard, su, cd /, tar xzf /mnt/sdcard/ndk.tar.gz
When done, you find it in /data/local
I'm searching for people which wants to help me port in the first step the whole tools known as build-essential in debian. In a second step apt. If you are seeing yourself doing that, have the needed knowledge or the will to learn, please pm me
Have Fun
Ralph
I tried your NDK build on a 2.2 device (a Toshiba AC100) but, I run into a weird error when I try to run some of the executables:
Code:
/storage/home/t/data/local/bin $ file ./ar
./ar: symbolic link to `arm-linux-androideabi-ar'
/storage/home/t/data/local/bin $ ls -l ./arm-linux-androideabi-ar
-rwxr-xr-x 2 10035 10035 651482 Feb 20 20:47 ./arm-linux-androideabi-ar
/storage/home/t/data/local/bin $ file ./arm-linux-androideabi-ar
./arm-linux-androideabi-ar: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=0x5ee70e99463cef4692571cb07050ebf3819024ad, not stripped
/storage/home/t/data/local/bin $ strace ./arm-linux-androideabi-ar
execve("./arm-linux-androideabi-ar", ["./arm-linux-androideabi-ar"], [/* 16 vars */]) = -1 ENOENT (No such file or directory)
write(2, "strace: exec: No such file or dir"..., 40) = 40
exit(1) = ?
I cannot figure out why the command fails to run , and I'm hoping that you can help me out here,
try it on an android 4
also be sure that its located on an ext partition. put it into /data/local
Hi Ralph,
I'm running the binaries off an ext4 partition (and tried it from /data/local path(/data is ext4), as per the instructions). However, I don't have the luxury of using ICS. I'm stuck on FroYo as Toshiba no longer provides updates for my device , and doesn't release the sources either .
Could you give me some insight on why the binary will run on ICS, yet fail on FroYo?
Code:
/storage/home $ cd /data/local/bin/
/data/local/bin $ for i in arm-* ; do echo ------$i------- ; $i --help >/dev/null ; done
------arm-linux-androideabi-c++-------
------arm-linux-androideabi-cpp-------
------arm-linux-androideabi-g++-------
------arm-linux-androideabi-gcc-------
------arm-linux-androideabi-gcc-4.4.3-------
------arm-linux-androideabi-gcov-------
------arm-linux-androideabi-gdb-------
Segmentation fault
------arm-linux-androideabi-run-------
Segmentation fault
------arm-linux-androideabi-addr2line-------
sh: arm-linux-androideabi-addr2line: not found
------arm-linux-androideabi-ar-------
sh: arm-linux-androideabi-ar: not found
------arm-linux-androideabi-as-------
sh: arm-linux-androideabi-as: not found
------arm-linux-androideabi-gccbug-------
sh: arm-linux-androideabi-gccbug: not found
------arm-linux-androideabi-gprof-------
sh: arm-linux-androideabi-gprof: not found
------arm-linux-androideabi-ld-------
sh: arm-linux-androideabi-ld: not found
------arm-linux-androideabi-nm-------
sh: arm-linux-androideabi-nm: not found
------arm-linux-androideabi-objcopy-------
sh: arm-linux-androideabi-objcopy: not found
------arm-linux-androideabi-objdump-------
sh: arm-linux-androideabi-objdump: not found
------arm-linux-androideabi-ranlib-------
sh: arm-linux-androideabi-ranlib: not found
------arm-linux-androideabi-readelf-------
sh: arm-linux-androideabi-readelf: not found
------arm-linux-androideabi-size-------
sh: arm-linux-androideabi-size: not found
------arm-linux-androideabi-strings-------
sh: arm-linux-androideabi-strings: not found
------arm-linux-androideabi-strip-------
sh: arm-linux-androideabi-strip: not found
/data/local/bin $ mount |grep data
/dev/block/mmcblk3p5 on /data type ext4 (rw,nosuid,nodev,relatime,barrier=1,data=ordered)

[GUIDE] LogStructuredFileSystem SuperThread (nilfs2,f2fs)

Disclaimer, apply the following at your own risk, I plan to test most if not all of what I post but can't guarantee that you will not cause damage or lose data, and if you do I take no responsibility, that being said it is a simple adaption to current installations.
This is in no way (currently) a replacement for ext4 (or NAND), and shouldn't be seen as a replacement for NativeSD (I'm just piggybacking of their installation zips) compatibility across the board just isn't good enough yet.
Mark 1 - Nilfs2
Code:
Nilfs2 should be good as a replacement for lower class cards and may show a speed improvement on class 2/4 cards. If your installing on a fresh card and have the means to use nilfs2 then please try before/after using ext4 and report back your findings. Any requests for things currently using ext4 will be looked at to make them compatible with nilfs2 if possible.
[B]Partition creation[/B]
Currently only via a Linux OS, will try and trick a recovery to create a nilfs2 instead of ext but no promises
[I]Method 1. Terminal[/I][CODE]sudo apt-get install nilfs-tools
sudo mkfs -t nilfs2 /dev/sdc2
Changing sdc2 to the partition thats to be formatted, look in gparted to be sure your formatting the correct one
Method 2. Disk Utility
You can use Disk Utility from within a LinuxOS
Method 3. Gparted live
Partition creation should be possible using a gparted live usb or cd
Method 4. On device
Copy mkfs.nilfs2 binary to /system/xbin
duplicate fstab renaming to mtab
sudo mkfs.nilfs2 /dev/block/mmcblk0p2
ROM Modifications
Currently, starting with a NativeSD zip as a base only need to alter the install.sh and modify a few lines within the init (within /kernel/bootsd/initrd.gz)
INSTALL.SH
Code:
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
change to
mount -t nilfs2 /dev/block/mmcblk0p2 /ext4p
INIT
Code:
mkdir -p /NativeSD
mount -t ext4 -o rw,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD
change to
mkdir -p /NativeSD
mkdir -p /nilfs
mount -t nilfs2 /dev/block/mmcblk0p2 /nilfs
mount -t nilfs2 -o rw,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD
ROM Installation
Installation confirmed working via CWM, and modified 4ext (recoverymod) (will need to test others)
After Install modifications
Download Nilfs2.zip from #2 , using a root browser or adb copy the system folder to / (thus adding the folders /files to /system). Then need to change permissions of /system/xbin/nilfs_cleanerd , /system/etc/nilfs_cleanerd.conf and /system/etc/init.d/04nilfs to 755 (permissions required will probably change at some point)
Backup
Backup of NILFS2 partition can be done by CWM but only if android is also in NAND as it needs to backup the whole system.
REQUEST: Help from any one who has experience with NiLFS2, and ideally people who have gotten the cleaner to run properly, I'm sure it ran correctly several times, but can't as yet recreate how I got it to work. Let me know if you think you can help [/COLOR][/B]
User Experience
Xylograph's user experience and benchmark NAND / EXT4 / NiLFS2
AnTuTu and Androbench benchmarks[/CODE]
F2FS
Code:
[SIZE="2"][B]Partition creation[/B]
[I][B]Linux only[/B][/I]
Download [URL="http://sourceforge.net/projects/f2fs-tools/"]f2fs tools[/URL] and extract,
cd into folder and run the following[CODE]autoreconf --install
sudo chmod +x configure
sudo ./configure
sudo make
sudo make install
Now you can format:
Code:
sudo umount /dev/sdd1
sudo mkfs.f2fs /dev/sdd1
[/SIZE][/CODE]
To do list
Tidy up the Aroma installer to say nilfs2 instead of ext
Modify a recovery (needed still???)
Modify installer to allow NAND/ext4/nilfs2 installation
Optimize init.d script
Optimize init mounts
Possible beneficial references from across the web
NiLFS website
Not sure if ext4 would have the same problem as ext2
Btrfs
Kernel updates??
Credits / Thanks
Unhelpful for the nilfs2 binaries
Xylograph and securecrt for NativeSD Installation method
ROM devs. (Updated as ROM diffs. added)
Xylograph for AOKP, PA, CyanX
Smokin901 for MIUI
Tytung for Nexus-HD2
Rick1995 for BareBones CM7
Kernel devs.
Securert
Tytung
NILFS2 SuperThread
Will fill this out in due course,
New setup, with sdcard partitions being FAT32 / EXT4 / ANY
requirement for different ROMs should be just the initrd and to change rom_name in a few files.
First change build is on post 34
Fyi. it would be relatively simple to change it to FAT32 / ANY / ANY so if you don't want an additional partition using two (fat32/nilfs2) shouldn't be a problem.
Attached is the different installer files, should be self explanitory, really just need the NAND_ANY_ANY one, but there you go.
NAND_ANY_ANY is the only one without included initrd.gz's, will eventually add a readme detailing what you need to change in the zip, for installing other ROMs and attach a list of initrd's for different roms and partition types / locations
ROM diff files attached, edit the files in the relevant NativeSD zips. And install via recovery.
Have modified securecrt's diff file for BBCM7 - although am having some issues wouldn't advise its use (yet) DON'T USE BBCM7
General
The nilfs2 mounts with the general mount script mount and not the mount.nilfs2.
Need reports on any settings that should help the system; for example noop seems to be the best i/o scheduler for me but have no confirmation from others
Attached Files
ROM 7zip files contain the different files from there corresponding NativeSD zip
All bins and .conf that I've found can be found in nilfs.7z
Nilfs2.zip contains the 3 files needed for the cleaner to work, just copy system over using a root browser and give the three file execution permission.
Init.d script
Original - confirmed working - just point to nilfs_cleanerd . If not already present add the following to /system/etc/init.d/ and chmod +x (or chmod 755) it via terminal/root explorer
Code:
#!/system/bin/sh
/system/xbin/nilfs_cleanerd
Currently trying the following - will probably be implemented within ramdisk at some point - adapted from unhelpful's user_init
Code:
#!/system/bin/sh
export PATH=$PATH:/system/xbin
exec >/system/nilfs2_mount.log
exec 2>&1
set -x
umount /nilfs
time mount -t nilfs2 -o noatime /dev/block/mmcblk0p2 /nilfs
nilfs_cleanerd -c /system/etc/nilfs_cleanerd.conf /dev/block/mmcblk0p2 /nilfs
Edit: files attached as ROM_NAME_initrd.gz need to just be renamed as initrd.gz
HypoTurtle said:
Current relevent files can be found here
Click to expand...
Click to collapse
Thx a lot, however would you be so kind to do the same with BareBoneCM7 NativeSD?
You haven't specified in the starting post how exactly lines should be modified in the init (within /kernel/bootsd/initrd.gz) and also install.sh...
Thanks for creating this thread, HypoTurtle!
Let the ideas start to flow
I'm sure nilfs2 will take over ext4 storage as prefered format once all details are ironed out and recoveries are updated to support it.
It's technically superior to other formats for any solid state memory device.
(BTW, I sent you a PM earlier)
I'm now running CyanMobileX with your nilfs2 binaries. It's just runs flawless!, speedy and I feel my data is very safe in case of any abrupt crash or power failure.
can some one make nilfs2 for this rom :victory:
http://forum.xda-developers.com/showthread.php?t=1681906
HypoTurtle said:
After Install modifications (needs clarification in terms of location)
Will tidy this up as they should/can be included in installation/flashable zip; but using adb/root browser copy the bins and .conf file into /system/xbin. And add a script to /system/etc/init.d initiating /system/xbin/nilfs_cleanerd. Then give the files execution permissions.
Click to expand...
Click to collapse
*.conf file into /system/xbin but not into /etc ?
One more notion: why not to put all these files from nilfs.7z into directories already inside ROM installation zip? (You advise to do it only after installation is complete)
ioy said:
*.conf file into /system/xbin but not into /etc ?
Click to expand...
Click to collapse
Yep, the .conf goes under "system/etc"
ioy said:
*.conf file into /system/xbin but not into /etc ?
One more notion: why not to put all these files from nilfs.7z into directories already inside ROM installation zip? (You advise to do it only after installation is complete)
Click to expand...
Click to collapse
Sorry yes, the default install location for the .conf would be in /etc (or /system/etc; same folder).
Integration of the binaries into the ROM is something I did state would be done eventually, but think that would also require digging through the zip to find where permissions are added and change those, and have had a bit of a hit and miss experience with the cleaner at the moment, want to make sure I have the permissions correct and it's working well before integration.
Kwag, could you make a post listing the benefits of nilfs2, as you know a lot more than I do.
HypoTurtle said:
Kwag, could you make a post listing the benefits of nilfs2, as you know a lot more than I do.
Click to expand...
Click to collapse
Already have
http://forum.xda-developers.com/showpost.php?p=31657498&postcount=716
Here's a copy:
Checksums
Immediate recovery after system crash (no fsck needed at all!)
Continuous (tailored) snapshots of the fs.
Those are benefits of nilfs over ext4. Ext4 has none of those!
no way to creat nilfs on ubuntu cause when i open termenal and command
mkfs -t nilfs2 /dev/sdb2
it give me Error: cannot open device: /dev/sdb2
so any ideas.....
seaman2k said:
no way to creat nilfs on ubuntu cause when i open termenal and command
mkfs -t nilfs2 /dev/sdb2
it give me Error: cannot open device: /dev/sdb2
so any ideas.....
Click to expand...
Click to collapse
sorry, might need sudo ; so sudo mkfs -t nilfs2 /dev/sdb2 failling that try formatting it to ext4 in gparted then try again.
Code:
[SIZE="2"]E/PackageManager( 1471): Couldn't create temp file for downloaded package file.
E/AndroidRuntime( 1471): *** FATAL EXCEPTION IN SYSTEM PROCESS: PackageManager
E/AndroidRuntime( 1471): java.lang.NullPointerException
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$FileInstallArgs.createCopyFile(PackageManagerService.java:5247)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$FileInstallArgs.copyApk(PackageManagerService.java:5255)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$InstallParams.handleStartCopy(PackageManagerService.java:5051)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$HandlerParams.startCopy(PackageManagerService.java:4902)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$PackageHandler.doHandleMessage(PackageManagerService.java:516)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$PackageHandler.handleMessage(PackageManagerService.java:461)
E/AndroidRuntime( 1471): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1471): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 1471): at android.os.HandlerThread.run(HandlerThread.java:60)
E/AudioHardwareQSD( 1827): Cannot open /dev/audience_a1026 -1
E/HTC Acoustic( 1827): Update ADIE table ID 0
E/HTC Acoustic( 1827): Update ADIE table ID 2
E/HTC Acoustic( 1827): Update ADIE table ID 5
E/HTC Acoustic( 1827): Update ADIE table ID 7
E/HTC Acoustic( 1827): Update ADIE table ID 8
E/HTC Acoustic( 1827): Update ADIE table ID 10
E/HTC Acoustic( 1827): Update ADIE table ID 51
E/HTC Acoustic( 1827): Update ADIE table ID 53
E/HTC Acoustic( 1827): Fail to open /system/etc/TPA2018.csv -1.
E/SoundPool( 1844): error loading /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressStandard.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressSpacebar.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressDelete.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressReturn.ogg
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/NetworkLocationProvider( 1970): releaseCheckLocationLock: wake lock has already been released
E/WifiStateTracker( 1844): DHCP request failed: Timed out waiting for DHCP to finish
E/ConnectivityService( 1844): Attempt to connect to WIFI failed.[/SIZE]
logcat attached for BB7 when trying to install an app from the market, what happens is when downloading a app it downloads fine, but doesn't install, screen just turns off an app isn't installed. Haven't seen this posted elsewhere so may be nilfs2 related, anyone have any ideas.
HypoTurtle said:
logcat attached for BB7 when trying to install an app from the market, what happens is when downloading a app it downloads fine, but doesn't install, screen just turns off an app isn't installed. Haven't seen this posted elsewhere so may be nilfs2 related, anyone have any ideas.
Click to expand...
Click to collapse
Yeah I think I already mentioned it in the NativeSD thread.. it's because securecrt is using a method to share the '/root of your 'ext' partition/app' folder with all NativeSD roms, but that folder doesn't have the right permissions and so the whole system is failing..
This needs proper modifications in the updater script first just like the 'nilfs_cleanerd' stuff..
Xylograph said:
Yeah I think I already mentioned it in the NativeSD thread.. it's because securecrt is using a method to share the '/root of your 'ext' partition/app' folder with all NativeSD roms, but that folder doesn't have the right permissions and so the whole system is failing..
This needs proper modifications in the updater script first just like the 'nilfs_cleanerd' stuff..
Click to expand...
Click to collapse
Thanks just noticed that myself (the app folder in the root of the partition)
HypoTurtle said:
Thanks just noticed that myself (the app folder in the root of the partition)
Click to expand...
Click to collapse
I advise you to use the init script (ramdisk) structure found in my roms and leave the 'sharing data/app' folder aside untill it's properly inplemented
HypoTurtle said:
Code:
[SIZE="2"]E/PackageManager( 1471): Couldn't create temp file for downloaded package file.
E/AndroidRuntime( 1471): *** FATAL EXCEPTION IN SYSTEM PROCESS: PackageManager
E/AndroidRuntime( 1471): java.lang.NullPointerException
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$FileInstallArgs.createCopyFile(PackageManagerService.java:5247)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$FileInstallArgs.copyApk(PackageManagerService.java:5255)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$InstallParams.handleStartCopy(PackageManagerService.java:5051)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$HandlerParams.startCopy(PackageManagerService.java:4902)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$PackageHandler.doHandleMessage(PackageManagerService.java:516)
E/AndroidRuntime( 1471): at com.android.server.PackageManagerService$PackageHandler.handleMessage(PackageManagerService.java:461)
E/AndroidRuntime( 1471): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1471): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 1471): at android.os.HandlerThread.run(HandlerThread.java:60)
E/AudioHardwareQSD( 1827): Cannot open /dev/audience_a1026 -1
E/HTC Acoustic( 1827): Update ADIE table ID 0
E/HTC Acoustic( 1827): Update ADIE table ID 2
E/HTC Acoustic( 1827): Update ADIE table ID 5
E/HTC Acoustic( 1827): Update ADIE table ID 7
E/HTC Acoustic( 1827): Update ADIE table ID 8
E/HTC Acoustic( 1827): Update ADIE table ID 10
E/HTC Acoustic( 1827): Update ADIE table ID 51
E/HTC Acoustic( 1827): Update ADIE table ID 53
E/HTC Acoustic( 1827): Fail to open /system/etc/TPA2018.csv -1.
E/SoundPool( 1844): error loading /system/media/audio/ui/Effect_Tick.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressStandard.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressSpacebar.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressDelete.ogg
E/SoundPool( 1844): error loading /system/media/audio/ui/KeypressReturn.ogg
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/GSM ( 1929): Wrong network type: 0
E/NetworkLocationProvider( 1970): releaseCheckLocationLock: wake lock has already been released
E/WifiStateTracker( 1844): DHCP request failed: Timed out waiting for DHCP to finish
E/ConnectivityService( 1844): Attempt to connect to WIFI failed.[/SIZE]
logcat attached for BB7 when trying to install an app from the market, what happens is when downloading a app it downloads fine, but doesn't install, screen just turns off an app isn't installed. Haven't seen this posted elsewhere so may be nilfs2 related, anyone have any ideas.
Click to expand...
Click to collapse
In the BB7 the same happened on Ext4, it had been reported many times even before NILFS-NativeSD idea arrived.
Xylograph said:
I advise you to use the init script (ramdisk) structure found in my roms and leave the 'sharing data/app' folder aside untill it's properly inplemented
Click to expand...
Click to collapse
Yeah thats the first thing I tried, but still not working correctly.
Other than removing the following from the init is there anything I've overlooked?
Code:
# create app data/app dir
mkdir -p /NativeSD/app
mkdir -p /data/app
mount --bind /NativeSD/app /data/app
if [ ! -d /data/.cache ];then
mkdir -m 0770 /data/.cache
chown 1000:2001 /data/.cache
fi
ln -s /data/.cache /cache
RecoveryMOD seems to run fine (Magldr - android on nand), and installs as expected.
HypoTurtle said:
Yeah thats the first thing I tried, but still not working correctly.
Other than removing the following from the init is there anything I've overlooked?
Code:
# create app data/app dir
mkdir -p /NativeSD/app
mkdir -p /data/app
mount --bind /NativeSD/app /data/app
if [ ! -d /data/.cache ];then
mkdir -m 0770 /data/.cache
chown 1000:2001 /data/.cache
fi
ln -s /data/.cache /cache
RecoveryMOD seems to run fine (Magldr - android on nand), and installs as expected.
Click to expand...
Click to collapse
Hmm.. have you compared the updater-script with for example the CyanMobile one ?
I also made an RecoveryMOD2 that will only mount the fat32, mmcblk0p2 and if available mmcblk0p3...
Xylograph said:
Hmm.. have you compared the updater-script with for example the CyanMobile one ?
I also made an RecoveryMOD2 that will only mount the fat32, mmcblk0p2 and if available mmcblk0p3...
Click to expand...
Click to collapse
Couldn't see anything relevant there, Could it be something in init.htcleo.rc? Have tried commenting everything at on fs, but still not fixed. There's also some mounts for squashfs files in init.rc (for modules and xbin) that seem redundant.

[ROOT][ECLIPSE] Installation failed due to invalid APK file

Hi guys,
Sorry if posting the wrong place, but I figured General would be the safest place to put this..
I just rotted my phone again yesterday, and it worked great (using Samsung Galaxy S3 ToolKit v7.0.0)
I have root access, and it all works as it should on the phone.
However, I do have one problem now.
When I was rooting the phone, I had to choose which model. I Have the I9300XXELL4 version, but I used ELLA (both is JZ054K).
I'm using Eclipse to develop apps to my device, and now I cant test my apps on my phone.
When I do "Run as-> Android Application" to puch it to my device, this is the error I'm getting:
Code:
[2013-01-24 11:44:56 - GameTutorial_001] Installation failed due to invalid APK file!
[2013-01-24 11:44:56 - GameTutorial_001] Please check logcat output for more details.
[2013-01-24 11:44:56 - GameTutorial_001] Launch canceled!
And from LogCat I get this:
Code:
01-24 11:44:51.186: D/AndroidRuntime(8724): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
01-24 11:44:51.186: D/AndroidRuntime(8724): CheckJNI is OFF
01-24 11:44:51.191: D/AndroidRuntime(8724): setted country_code = Nordic
01-24 11:44:51.191: D/AndroidRuntime(8724): setted countryiso_code = SE
01-24 11:44:51.196: D/AndroidRuntime(8724): setted sales_code = NEE
01-24 11:44:51.196: D/AndroidRuntime(8724): readGMSProperty: start
01-24 11:44:51.196: D/AndroidRuntime(8724): readGMSProperty: already setted!!
01-24 11:44:51.201: D/AndroidRuntime(8724): readGMSProperty: end
01-24 11:44:51.216: D/dalvikvm(8724): Trying to load lib libjavacore.so 0x0
01-24 11:44:51.226: D/dalvikvm(8724): Added shared lib libjavacore.so 0x0
01-24 11:44:51.236: D/dalvikvm(8724): Trying to load lib libnativehelper.so 0x0
01-24 11:44:51.236: D/dalvikvm(8724): Added shared lib libnativehelper.so 0x0
01-24 11:44:51.486: D/dalvikvm(8724): Note: class Landroid/app/ActivityManagerNative; has 153 unimplemented (abstract) methods
01-24 11:44:51.541: D/AndroidRuntime(8724): Calling main entry com.android.commands.pm.Pm
01-24 11:44:51.581: W/zipro(8649): Unable to open zip '/data/local/tmp/GameTutorial_001.apk': Permission denied
01-24 11:44:51.581: D/asset(8649): failed to open Zip archive '/data/local/tmp/GameTutorial_001.apk'
01-24 11:44:51.581: I/ApplicationPolicy(2287): isApplicationInstallationEnabled
01-24 11:44:51.581: W/DefContainer(8649): Failed to parse package
01-24 11:44:51.581: W/PackageManager(2287): verifying app can be installed or not
01-24 11:44:51.586: W/zipro(8649): Unable to open zip '/data/local/tmp/GameTutorial_001.apk': Permission denied
01-24 11:44:51.586: D/asset(8649): failed to open Zip archive '/data/local/tmp/GameTutorial_001.apk'
01-24 11:44:51.586: D/dalvikvm(2287): WAIT_FOR_CONCURRENT_GC blocked 0ms
01-24 11:44:51.586: W/DefContainer(8649): Failed to parse package
01-24 11:44:51.696: D/dalvikvm(2287): GC_EXPLICIT freed 319K, 33% free 29002K/43271K, paused 8ms+7ms, total 109ms
01-24 11:44:51.706: D/AndroidRuntime(8724): Shutting down VM
01-24 11:44:51.706: D/dalvikvm(8724): GC_CONCURRENT freed 128K, 87% free 568K/4096K, paused 0ms+1ms, total 2ms
01-24 11:44:51.711: D/dalvikvm(8724): Debugger has detached; object registry had 1 entries
01-24 11:44:51.711: I/AndroidRuntime(8724): NOTE: attach of thread 'Binder_3' failed
Cant seem to get any information on the net (even though I do find lots of results when searching for this). None is helping me.
I'm hoping someone here could help me out, as I want make this work..! =P
(Tried setting permision on data/local/tmp folder too..)
- - -
As a sidenote, I wanted to see if I could root it with my original firmware, but I'm not 100% sure how this all works. (Why the toolkit root file is only 5MB, but downloading firmware for my model is 800MB. I did this before with only Odin, but I cant remember which files I needed...)
- - -
Anyways, please help me out here, as I do need to be able to debug my apps on my device. No other aps (that previously worked) is deploying to the phone either, but I can install it if I manually copy it over.
Thanks guys!
Additional information:
So, I'm not sure what stock on my phone anymore.
I did root it once before, and it worked good (did it through Odin). Then the 4.1.2 update came, and I updated normally through Kies. Root was removed in the process. So, before I rotted it yesterday, I was developing on it, and that worked nicely. But I wanted to root it to connect ps3 controller to play games. So I used the Toolbox (V7.0.0) to root it, but they did not have my exact model, only XXELLA. I used that. And root works nice. But Cant develop to it anymore.
This is my information now:
I9300XXELL4
Kernel:3.0.31-742798
Did the rooting process change my kernel?
EDIT:
Ok, just to help me understand a little here. I do not know the connection between firmware and kernel, but was my kernel altered when I rooted my phone?
I see many others having problem with new kernels, but I only used the Samsung Toolkit v7.0.0 to root my device using XXELLA (my model is XXELL4).
Did this process do anything to my kernel? And how can I get the original kernel to my phone if I need that?
Fail to understand the confusing question .
Flash stock rom via Odin and root via
# http://forum.xda-developers.com/showthread.php?t=1719744
Its a question = Q&A .
jje
Helped me out
Hi Stianbl,
I got exactly the same problem, and this solution fixed it, so i hope it does for you too.
The reason for "permission denied" is that apk files uploaded to /data/local/tmp had to low permissions, and the installer process obviously did not have permissions to read any such file.
I never found a solution, but have a workaround that satisfies me. I have simply moved/symlinked the tmp directory to the SD card. Since SD card is formatted as FAT, it does not have owners/permissions and all files created there are always readable by everyone. So open a terminal emulator on your phone. Get root ("su") and type in:
# cd /data/local
# mv tmp tmp-old # (or simply rm -rf tmp)
# mkdir /mnt/sdcard/tmp
# ln -s /mnt/sdcard/tmp ./tmp
I hope i could help you
greets
and another way
m134boy90 said:
Hi Stianbl,
I got exactly the same problem, and this solution fixed it, so i hope it does for you too.
The reason for "permission denied" is that apk files uploaded to /data/local/tmp had to low permissions, and the installer process obviously did not have permissions to read any such file.
I never found a solution, but have a workaround that satisfies me. I have simply moved/symlinked the tmp directory to the SD card. Since SD card is formatted as FAT, it does not have owners/permissions and all files created there are always readable by everyone. So open a terminal emulator on your phone. Get root ("su") and type in:
# cd /data/local
# mv tmp tmp-old # (or simply rm -rf tmp)
# mkdir /mnt/sdcard/tmp
# ln -s /mnt/sdcard/tmp ./tmp
I hope i could help you
greets
Click to expand...
Click to collapse
i founded another way i edit /data/local/tmp to /mnt/sdcard/tmp in adb.exe file and working powerfull adb
try this adb file mediafire.com/download/n9u4evl6wj78zp6/adb.exe
if want edit i open exe file in exescripteditor search google:good:

Categories

Resources