yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Kalashnikitty:
still no one able to upload compiled android 5.1.1 files? - the dev is gone and didnt maintain this thread...
[Android Software Development] bovirus:
Are you talking about compiled Linux programs?

In first post are available soirce files and instruction how to compile.

Why do you complain?
[Android Software Development] jerdog:
[MENTION=2976903]A.S._id[/MENTION] - On Ubuntu 15.04 I get the following when I try to build:

android_img_repack_tools$ make
Building libselinux...
removed ‘avc.o’
removed ‘avc_internal.o’
removed ‘avc_sidtab.o’
removed ‘booleans.o’
removed ‘callbacks.o’
removed ‘canonicalize_context.o’
removed ‘checkAccess.o’
removed ‘check_context.o’
removed ‘compute_av.o’
removed ‘compute_create.o’
removed ‘context.o’
removed ‘disable.o’
removed ‘enabled.o’
removed ‘fgetfilecon.o’
removed ‘freecon.o’
removed ‘fsetfilecon.o’
removed ‘get_initial_context.o’
removed ‘getenforce.o’
removed ‘getfilecon.o’
removed ‘getpeercon.o’
removed ‘init.o’
removed ‘label.o’
removed ‘label_android_property.o’
removed ‘label_file.o’
removed ‘lgetfilecon.o’
removed ‘load_policy.o’
removed ‘lsetfilecon.o’
removed ‘mapping.o’
removed ‘policyvers.o’
removed ‘procattr.o’
removed ‘setenforce.o’
removed ‘setfilecon.o’
removed ‘stringrep.o’
*******************************************
Building zlib_host...
*******************************************
Building libmincrypt_host...
*******************************************
Building mkbootimg...
gcc: error: core/mkbootimg/mkbootimg.c: No such file or directory
Makefile:120: recipe for target 'mkbootimg' failed
make: *** [mkbootimg] Error 1

I have all the dependencies installed.
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

Could you pelase your both utilities (source in Linux version / source and exe in Cygwin version)

Currently the latest build for Android source is 5.1.1.r13 (now is 5.1.1.r4 for Linux / 5.1.1.r1 for Cygwin)

latest branche could you chech

here
[Android Software Development] HypoTurtle:
Anyone know if you can handle sparse images directly from updater-script?

Something like:

. . .

run_program("/sbin/simg2img", "system.img", "/dev/block/mmcblk0p17");

. . .
[Android Software Development] be free:
SOLVED

The drive in which I had pasted the files was formatted in NTFS format so for the file to work , I had to use it from the drive which was formatted in ext4 format i.e. the home directory
[Android Software Development] bovirus:
[MENTION=5901467]be free[/MENTION]

chmod works only on ext4 unit (not on NTFS).

The Linux driver are always in ext4 format.
[Android Software Development] Eversmile23:
How should I proceed?

I am new to the use of Ubuntu. I am trying for porting of ROMs for my Micromax Canvas A 96(MTK6582). For this I want to modify the system files/folder as laid out in the procedure. So for unpacking and repacking I will set up the required steps in Ubuntu 14.04 LTS. I want to know if I need to create a separate directory say, 'MyTest' and after going to that directory then only should I write "sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.8-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline6-dev gcc-multilib g++-multilib libc6-dev x11proto-core-dev libx11-dev libz-dev gawk texinfo automake libtool cvs libsdl-dev" and then download repo within that directory or it can be done in the home directory itself?
[Android Software Development] albfus:
I have Ubuntu 12.4 and Samsung S3 V Plus SM-G318HZ with Android 4.4.4

Installing and compiling android-4.4.4_r2.0.1 branch is working fine.

I can successfully unpack, modify and repack system.img but flashing the new system.img via Odin fails.

I use the following commands to generate the new system.img:

./simg2img system.img system.raw.img

mkdir system_mnt

sudo mount -t ext4 -o loop system.raw.img system_mnt

./make_ext4fs -s -l 1024M system_new.img system_mnt

I think I use wrongly the last command ./make_ext4fs -s -l 1024M system_new.img system_mnt.

