Giter Site home page Giter Site logo

chenxiaolong / dualbootpatcher Goto Github PK

View Code? Open in Web Editor NEW
524.0 70.0 470.0 25.92 MB

Patches Android ROMs for dual boot support

Home Page: https://dbp.noobdev.io

License: Other

CMake 3.21% Java 4.26% C++ 68.06% Shell 0.19% C 5.80% Assembly 0.07% Roff 0.52% Kotlin 17.85% Objective-C 0.04%

dualbootpatcher's Introduction

Due to recent changes in Android P, as well as upcoming changes in Android Q, DualBootPatcher is no longer being developed. These two releases change some fundamental assumptions that DBP makes about the host device.

With devices that ship with Android 9.0+, the system-as-root partition layout is mandatory. This means that the system partition includes everything that traditionally went in the boot image's ramdisk. DBP relies on being able to modify the ramdisk to add its binaries as well as some config files that specify the ROM ID and device specific information (eg. partitions). To switch between ROMs, DBP simply flashes the ROM's patched boot image.

With the system-as-root partition layout, most of the files could potentially live on the system partition, but the ROM ID must be stored in the boot image. With some devices, like Google Pixels, a ramdisk can be added back by including it in the boot image and patching the kernel image to ignore the skip_initramfs cmdline option. However, on other devices, like the Samsung Galaxy S10 series, the bootloader will always ignore the ramdisk section in the boot image. Storing the ROM ID in the cmdline field is also not feasible because many devices' bootloaders ignore the whole field.

With the Android Q preview builds, some devices, such as the Google Pixel 3 series, switched to using dm-linear for handling the partition layout of the read-only OS partitions (system, vendor, etc.). With this setup, a single GPT partition is split up and is mapped to device-mapper block devices by a userspace tool. With Android's /init, this is done via the liblp library, which parses the metadata on disk and configures dm-linear. DBP would have to implement something equivalent to this to be able to mount the Android partitions. It currently assumes that the kernel will provide a mountable block device after going throug the uevent device probing phase.

Neither of these changes are impossible to work around, but I have simply lost any interest in doing so. I have not used DBP on my primary devices for a couple of years now. Those interested in continuing development are free to fork the project. Any work that had been done for the 10.0.0 release has been pushed to the 10.0.0-staging branch.

All downloads have been moved to SourceForge at https://sourceforge.net/projects/dualbootpatcher/files/. I will work on splitting out some of the more useful parts of DBP, such as libmbbootimg (boot image parser) and libmbsystrace (syscall injection/modification library), so that they can be used in other projects, but DBP itself will no longer be developed.

Huge thanks to everyone who helped out with this project the past six years!


Downloads

All previous builds can be found here.

Compiling from Source

See the docs/build/ directory for instructions on building for Linux, Windows, and Android.

License

The patcher is licensed under GPLv3+ (see the LICENSE file). Third party libraries and programs are used under their respective licenses. Copies of these licenses are in the licenses/ directory of this repository. Patches and other source code modifications to third party software are under the same license as the original software.

dualbootpatcher's People

Contributors

1889737514 avatar addy692 avatar caio99br avatar chenxiaolong avatar clovergit avatar cryscript avatar diepquynh avatar droidthug avatar faizauthar12 avatar garry050 avatar hankching avatar ililaoban avatar itsthestrechh avatar jjlu521016 avatar keno80 avatar leonelv avatar msfjarvis avatar mysteryagr avatar ndrancs avatar nikandlv avatar nzh63 avatar out386 avatar parthibx24 avatar rg4ibir avatar rokibhasansagar avatar serenitys2 avatar shahr773 avatar sky0hjh avatar thehardgamer avatar yshalsager avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dualbootpatcher's Issues

[request][function] Implement option to enable/disable root acess

I think you need to add a option to user choose if him want to enable root acess, like part of make this app root-free, so if this option is enabled, disable the option to patch and flash to /system and /cache or related to root writing.
I do not know if you had already thought of that, but whatever is here :P

[Request] Change Dualbootpatcher to use first Partition on external SDcard

Is it possible to change Dualbootpatcher to use first Partition on external SDcard? as if you have 2 partitions on your external SDcard: 1st = fat32, 2nd (last) = EXT4, dualbootpatcher will use EXT4 instead of the fat32 partition and when you boot into recovery you will not see the EXTSD slots. I am using the EXT4 for app2sd to expand my memory to install apps, and is mapped to /raw/extsd and dualbootpatcher is using the same thing.

[REQUEST] SKIP A CODE IN UPDATER-SCRIPT