What is the correct command to repack system_mnt/ into sparse image system_new.img for KitKat 4.4.4 ?
[Android Software Development] HypoTurtle:
I would: umount system_mnt then, img2simg system.raw.img system_new.img

But i dont know how odin works, maybe you need the odin modifier on 1st page.
[Android Software Development] albfus:
thanks, I thinks so, by the way the odin_rom_editor is much more detailed, it is better to do with that than doing manually. I can generate the custom root rom for my samsung v plus sm-g318hz tar md5 file ready to be flashed into the device. The only option I am not sure is about the processor option 1, 2 or 3 in the odin_rom_editor, I select option 1, will see if it can flash :)
[Android Software Development] albfus:
I flash the custom root rom via Odin but it fails on system.img, it looks like it is not processor option 1 samsung oxynos dual/quad for the samsung galaxy v plus sm-g318hz :) I will try option 2 or option 3. Does anybody know how to check which processor option to choose for the samsung v plus sm-g318hz ?
[Android Software Development] albfus:
I look at the scripts of the tool Odin3 rom editor, img2simg is executed before unmount. When I select dual/quad option 1 mkuserimg.sh is executed and not img2simg. Can anybody explain the difference between mkuserimg and img2simg and which one to use for samsung galaxy v plus sm-g318hz kitkat 4.4.4 ?
[Android Software Development] albfus:
I try all the 3 ext options, the good option for my device is option 2 samsung exynos octa which uses img2simg and sgs4ext4fs scripts. I can flash the rooted system.img on the device via Odin. In order to edit the rooted system.img I simply copy the program su in the folder /system/xbin and chmod 755 su, program su is well loaded on the device but the device is not rooted. I guess it is more complicated than just putting su program in folder /system/xbin :) Does anybody has the full steps on how to edit the stock system.img to have a rooted system.img ? thx
[Android Software Development] albfus:
I follow all the detailed steps on the second video of the first page and I can finally root my device samsung galaxy v plus sm-g318hz. I can tell this is the only method which works because there is no available custom recovery for this device for the moment, none of the available root programs work. This method is the best, no lost of guaranty :) and probably can work on most samsung devices, thanks to OP.
[Android Software Development] Telesync:
Any ideas why system.img repacking is not working for Android 5.1.1 @ SM-G925F? Previous firmwares were OK. Boot stucks at splash screen.
[Android Software Development] A.S._id:
Added

android_img_repack_tools

android-5.1.1_r24
[Android Software Development] MioCZ:
Hi, not able to unpack system img from mediatek MT6752/32 platform. My fault or something new?
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

Thanks for the new build.

Please consider if it's possible to make a build for Android 6.0.
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION],

Could you please update cygwin utils? Thanks.
[Android Software Development] JOSH64CHEN:
./make_ext4fs -s -T -1 -S file_contexts -l 2500M -a ./temp system.img ./system_mnt

Creating filesystem with parameters:

Size: 2621440000

Block size: 4096

Blocks per group: 32768

Inodes per group: 8000

Inode size: 256

Journal blocks: 10000

Label:

Blocks: 640000

Block groups: 20

Reserved block group size: 159

error: build_directory_structure: cannot lookup security context for /./temp/VODB

samsung G900F Android 5.0

help thanks
[Android Software Development] A.S._id:
UPDT

Added:

branch - android-6.0.0_r1

how to - read README.md!
[Android Software Development] JOSH64CHEN:
thank

but i use ./mkuserimg.sh have a error

how can i use file_contexts build_directory_structure:??? help

./make_ext4fs -s -T -1 -S file_contexts -l 2500M -a ./temp systemnew.img ./s1

Creating filesystem with parameters:

Size: 2621440000

Block size: 4096

Blocks per group: 32768

Inodes per group: 8000

Inode size: 256

Journal blocks: 10000

Label:

Blocks: 640000

Block groups: 20

Reserved block group size: 159

error: build_directory_structure: cannot lookup security context for /./temp/VODB
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

Thanks for the latest Linux tool update (6.x).

What's about cygwin projet? Do you think to update it?
[Android Software Development] A.S._id:
I'm tested it to make, but unlucky yet. And plus I have very little time. Maybe later...
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

Kit 6.0.r1

Error during compilation (make)

Building simg2img...

*******************************************

Building simg2simg...

*******************************************

Building img2simg...

*******************************************

Building make_ext4fs...

/usr/bin/ld: cannot find -llog

collect2: error: ld returned 1 exit status

make: *** [make_ext4fs] Error 1
[Android Software Development] andii_nr:
Thank you
[Android Software Development] A.S._id:
bovirus

!!!
[Android Software Development] bovirus:
[MENTION=2967526]A.S[/MENTION]_Id

Thanks.

Which is the right command to install the right .deb packages in Ubuntu?

Could be usefull to post this info in read.me file.
[Android Software Development] blacknikname:
The same error Ubuntu x86
[Android Software Development] bovirus:
[MENTION=5145332]blacknikname[/MENTION]

The error is due have to install a module as explkianed in read.me for tool v. 6.0

android_img_repack_tools is a kit utilites for unpack/repack android ext4 and boot images

how to make:

step one: Install these packages:

android-liblog-dev https://packages.debian.org/jessie/android-liblog-dev

create link for lib

$ sudo ln /usr/lib/android/liblog.a /usr/local/lib/

Is not clear which is the deb package to install and how to install (also for me in Ubuntu)..

I believ that should be

apt-get install android-liblog-dev
[Android Software Development] blacknikname:
will reboot to linux and search a solution ))) thanks

in my case (ubuntu x86) i think package will be - http://ftp.ro.debian.org/debian/poo...-system-core/android-liblog-dev_21-6_i386.deb

for x86-64 - http://ftp.ro.debian.org/debian/poo...system-core/android-liblog-dev_21-6_amd64.deb
[Android Software Development] bovirus:
[MENTION=5145332]blacknikname[/MENTION]

the commando to install .deb package is

sudo dpkg -i xxxx.deb

Where xxxx.deb is the deb file downloaded.

[MENTION=2976903]A.S._id[/MENTION]

I found an error in 'configure' execution

Cloning into 'android_system_core'...

remote: Counting objects: 53671, done.

remote: Compressing objects: 100% (2/2), done.

remote: Total 53671 (delta 0), reused 0 (delta 0), pack-reused 53669

Receiving objects: 100% (53671/53671), 18.29 MiB | 466.00 KiB/s, done.

Resolving deltas: 100% (31128/31128), done.

Checking connectivity... done.

error: pathspec 'stable/cm-13' did not match any file(s) known to git.

Probably because in configure

stable/cm-13

should be

stable/cm-13.0
[Android Software Development] A.S._id:
okay, I'm updated branch - CM team was chnrged name from cm-13 to cm-13.0, and checkout lost this branch...

you can or add '.0' into configure or download tool one more time
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

The cm branch name is cm-13.0 (without /stable)
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

The current branch for Android 6.0 is 6.0.0_r26.

Do you need to update your tool?
[Android Software Development] ShonkUK:
im getting this also

anything below 5.0 compiles fine

looks like we have to follow what the op was running for each build..

would be handy if op either supplied bin's or told us what each build was test compiled on

Tried

Ubuntu 12.04

Ubuntu 13.10 (updateing to trusty atm)

ok updated to 14.04 (x64)

all good

Some 5.1.1 r24 64 Bit Bins Compiled on Ubuntu 14.04 x64 (Working fine on Fedora x64)

http://pc.cd/9dKrtalK

rm -r -f ./android_i*
git clone https://github.com/ASdev/android_img_repack_tools
cd android_img_repack_tools
git checkout android-5.1.1_r24
chmod +x configure
./configure
make

*******************************************
Building mkbootimg...
*******************************************
Building mkbootfs...
*******************************************
Building libsparse_host...
*******************************************
*******************************************
Building simg2img...
*******************************************
Building simg2simg...
*******************************************
Building img2simg...
*******************************************
Building make_ext4fs...
*******************************************
Building ext2simg...
*******************************************
Building unpackbootimg...
removed ‘libmincrypt_host.a’
removed ‘libpcre.a’
removed ‘libselinux.a’
removed ‘libsparse_host.a’
removed ‘libz.a’
*******************************************
Building sgs4ext4fs...
*******************************************
root@ubuntu:/home/shonk/android_img_repack_tools#
[Android Software Development] ShonkUK:
Umm its the first time i have touched a 5.1.1 System Image