@chenxiaolong please see after removing this lines roms gets flashed perfectly so please do something for these lines :)

run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");

Sign mbtool binaries

We should look into signing the mbtool binaries. That way, the app can send newer mbtool builds to the currently running mbtool daemon and the daemon can safely upgrade itself. Once is done, we're one step closer to removing the root requirement as the app will no longer need to manually execute mbtool daemon --replace.

I'm planning to use an extremely simple method to sign the binaries: just sign them with the same private key as the one used to sign the Android app and store it in a separate file with the extension .sig. The certificates are already hardcoded in mbtool's validcerts.cpp, so verification will be very easy.

Implementing signing and verification:

  • Have CMake extract private key from the Java keystore
  • Use either the openssl command or a custom program to sign the binaries during the build
  • Implement verification procedure in mbtool
  • Add functions in mbtool to verify the signature of a file
  • Update mbtool_recovery to enforce signature checking when executing any of our binaries that are in the patched zip
  • Update Android app to use mbtool's SignedExec call instead of root to launch the in-app flashing process
  • Update mbtool to enforce signature checking when executing any of our binaries during boot
  • Update Android app to never replace mbtool using root unless the interface versions are mismatched or mbtool isn't running (eg. unpatched primary ROM)
  • Bump minimum in-app flashing version and daemon version before merging

[Android GUI] Suppport to API 16 (JellyBean)

I think the JellyBean is common in most of actual devices, so why not support in the GUI?
I have tested only changing minimum sdk but this force close when enter in ROMs menu.

Error when building the APK

Hi,

I get the following error when building the apk from sources on Ubuntu 14.04 LTS using openjdk:

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 12.637 secs

Anyone knows a fix for that?

Implement waiting procedure for external SD

Some SD cards are being detected by the kernel after mbtool searches for matching block devices. We'll need to implement some sort of waiting procedure, but without delaying the boot process when the SD card is not inserted.

See logs at: http://forum.xda-developers.com/showpost.php?p=64685469

Relevant section:

...
<7>[    2.212640] mbtool: 1 fstab entries for the external SD
<3>[    2.213096] mbtool: Failed to find block device corresponding to /devices/msm_sdcc.3/mmc_host/mmc2*
<3>[    2.213426] mbtool: Failed to mount /raw/extsd/multiboot/extsd-slot-bliss6/system.img: No such file or directory
<3>[    2.213466] mbtool: Failed to mount fstab
<7>[    2.365832] mbtool: event { action='add', path='/devices/msm_sdcc.3/mmc_host/mmc2/mmc2:59b4', subsystem='mmc', firmware='', name='(null)', partname='(null)', partnum=-1, major=-1, minor=-1 }
<6>[    2.365864] [mmc_blk_probe]mmcblk1: mmc2:59b4 00000 119 GiB , card->type:1
<7>[    2.366032] mbtool: event { action='add', path='/devices/virtual/bdi/179:64', subsystem='bdi', firmware='', name='(null)', partname='(null)', partnum=-1, major=-1, minor=-1 }
<6>[    2.367893]  mmcblk1: p1
<4>[    2.368032] mbtool: Unknown message: 'DEVTYPE=disk'
<4>[    2.368045] mbtool: Unknown message: 'NPARTS=1'
<4>[    2.368055] mbtool: Unknown message: 'SEQNUM=4291'
<7>[    2.368072] mbtool: event { action='add', path='/devices/msm_sdcc.3/mmc_host/mmc2/mmc2:59b4/block/mmcblk1', subsystem='block', firmware='', name='mmcblk1', partname='(null)', partnum=-1, major=179, minor=64 }
<7>[    2.368120] mbtool: Found platform device msm_sdcc.3
<7>[    2.368162] mbtool: Creating device /dev/block/mmcblk1
<7>[    2.368173] mbtool: - Symlink /dev/block/platform/msm_sdcc.3/mmcblk1
<4>[    2.368934] mbtool: Unknown message: 'DEVTYPE=partition'
<4>[    2.368946] mbtool: Unknown message: 'SEQNUM=4292'
<7>[    2.368964] mbtool: event { action='add', path='/devices/msm_sdcc.3/mmc_host/mmc2/mmc2:59b4/block/mmcblk1/mmcblk1p1', subsystem='block', firmware='', name='mmcblk1p1', partname='(null)', partnum=1, major=179, minor=65 }
<7>[    2.368999] mbtool: Found platform device msm_sdcc.3
<7>[    2.369022] mbtool: Creating device /dev/block/mmcblk1p1
<7>[    2.369033] mbtool: - Symlink /dev/block/platform/msm_sdcc.3/by-num/p1
<7>[    2.369043] mbtool: - Symlink /dev/block/bootdevice/by-num/p1
<7>[    2.369053] mbtool: - Symlink /dev/block/platform/msm_sdcc.3/mmcblk1p1
<3>[    2.369210] mbtool: Failed to symlink /dev/block/mmcblk1p1 to /dev/block/bootdevice/by-num/p1: File exists
...

The invalid symlinking of SD card partitions to /dev/block/bootdevice/ should also be fixed. (Issue #37 )

ROMs of system.new.dat format failing to install.

Hi Chen. It's me, Salman A, the guy with the Lenovo phone having a Mediatek processor. Here's the recovery.log I get when I try to install a system.new.dat ROM after editing the updater-script and replace the kernel lines with ones I used in /system/ ROMs on the last debug version you gave me. It seems a bit weird to me. P.S.: I'm copy-pasting since I couldn't find any way to attach it.. I'll upload it to some cloud storage if you want it.. recovery.log:

ui_print script result was [please reboot system now] please reboot system now 
[E] Child exited: 0 
[E] Running command: [ /sbin/sh, -i ] 
sh: can't access tty; job control turned off / # 
[E] [Installer] Filesystem unmounting stage 
[E] Running command: [ /update-binary-tool, unmount, /system ] 
[E] update-binary-tool: /system not mounted. Skipping 
[E] Running command: [ /update-binary-tool, unmount, /cache ] 
[E] update-binary-tool: Ignoring unmount command for /cache 
[E] Running command: [ /update-binary-tool, unmount, /data ] 
[E] update-binary-tool: Ignoring unmount command for /data 
[E] Running command: [ e2fsck, -f, -y, /external_sd/multiboot/extsd-slot-1/system.img ] 
[E] e2fsck: e2fsck 1.42.9 (28-Dec-2013) 
[E] e2fsck: Pass 1: Checking inodes, blocks, and sizes 
[E] e2fsck: Pass 2: Checking directory structure 
[E] e2fsck: Pass 3: Checking directory connectivity 
[E] e2fsck: Pass 4: Checking reference counts 
[E] e2fsck: Pass 5: Checking group summary information 
[E] e2fsck: /external_sd/multiboot/extsd-slot-1/system.img: 2771/163840 files (35.5% non-contiguous), 237527/655360 blocks 
[E] [Installer] Finalization stage 
[E] Old boot partition SHA1sum: 194ce4b84ffff8ccdf6e620b1a714e5858a55d18 
[E] New boot partition SHA1sum: 4c24c5607eb715451f97d3d9bfb1ba34200be7c0 
[MultiBoot] Boot partition was modified. Setting kernel 
[E] Boot image is an mtk boot image 
[E] Found Android boot image header at: 0 
[E] - magic: ANDROID! 
[E] - kernel_size: 6190726 
[E] - kernel_addr: 0x40080000 
[E] - ramdisk_size: 1797632 
[E] - ramdisk_addr: 0x44000000 
[E] - second_size: 0 
[E] - second_addr: 0x40f78000 
[E] - tags_addr: 0x4e000000 
[E] - page_size: 2048 
[E] - dt_size: 0 
[E] - unused: 0x00000000 
[E] - name: Bule 
[E] - cmdline: bootopt=64S3,32N2,64N2 androidboot.selinux=permissive 
[E] - id: 4570676a0c9cfcaa7f9c8a125d277c537e269ade000000000000000000000000 
[E] MTK header: 
[E] - magic: \x88\x16\x88X 
[E] - size: 6190214 
[E] - type: KERNEL 
[E] - unused: \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff 
[E] Creating mtk Android boot image 
[E] Computed new ID hash: b765dd5f9e56a2c32ba5b958d783e4ae6a1b03d4 
[E] [Installer] Cleanup stage 
[E] Failed to unmount /chroot/system: Invalid argument
[MultiBoot] Destroying chroot environment 
[E] Finished cleanup 
I:Legacy property environment disabled. 
Updating partition details... 
I:Data backup size is 8157MB, free: 428MB. 
I:Unable to mount '/usbotg' 
I:Actual block device: '', current file system: 'auto' ...done 
I:Set page: 'flash_done' 
I:operation_end - status=0 
I:Set page: 'clear_vars' 
I:Set page: 'install' 
I:Set page: 'main' 
I:Set page: 'clear_vars' 
I:Set page: 'main2' 
I:Set page: 'advanced' 
I:Set page: 'confirm_action' 
I:Set page: 'action_page' 
I:operation_start: 'Copy Log' 
I:Copying file /tmp/recovery.log to /external_sd/recovery.log

Edited by @chenxiaolong to make log more readable

[Request] Support to all Languages

I have tried to translate to my language but the App only support part of all languages in the world, my language is pt-BR and the app only support pt-PT.
Idk how to do this, if not i already have opened a Pull Request :P

dualbootpatcher app gets forceclose

@chenxiaolong i tried to compile this app after adding support to my device but after installing app on my phone it gets force closed can u tell is it a source issue or i am compiling it in wrong way :)