Im trying to make an image for a Note 4 SM-N910C (Exynos)

Usually i use (S3 LTE / S4 LTE etc.)

Mount In Ubuntu

./simg2img ./rom/system.img ./system.ext4.img
mkdir system; mount -o loop system.ext4.img system

Repack (Ubuntu)

./make_ext4fs -s -S file_contexts -l 3600M -a system ./system.img ./system
mv ./system.img ./rom/

Any idea what im doing wrong?

Not trying to root the image

just debloat and update packages

Creating filesystem with parameters:
Size: 3774873600
Block size: 4096
Blocks per group: 32768
Inodes per group: 7952
Inode size: 256
Journal blocks: 14400
Label:
Blocks: 921600
Block groups: 29
Reserved block group size: 231
error: xattr_assert_sane: BUG: extended attributes are not sorted
[Android Software Development] ShonkUK:
doesnt matter think i have it

Mount

./simg2img ./system.img ./system.raw
mkdir system
mount -t ext4 -o loop ./system.raw system

Pack

mv ./system.img ./system.img.bak
./ext2simg -v ./system.raw ./system.img

Fix exynos octa

mv ./system.img ./system_new.img
./sgs4ext4fs --bloat system_new.img system.img

Pack

tar -c system.img >> N910C_MOD1.tar
md5sum -t N910C_MOD1.tar >> N910C_MOD1.tar
mv N910C_MOD1.tar N910C_MOD1.tar.md5
[Android Software Development] zameer_yus:
my question is how to change a file label to u: object_r:system_file:s0

i modify system.img to add some additional apps into /system/app/ directory i did modification then build a new system.img after flashing phone with new system.img the app was appear in menu but once i am trying to open it gives me error (com.xxxxxx.andriod) stopped working then i execute ls -Z command in /system/app/ directory to see the different and i realize that the new app i copied in system/app/ directory it has a different label than others

so i tried to change .apk file label to (u: object_r:system_file:s0) using chcon command but failed

chcon: Could not label u: object_r:system_file:s0
[Android Software Development] A.S._id:
try to make script for your added files & run this

example:

echo
echo set file contexts
echo
ch_con() {
sudo chcon -v u:object_r:system_file:s0 $1
}
ch_con system/bin/.ext/.su
ch_con system/xbin/su
ch_con system/xbin/daemonsu
ch_con system/etc/install-recovery.sh
ch_con system/etc/init.d/99SuperSUDaemon
ch_con system/etc/.installed_su_daemon
ch_con system/app/Superuser.apk
ch_con system/lib/libdummy.so
echo
[Android Software Development] ShonkUK:
This method i couldnt add any modified files with an enforcing kernel (well i could but the kernel would deny access to them)

I ended up using a 4.4.4 build i compiled last year (not from here)

then fixing it for exynos octa

Im not sure of the exact changes for the 5.1.1 make_ext4fs

but my 5.1.1 Note 4 is quite happy with the image

Mount 5.1.1r24 Simg2img

./simg2img ./system.img ./system.raw
mkdir system
mount -t ext4 -o loop ./system.raw system

Pack 4.4.4 make_ext4fs

mv ./system.img ./system.img.bak
./make_ext4fs44 -s -S file_contexts -l 3600M -a system ./system.img ./system

Fix Exynos Octa 5.1.1r24 sgs4etx4fs

mv ./system.img ./system_new.img
./sgs4ext4fs --bloat system_new.img system.img

Pack