Error with ndk and thirdparty files

want to build a debug version .

prebuilt-libmblog is using a horribly ugly ndk-build hack that will probably break in the future!
Android NDK: ERROR:/home/nikan/DualBootPatcher/build/thirdparty/Android.mk:procps-ng: LOCAL_SRC_FILES points to a missing file    
Android NDK: Check that /home/nikan/DualBootPatcher/build/thirdparty/android/procps-ng/lib_armeabi-v7a/libprocps.a exists  or that its path is correct   
/home/nikan/android-ndk-r10d/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.
make[2]: *** [libmbp/mbp-shared-android-prefix/src/mbp-shared-android-stamp/mbp-shared-android-build] Error 2
make[1]: *** [libmbp/CMakeFiles/mbp-shared-android.dir/all] Error 2
make: *** [all] Error 2

checked this and doesnt exist
home/nikan/DualBootPatcher/build/thirdparty/android/procps-ng/lib_armeabi-v7a/libprocps.a

Copy only /defaults.prop properties to legacy properties service

Some ROMs are negatively affected by existing property values from the currently running ROM when using in-app flashing. mbtool should include a complete property service implementation so we have a clean secondary property workspace. We don't need to worry about property security as properties like ro.* and ctl.* should not be processed. All that's really needed is a simple key/value dictionary.

The initial set of properties should be loaded from /defaults.prop from the recovery's ramdisk when using in-app flashing. When flashing via recovery, the system properties should simply be cloned.

The new properties file should use the legacy format for compatibility reasons. Newer versions of bionic support the legacy format anyway.

update-script

If the updater-script have some lines relative to firmware check partition it will fail the installation.
It cannot detect the firmware partition corrected so it will fail the installation and stop when flashing.

http://pastebin.com/1c2duMtW

Having trouble with CM12.1 installation

The installation go fast and i not unpack the system files.
Maybe because new LP/MM installation method.
I updated TWRP (branch 5.1) to new blockimg (version 3) since CM recovery use this, and force us to edit system.tranfer.list.
But backing to error, the files not is extracted but boo.img is flashed.
Here core of error:
using existing stash /cache/recovery/90366e4fa7117d6830dd04f8b09a7469550bb932/
not a block device; skipping erase
failed to execute command [erase 2,0,233984]
I tested the zip before and work.
Note: i can't patch files and update ramdisk in new versiin, i not tested with previous of this.

APK reboot function not working

I am currently using cm12 on hlte and this function stopped working since 8.0.0.r2157.g7d47ab8. Please take a look over this feature, thanks.

dualboot not patching in oneplus two

Hello,
When i try to enter the menu for patching zip file it browses the zip file instead of selecting it. The same thing happens when I try to go in the rom page and push the Add button. Every time it is supposed to select a zip file instead it enters it.

Only create /dev/block/bootdevice/ symlinks for internal partitions

On devices with SD cards inserted, mbtool is logging symlink failure warnings:

...
<7>[    2.368964] mbtool: event { action='add', path='/devices/msm_sdcc.3/mmc_host/mmc2/mmc2:59b4/block/mmcblk1/mmcblk1p1', subsystem='block', firmware='', name='mmcblk1p1', partname='(null)', partnum=1, major=179, minor=65 }
<7>[    2.368999] mbtool: Found platform device msm_sdcc.3
<7>[    2.369022] mbtool: Creating device /dev/block/mmcblk1p1
<7>[    2.369033] mbtool: - Symlink /dev/block/platform/msm_sdcc.3/by-num/p1
<7>[    2.369043] mbtool: - Symlink /dev/block/bootdevice/by-num/p1
<7>[    2.369053] mbtool: - Symlink /dev/block/platform/msm_sdcc.3/mmcblk1p1
<3>[    2.369210] mbtool: Failed to symlink /dev/block/mmcblk1p1 to /dev/block/bootdevice/by-num/p1: File exists
...

Fix UI issues and Material Design inconsistencies

From @Caio99BR

Ps: before bump up, check loading icon of patch zip.
Ps2: organize the options of app, like "Interface", "Patcher", "etc, look more good than actual.
Ps4: the transitions can look more good, like Telegram (example), because the app is Material but have transitions of JB.
Ps5: put the three dot button more bigger, because is a sacrifice press it on a ldpi device.
Ps7: the last, since i need to stop with this things the app already is very good, fix rotation of about page in ldpi, i not can see the links, put a fake button in end of page, anything, you not can read all.

[Request] s3 neo please s3ve3g with a really good fast start up

Hello dev :) there are many people waiting for this device :) and I tryed to port it , and I saw its really close to moto g 2013 xt1032 so I changed my build.prop and make it like its that phone , and I opened the app add the Zip , converted it , then i select set the kernel then i installed it , and it was successful then I set that secondary ROM and rebooted everything was fine , I installed the app for the secondary ROM and changed back to my primary ROM and it booted back to first ROM :D so everything is right , but after second time booting into secondary ROM com.android.phone started stopping every two seconds and I think its SQL related here's logcat
http://www.mediafire.com/view/69d91p9feccuq6x/Log_2016-01-26_02-39-24.txt
I hope it helps you
Remember moto g 2013 xt1032 is close to our device
I'm ready to help and being a tester

Error messages during patching are not helpful

I had two problems that both resulted in error 15. This message doesn't really help and also the errors should have been different

First I used Solid Explorer to select the file which somehow messed up the filepath, adding /1/ to the beginning:

Patching file:
- Path:       /1/storage/extSdCard/cm-12.1-20151223-NIGHTLY-trltexx.zip.zip
Not stopping: # of operations: 0, is bound: true

I used ES Explorer to select the file, but patching failed (error 15) because afaik Android >=5 doesn't allow access to the SDcard by default:

Patching file:
- Path:       /storage/extSdCard/cm-12.1-20151223-NIGHTLY-trltexx.zip.zip
Not stopping: # of operations: 0, is bound: true

So I moved it to the internal card which finally worked.
I suggest displaying "Failure: Access denied $filename" and "Failure: File not found $filename" if something goes wrong.

com.android.phone force closes in secondary ROM

I am trying to bring up DualBootPatcher for ferrari (mi 4i), and am currently facing issues with the secondary ROM.

I have followed the following steps:

  1. in primary ROM, patch ROM as secondary
  2. flash _dual.zip for secondary ROM in recovery
  3. reboot device (device boots into secondary, no FCs)
  4. install .apk file, and switch to primary ROM
  5. in primary ROM, switch back to secondary ROM
  6. reboot from the power menu (phone boots into secondary)
  7. device boots into secondary, com.android.phone FC's.

herein i attach parts of logcat which i think are relevant:

E/SQLiteDatabase( 1696): Failed to open database '/data/data/com.android.providers.telephony/databases/HbpcdLookup.db'.
E/SQLiteDatabase( 1696): android.database.sqlite.SQLiteException: not an error (code 0): Could not open the database in read/write mode.
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:806)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:791)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
E/SQLiteDatabase( 1696):    at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1179)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
E/SQLiteDatabase( 1696):    at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
E/SQLiteDatabase( 1696):    at com.android.providers.telephony.HbpcdLookupProvider.onCreate(HbpcdLookupProvider.java:155)
E/SQLiteDatabase( 1696):    at android.content.ContentProvider.attachInfo(ContentProvider.java:1730)
E/SQLiteDatabase( 1696):    at android.content.ContentProvider.attachInfo(ContentProvider.java:1705)
E/SQLiteDatabase( 1696):    at android.app.ActivityThread.installProvider(ActivityThread.java:5039)
E/SQLiteDatabase( 1696):    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4634)
E/SQLiteDatabase( 1696):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4574)
E/SQLiteDatabase( 1696):    at android.app.ActivityThread.access$1600(ActivityThread.java:154)
E/SQLiteDatabase( 1696):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382)
E/SQLiteDatabase( 1696):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/SQLiteDatabase( 1696):    at android.os.Looper.loop(Looper.java:135)
E/SQLiteDatabase( 1696):    at android.app.ActivityThread.main(ActivityThread.java:5294)
E/SQLiteDatabase( 1696):    at java.lang.reflect.Method.invoke(Native Method)
E/SQLiteDatabase( 1696):    at java.lang.reflect.Method.invoke(Method.java:372)
E/SQLiteDatabase( 1696):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/SQLiteDatabase( 1696):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
E/SQLiteOpenHelper( 1696): Couldn't open HbpcdLookup.db for writing (will try read-only):
E/SQLiteOpenHelper( 1696): android.database.sqlite.SQLiteException: not an error (code 0): Could not open the database in read/write mode.
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:806)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:791)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
E/SQLiteOpenHelper( 1696):  at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1179)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
E/SQLiteOpenHelper( 1696):  at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
E/SQLiteOpenHelper( 1696):  at com.android.providers.telephony.HbpcdLookupProvider.onCreate(HbpcdLookupProvider.java:155)
E/SQLiteOpenHelper( 1696):  at android.content.ContentProvider.attachInfo(ContentProvider.java:1730)
E/SQLiteOpenHelper( 1696):  at android.content.ContentProvider.attachInfo(ContentProvider.java:1705)
E/SQLiteOpenHelper( 1696):  at android.app.ActivityThread.installProvider(ActivityThread.java:5039)
E/SQLiteOpenHelper( 1696):  at android.app.ActivityThread.installContentProviders(ActivityThread.java:4634)
E/SQLiteOpenHelper( 1696):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4574)
E/SQLiteOpenHelper( 1696):  at android.app.ActivityThread.access$1600(ActivityThread.java:154)
E/SQLiteOpenHelper( 1696):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382)
E/SQLiteOpenHelper( 1696):  at android.os.Handler.dispatchMessage(Handler.java:102)
E/SQLiteOpenHelper( 1696):  at android.os.Looper.loop(Looper.java:135)
E/SQLiteOpenHelper( 1696):  at android.app.ActivityThread.main(ActivityThread.java:5294)
E/SQLiteOpenHelper( 1696):  at java.lang.reflect.Method.invoke(Native Method)
E/SQLiteOpenHelper( 1696):  at java.lang.reflect.Method.invoke(Method.java:372)
E/SQLiteOpenHelper( 1696):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/SQLiteOpenHelper( 1696):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
D/AndroidRuntime( 3163): Shutting down VM
E/AndroidRuntime( 3163): FATAL EXCEPTION: main
E/AndroidRuntime( 3163): Process: com.android.phone, PID: 3163
E/AndroidRuntime( 3163): java.lang.RuntimeException: Unable to get provider com.android.providers.telephony.HbpcdLookupProvider: android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5)
E/AndroidRuntime( 3163):    at android.app.ActivityThread.installProvider(ActivityThread.java:5042)
E/AndroidRuntime( 3163):    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4634)
E/AndroidRuntime( 3163):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4574)
E/AndroidRuntime( 3163):    at android.app.ActivityThread.access$1600(ActivityThread.java:154)
E/AndroidRuntime( 3163):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382)
E/AndroidRuntime( 3163):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3163):    at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 3163):    at android.app.ActivityThread.main(ActivityThread.java:5294)
E/AndroidRuntime( 3163):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3163):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 3163):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime( 3163):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
E/AndroidRuntime( 3163): Caused by: android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5)
E/AndroidRuntime( 3163):    at android.database.sqlite.SQLiteConnection.nativeExecuteForLong(Native Method)
E/AndroidRuntime( 3163):    at android.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:600)
E/AndroidRuntime( 3163):    at android.database.sqlite.SQLiteSession.executeForLong(SQLiteSession.java:652)
E/AndroidRuntime( 3163):    at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:107)
E/AndroidRuntime( 3163):    at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:825)
E/AndroidRuntime( 3163):    at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:813)
E/AndroidRuntime( 3163):    at android.database.sqlite.SQLiteDatabase.getVersion(SQLiteDatabase.java:864)
E/AndroidRuntime( 3163):    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:241)
E/AndroidRuntime( 3163):    at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
E/AndroidRuntime( 3163):    at com.android.providers.telephony.HbpcdLookupProvider.onCreate(HbpcdLookupProvider.java:155)
E/AndroidRuntime( 3163):    at android.content.ContentProvider.attachInfo(ContentProvider.java:1730)
E/AndroidRuntime( 3163):    at android.content.ContentProvider.attachInfo(ContentProvider.java:1705)
E/AndroidRuntime( 3163):    at android.app.ActivityThread.installProvider(ActivityThread.java:5039)
E/AndroidRuntime( 3163):    ... 11 more

entire log here: https://gist.github.com/thewisenerd/78fddbc80024a8484322

[request] option to disable patch certain partitions for certain devices