rm ./*.md5
tar -c system.img >> N910C_MOD1.tar
md5sum -t N910C_MOD1.tar >> N910C_MOD1.tar
mv N910C_MOD1.tar N910C_MOD1.tar.md5
[Android Software Development] blacknikname:
[MENTION=3725242]ShonkUK[/MENTION] hey, some help, how to play with dumped partition from OMAP samsung... ideea is to pack to new DAT format
[Android Software Development] zameer_yus:
label changed but wrong value see below screen shot [/B][/COLOR]
[Android Software Development] A.S._id:
I suspect that you installed in Linux selinux enforcing. These contexts were created by default, according to the list of contexts for this user. To selinux is not bothered to edit images firmware, I think that it is better not to install selinux enforcing ...
[Android Software Development] A.S._id:
Global update

*Updated Makefile into all brunches

*Added making new binary:

make_ext4fs_def - this utility use for building new ext4fs img with permissions by default, not changes permissions for existing files.

make_ext4fs - building new android ext4fs img with permissions according to the mount point.
[Android Software Development] A.S._id:
New Tool

Added:

Android_ROM_IMG_Repacker
[Android Software Development] blacknikname:
how to fix that

Building libpcre...

ar: pcre/*.o: No such file or directory

Makefile:143: recipe for target 'libpcre' failed

make: *** [libpcre] Error 1
[Android Software Development] A.S._id:
You must to read first post: prepare OS for development, and to install needs components...
[Android Software Development] blacknikname:
and you think i just ignore op and spam this thread? logic
[Android Software Development] A.S._id:
Logic: I'm try to help correct the error that appears only for you. And you, instead of trying to pose intelligent complicity. So what's the point to help you?
[Android Software Development] blacknikname:
maybe, issues iswith my system, ist a x86? ubuntu last
[Android Software Development] A.S._id:
show all output

./configure

make
[Android Software Development] blacknikname:
ok, not at pc right now, will post later

thanks for your time
[Android Software Development] asafyry:
[MENTION=2670715]as_[/MENTION]id

great tools thx for your effort

i have a question ..how to modeify (modem.bin ) and (non-hlos.bin) to can flash for diffrent device

for examble sm-n910 C&H&G...ETC
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

./configure log error in rev 6.0.0.r1

CCLD libpcreposix.la

/bin/sed: can't read R2/source/android_img_repack_tools-android-6.0.0_r1/pcre/libpcre.la: No such file or directory

libtool: link: `R2/source/android_img_repack_tools-android-6.0.0_r1/pcre/libpcre.la' is not a valid libtool archive

make[1]: *** [libpcreposix.la] Error 1

make[1]: Leaving directory `/home/ubuntu/Desktop/Android Image Repack R2/source/android_img_repack_tools-android-6.0.0_r1/pcre'

make: *** [all] Error 2

The configure process works fine just with this error

The make process works fine (no error log).

can I use the app compiled or do you need to fix it?
[Android Software Development] A.S._id:
I'm just tested it, but I haven't any errors in output...

linux mint 17,2 cinnamon 64-bit

make[1]: Вход в каталог `/home/as/Загрузки/android_img_repack_tools-android-6.0.0_r1/pcre'
CC libpcre_la-pcre_byte_order.lo
CC libpcre_la-pcre_compile.lo
CC libpcre_la-pcre_config.lo
CC libpcre_la-pcre_dfa_exec.lo
CC libpcre_la-pcre_exec.lo
CC libpcre_la-pcre_fullinfo.lo
CC libpcre_la-pcre_get.lo
CC libpcre_la-pcre_globals.lo
CC libpcre_la-pcre_jit_compile.lo
CC libpcre_la-pcre_maketables.lo
CC libpcre_la-pcre_newline.lo
CC libpcre_la-pcre_ord2utf8.lo
CC libpcre_la-pcre_refcount.lo
CC libpcre_la-pcre_string_utils.lo
CC libpcre_la-pcre_study.lo
CC libpcre_la-pcre_tables.lo
CC libpcre_la-pcre_ucd.lo
CC libpcre_la-pcre_valid_utf8.lo
CC libpcre_la-pcre_version.lo
CC libpcre_la-pcre_xclass.lo
CC libpcre_la-pcre_chartables.lo
CCLD libpcre.la
CC libpcreposix_la-pcreposix.lo
CCLD libpcreposix.la
CXX libpcrecpp_la-pcrecpp.lo
CXX libpcrecpp_la-pcre_scanner.lo
CXX libpcrecpp_la-pcre_stringpiece.lo
CXXLD libpcrecpp.la
CC pcretest-pcretest.o
CC pcretest-pcre_printint.o
CCLD pcretest
CC pcregrep-pcregrep.o
CCLD pcregrep
CXX pcrecpp_unittest-pcrecpp_unittest.o
CXXLD pcrecpp_unittest
CXX pcre_scanner_unittest-pcre_scanner_unittest.o
CXXLD pcre_scanner_unittest
CXX pcre_stringpiece_unittest-pcre_stringpiece_unittest.o
CXXLD pcre_stringpiece_unittest
make[1]: Выход из каталога `/home/as/Загрузки/android_img_repack_tools-android-6.0.0_r1/pcre'
[Android Software Development] bovirus:
I ettsed it again and I have it with all version.

Tomorrow I posted the full log.
[Android Software Development] blacknikname:
[MENTION=2976903]A.S._id[/MENTION] sorry for delay...
[Android Software Development] bovirus:
[MENTION=5145332]blacknikname[/MENTION]

For a better thread/post readibility please consider don't copy/paste text log but attach it as etxt file to your post.
[Android Software Development] A.S._id:
@blacknikname

Try to install

sudo apt-get install autotools-dev
sudo apt-get install automake
[Android Software Development] rogerscrack:
[MENTION=2976903]A.S._id[/MENTION] the repacker tool would be more "complete" than the other ROM editor?
[Android Software Development] bovirus:
[MENTION=2976903]A.S._id[/MENTION]

I solved the problem at http://xdaforums.com/showpost.php?p=63887623&postcount=302 without any change.

Just expand the folder of your zip file directly oin desktop (befroe was isnerted ina sub-folder).,

In this way (after chmod with configure - the command ./configure worked without error).

Buth checking ./compile operation log I checked that there is an error about

BRANCH_EXT=stable/cm-13.0

sit didn't find this repository tag. should be

BRANCH_EXT=cm-13.0

I modified it and it worked.

Please fix it in all versions where it needs.

I believe that could be usefull for all to have simple instructions in first posts to help the users (as I got this samples on my personal experience)

Convert SPARSE IMAGE into EXT4 image

ex. - system.img=sparse file - system..ext4.img=ext4 image

./simg2img system.img system.ext4.img (convert sparse image into ext4 image)

Mount EXT4 system.img

ex. system.ext4.img=ext4 image - system_mnt=folder where mount image file

mkdir system_mnt (create folder)

sudo mount -t ext4 -o loop system.ext4.img system_mnt (mount image)

Check mounted unit size

Please check the size of the new unit mounte (ex. 1.4GB)

Modify files and folders into monted folder

Now you can make any change to the file inside system_mnt folder

Create the new SPARSE EXT4 image

ex. system_mnt=image folder - system.new.img=new SPARSE inage

Please check the mounted image size and dividee it for 1,024 to have the new size .

Ex mounted image =1.4GB=1400MB/1,024=1367MB

./make_ext4fs -s -l 1367M -a system new.img system_mnt/

Please remind that the new image created is in SPARSE format (you cannot mount it directly to test it)

Unmount the unit and remove the folder

ex. system_mnt=folder mounted

sudo umount system_mnt

rm -rf system_mnt

What do you think to add theese instructions as help in secon/third post?
[Android Software Development] A.S._id:
yes, it for any android firmvare
[Android Software Development] blacknikname:
lily@school52:~$ sudo apt-get install autotools-dev

Citire liste de pachete... Terminat

Se construiește arborele de dependență

Se citesc informațiile de stare... Terminat

autotools-dev este deja la cea mai nouă versiune.

0 înnoite, 0 nou instalate, 0 de șters și 3 neînnoite.

lily@school52:~$ sudo apt-get install automake

Citire liste de pachete... Terminat

Se construiește arborele de dependență

Se citesc informațiile de stare... Terminat

automake este deja la cea mai nouă versiune.

0 înnoite, 0 nou instalate, 0 de șters și 3 neînnoite.

lily@school52:~$
[Android Software Development] A.S._id:
Sorry, but than I don't understand why you have this error...