Hello,
I want to request this feature if is it possible to disable patching the certain partitions for certain devices
example:
-> There are devices with small system/cache partition where system and cache cannot hold second rom, hence making dual and multi-slots just a placeholder.

if it is possible to add overlay to disable patching for certain partition to make it user proof?

[HELP[ Not able to build DualBootPatcher

Hi, i would love to see this in my Moto E (condor), i have added /dev/block/mmcblk0p* paths for condor in patcherconfig.cpp. debug build builds fine without any error , but when i try to update ramdisk it says unable to update ramdisk here is the ramdisk log output http://pastebin.com/VHsLTvEn though the app is able to patch roms for condor but i cant see any rom in roms tab. I tried building release builds too but it always gave me this error http://pastebin.com/r6avDsrv a help will be appreciated.

Patcher not working with CM13?

I'm trying to install CM13 on my klimtlte with Dualboot. The zip flashes without any problems in recovery or the app, but it won't boot (But I know it boots). Anyone having the same issue?

Fix possible battery drain caused by auto-shutdown alarm

PatcherService and SwitcherService are being restarted by the very alarm that tries to shut them down after 10 seconds of idle time (d'oh!)

...
01-09 01:12:33.734  2059  2059 D SwitcherService: onCreate()
01-09 01:12:33.734  2059  2059 D SwitcherService: Scheduling delayed exit after 10000ms
01-09 01:12:33.735  2059  2059 D SwitcherService: onStartCommand(intent=Intent { act=com.github.chenxiaolong.dualbootpatcher.switcher.SwitcherService.exit flg=0x4 cmp=com.github.chenxiaolong.dualbootpatcher.snapshot/com.github.chenxiaolong.dualbootpatcher.switcher.SwitcherService (has extras) }, flags=0, startId=1)
01-09 01:12:33.735  2059  2059 D SwitcherService: Attempting to stop service
01-09 01:12:33.735  2059  2059 D SwitcherService: Calling stopSelf(): there are no more operations
01-09 01:12:33.737  2059  2059 D PatcherService: onDestroy()
01-09 01:12:33.737  2059  2059 D SwitcherService: onDestroy()
01-09 01:12:43.757  2059  2059 D PatcherService: onCreate()
01-09 01:12:43.760  2059  2059 D PatcherService: Scheduling delayed exit after 10000ms
01-09 01:12:43.763  2059  2059 D PatcherService: onStartCommand(intent=Intent { act=com.github.chenxiaolong.dualbootpatcher.patcher.PatcherService.exit flg=0x4 cmp=com.github.chenxiaolong.dualbootpatcher.snapshot/com.github.chenxiaolong.dualbootpatcher.patcher.PatcherService (has extras) }, flags=0, startId=1)
01-09 01:12:43.763  2059  2059 D PatcherService: Attempting to stop service
01-09 01:12:43.763  2059  2059 D PatcherService: Calling stopSelf(): there are no more operations
01-09 01:12:43.765  2059  2059 D PatcherService: onDestroy()
01-09 01:12:43.776  2059  2059 D SwitcherService: onCreate()
01-09 01:12:43.777  2059  2059 D SwitcherService: Scheduling delayed exit after 10000ms
01-09 01:12:43.779  2059  2059 D SwitcherService: onStartCommand(intent=Intent { act=com.github.chenxiaolong.dualbootpatcher.switcher.SwitcherService.exit flg=0x4 cmp=com.github.chenxiaolong.dualbootpatcher.snapshot/com.github.chenxiaolong.dualbootpatcher.switcher.SwitcherService (has extras) }, flags=0, startId=1)
01-09 01:12:43.779  2059  2059 D SwitcherService: Attempting to stop service
01-09 01:12:43.779  2059  2059 D SwitcherService: Calling stopSelf(): there are no more operations
01-09 01:12:43.780  2059  2059 D SwitcherService: onDestroy()
01-09 01:12:53.795  2059  2059 D PatcherService: onCreate()
01-09 01:12:53.806  2059  2059 D PatcherService: Scheduling delayed exit after 10000ms
01-09 01:12:53.819  2059  2059 D PatcherService: onStartCommand(intent=Intent { act=com.github.chenxiaolong.dualbootpatcher.patcher.PatcherService.exit flg=0x4 cmp=com.github.chenxiaolong.dualbootpatcher.snapshot/com.github.chenxiaolong.dualbootpatcher.patcher.PatcherService (has extras) }, flags=0, startId=1)
01-09 01:12:53.819  2059  2059 D PatcherService: Attempting to stop service
01-09 01:12:53.819  2059  2059 D PatcherService: Calling stopSelf(): there are no more operations
01-09 01:12:53.825  2059  2059 D SwitcherService: onCreate()
01-09 01:12:53.826  2059  2059 D SwitcherService: Scheduling delayed exit after 10000ms
01-09 01:12:53.827  2059  2059 D SwitcherService: onStartCommand(intent=Intent { act=com.github.chenxiaolong.dualbootpatcher.switcher.SwitcherService.exit flg=0x4 cmp=com.github.chenxiaolong.dualbootpatcher.snapshot/com.github.chenxiaolong.dualbootpatcher.switcher.SwitcherService (has extras) }, flags=0, startId=1)
01-09 01:12:53.827  2059  2059 D SwitcherService: Attempting to stop service
01-09 01:12:53.827  2059  2059 D SwitcherService: Calling stopSelf(): there are no more operations
01-09 01:12:53.828  2059  2059 D PatcherService: onDestroy()
01-09 01:12:53.828  2059  2059 D SwitcherService: onDestroy()
...

[Request] Default ROM to boot

Hi, I'd like to suggest a feature and I guessed that you'd be more likely to see it here than on the forums thread because it's so busy! I'd like to ask if you would consider adding a "default ROM" option which the device would always boot to rather than the last used ROM. For example, I'd want my phone to always boot to the CyanogenMod ROM instead of the TouchWiz ROM, and then I'd swap manually if I needed to use a Samsung stock-app. A further suggestion would be to remove the need for this altogether, and add some sort of "boot selection" when the device turns on (like if you dual-booted OSes on a PC) so that I can choose which ROM to boot to, and then maybe after 10 seconds automatically boot to one of the ROMs if none are chosen.

I was creating an app myself to try and solve my problems which would open on boot and let me choose which ROM to boot to (looking at your source code for how to do this), however it looks like you're working on an API (with the "allow receiving intents" in the app's settings) and I chose not to take this route and instead made your app open automatically on boot.

Would any of my suggested features be possible, and if not, how would I use your app's "API" to do this myself? Thanks!

Patching zip file

It gives error 13 and wont patch zip file. OnePlus Bacon CM13.0 Android 6.0.1
Any workround?
Also see that device its supported but could not find specific thread for this device.

[Request]skip verification in of few more things

Hey @chenxiaolong you know the issue of mine where mm roms were not getting flashed and after regular experimenting got the issue it was in updater-script Hope you will try to help in it :)

if is_mounted("/data") then
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/userdata", "/data", "");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;

Please try to solve it after removing these lines from updater-script rom gets flashed as well as boots too hoping to see a commit soon ;)

Ps:- after removing these lines [D] Child killed with signal: 11 this error also vanishes

[Request] Moto E 2015 (surnia)

I would like to see this device supported please.

Motorola Moto E - XT1526 (surnia)

Partition Location
boot /dev/block/mmcblk0p33
cache /dev/block/mmcblk0p42
recovery /dev/block/mmcblk0p34
system /dev/block/mmcblk0p41
userdata /dev/block/mmcblk0p43

[not an issue] heres a tool for easy build

hello

this tool made by I'mTheMr (Nikandlv)

sorry that i post this here because i dont know where to post

fist step :
extract the zip
open bin folder
and open both scripts as text

then fined this lines at start

for dbdebug

Configs

NDK & SDK Home

NDK=/home/me/android-ndk-r10d
SDK=/home/me/android-sdk-linux/

End of config


for dbrelease

Configs

NDK & SDK Home

NDK=/home/me/android-ndk-r10d
SDK=/home/me/android-sdk-linux/

Key Store path & password

KEYSTORE_PATH=/home/me/keystore/privateKey.store
KEYSTORE_PASSWORD=123456

Key alias name & password

KEY_ALIAS=me
KEY_PASSWORD=123456

End of config

edit all line values to your values and save
check that values are correct ;))))
then save the files and go back to main folder
right click and select open terminal here
or cd to the folder ( note folder must be one word like dbtools )
then type
sudo sh install.sh
and type your password and enter
wait for installtion done
done now its easy for you
just open folder where your project is and open terminal there
then type
dbdebug : for debug builds
dbrelease : for release builds
in both there are 2 options for now
1 ) build-debug-full & build-release-full ( it will remove build folder and rebuild from all )
2 ) build-apk-only ( will build only apk when build folder exist and ready )
download : http://www.mediafire.com/download/ay70nzoay5dk30a/dbtools.zip
screenshot : http://www.mediafire.com/download/df1rrjr0ap0391p/screenshot.png

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.