BCR icon indicating copy to clipboard operation
BCR copied to clipboard

[Question] Custom rom > root > install BCR > unroot

Open tdas777 opened this issue 3 years ago • 4 comments

Can it be installed by placing its files in root/system folder using file explorer with root permission, and after installing BCR, can magisk be uninstalled? So that BCR can work like system app, but without magisk.

Basically, this app is perfect; but with magisk, few banking apps are not working properly.

Thanks

tdas777 avatar Aug 02 '22 21:08 tdas777

Yep, absolutely. If your /system folder is writable, just extract system from the BCR zip into there and you should be good to go.

Future BCR upgrades can also be installed the same way.

chenxiaolong avatar Aug 02 '22 21:08 chenxiaolong

Thats great! I will update the results.

Thanks

tdas777 avatar Aug 03 '22 03:08 tdas777

That method is working on Redmi note 8 running on PixelOS 12.1, I was able to copy the system files. Uninstall Magisk, flash the original boot.img of this ROM; and banking apps are working fine, also BCR is running as system app. BUT, this method is not working in Oneplus9R running on NamelessOS 12.1; write permission issue even though it is rooted.

tdas777 avatar Aug 03 '22 19:08 tdas777

Glad to hear it's working on one device at least! You'll probably need to ask the developers of the NamelessOS ROM to see if they have any recommendations.

chenxiaolong avatar Aug 04 '22 03:08 chenxiaolong

image image

Is there something I am doing wrong ? I can't get the app installed this way

SharmaPawan11 avatar Sep 30 '22 05:09 SharmaPawan11

@Deathwish98 Can you post the output again but with ls -lZ (instead of just ls -l)?

And what symptoms are you seeing? Does BCR not show up in the app drawer at all?

chenxiaolong avatar Sep 30 '22 14:09 chenxiaolong

Yes, BCR was not showing in the app drawer at all . I suspected that it could be due to the fact that I was running Android 13 (Nusantara Project) . I also looked at the SELinux label by using ls -lZ and it did have u:object_r:system_file:s0 there . In the end I installed a different Rom (Arrow OS - Android 12) and it is working fine there . One thing I did notice in the new rom was that even though the folder com.chiller.bcr in priv-app had 755 permission, the apk inside it didn't have 644 permission and maybe that could have been the issue in Nusantara as well .

Anyways it is working absolutely fine now. A summary of steps that I did -

  1. Mount / by mount -o rw,remount / (Mounting /system gave an error - mount: 'system' not in /proc/mounts)
  2. Extracted the zip, copied com.chiller.bcr folder to /system/priv-app. Navigate to /system/priv-app.
  3. chmod 755 com.chiller.bcr
  4. chmod 644 com.chiller.bcr/app-release.apk
  5. chown -R root com.chiller.bcr
  6. chgrp -R root com.chiller.bcr
  7. Copy privapp-permissions-com.chiller3.bcr.xml from the extracted folder (system/etc/permissions) to /system/etc/permissions and navigate there
  8. chmod 644 privapp-permissions-com.chiller3.bcr.xml
  9. chown -R root privapp-permissions-com.chiller3.bcr.xml
  10. chgrp -R root privapp-permissions-com.chiller3.bcr.xml
  11. Reboot
  12. mount -o ro,remount /
  13. Unroot

Maybe you can include some of the steps in README so that it helps others.

Great App btw. Simple, Basic and Minimal as the name says.

SharmaPawan11 avatar Sep 30 '22 16:09 SharmaPawan11

Glad to hear you got it working!

the apk inside it didn't have 644 permission and maybe that could have been the issue in Nusantara as well .

I think it's very likely that was the issue.

In case your device supports custom recoveries, the latest version of BCR (1.20) can now also be directly flashed (which will perform steps similar to what you did manually).

chenxiaolong avatar Sep 30 '22 19:09 chenxiaolong

I tried flashing the zip directly in multiple recoveries and with multiple Roms but it always failed with Error Code 1.

SharmaPawan11 avatar Oct 01 '22 01:10 SharmaPawan11

Interesting. If you can grab /tmp/recovery.log via adb after a failed attempt, I can try and fix it.

chenxiaolong avatar Oct 01 '22 04:10 chenxiaolong

recovery.log

Here it is

image

This is the issue I think

SharmaPawan11 avatar Oct 01 '22 04:10 SharmaPawan11

Interesting. rm -rf is supposed to silently ignore ENOENT (No such file or directory) errors. I added a small workaround for it.

Please give this debug build a try: BCR-1.20.r3.gba47509-debug.zip (compiled from commit ba47509a800bab460f8393519fe791be9cdcb6fb)

chenxiaolong avatar Oct 01 '22 18:10 chenxiaolong

image A different error

recovery.log

SharmaPawan11 avatar Oct 01 '22 18:10 SharmaPawan11

/system_root | /dev/block/mmcblk0p24 | Size: 3023MB Used: 1626MB Free: 1397MB Backup Size: 1626MB
   Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent Mount_Read_Only 

Hmm, so TWRP doesn't mount /system_root as writable. I'll add a line to have the installation script remount it.

New debug build: BCR-1.20.r4.g513a91c-debug.zip (built from commit 513a91cb2e51611cf75439d2e0dfeef18f8e8aa4)

chenxiaolong avatar Oct 02 '22 00:10 chenxiaolong

That build worked for me on arrowOS and TWRP:

I:operation_start: 'Flashing'
Installing zip file '/external_sd/BCR-1.20.r4.g513a91c-debug.zip'
Unmounting Super...
I:Unmounting main partitions...
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Extracting updater binary 'META-INF/com/google/android/update-binary'
I:Zip does not contain SELinux file_contexts file in its root.
+ ui_print 'Mounting system'
+ >/proc/self/fd/26 
+ printf 'ui_print %s\nui_print\n' 'Mounting system'
Mounting system
+ mount /system_root
+ mount -o remount,rw /system_root
+ root_dir=/system_root 
+ ui_print 'Extracting files'
+ >/proc/self/fd/26 
+ printf 'ui_print %s\nui_print\n' 'Extracting files'
Extracting files
+ unzip -p /external_sd/BCR-1.20.r4.g513a91c-debug.zip module.prop
+ grep '^id='
+ cut '-d=' -f2
+ app_id=com.chiller3.bcr 
+ rm -rf /system_root/system/priv-app/com.chiller3.bcr
+ unzip -o /external_sd/BCR-1.20.r4.g513a91c-debug.zip 'system/*' -d /system_root
Archive:  /external_sd/BCR-1.20.r4.g513a91c-debug.zip
  inflating: /system_root/system/etc/permissions/privapp-permissions-com.chiller3.bcr.xml
  inflating: /system_root/system/priv-app/com.chiller3.bcr/app-debug.apk
+ ui_print Done!
+ >/proc/self/fd/26 
+ printf 'ui_print %s\nui_print\n' Done!
Done!
I:Updater process ended with RC=0
I:Install took 0 second(s).
I:Data backup size is 6548MB, free: 37206MB.
I:Can't probe device /data/media/0
I:Set page: 'flash_done'
I:operation_end - status=0
I:TWFunc::Set_Brightness: Setting brightness control to 5
I:TWFunc::Set_Brightness: Setting brightness control to 0

r4ulill0 avatar Oct 02 '22 20:10 r4ulill0

Flashing works now. Thanks

SharmaPawan11 avatar Oct 03 '22 05:10 SharmaPawan11

Today I flashed Zephyrus A13 rom on oneplus9r; and tried to flash BCR through recovery; it gave "error 1"

tdas777 avatar Oct 25 '22 18:10 tdas777

Please grab /tmp/recovery.log via adb pull after attempting to flash through recovery.

chenxiaolong avatar Oct 25 '22 20:10 chenxiaolong

Please grab /tmp/recovery.log via adb pull after attempting to flash through recovery.

I:Set page: 'main' I:Set page: 'clear_vars' I:Set page: 'main2' I:Set page: 'install' I:Set page: 'flash_confirm' I:Set page: 'flash_zip' I:operation_start: 'Flashing' Installing zip file '/usbstorage/BCR-1.22-release.zip' I:Update binary zip Verifying package compatibility... Package doesn't contain compatibility.zip entry I:Extracting updater binary 'META-INF/com/google/android/update-binary' I:Zip does not contain SELinux file_contexts file in its root.

  • ui_print 'Mounting system'
  • /proc/self/fd/29

  • printf 'ui_print %s\nui_print\n' 'Mounting system' Mounting system
  • mount /system_root
  • mount -o remount,rw /system_root
  • root_dir=/system_root
  • ui_print 'Extracting files'
  • /proc/self/fd/29

  • printf 'ui_print %s\nui_print\n' 'Extracting files' Extracting files
  • unzip -p /usbstorage/BCR-1.22-release.zip module.prop
  • grep '^id='
  • cut '-d=' -f2
  • app_id=com.chiller3.bcr
  • rm -rf /system_root/system/priv-app/com.chiller3.bcr
  • unzip -o /usbstorage/BCR-1.22-release.zip 'system/*' -d /system_root unzip: couldn't extract directory /system_root/system/addon.d/: No space left on device Archive: /usbstorage/BCR-1.22-release.zip Updater process ended with ERROR: 1 I:Install took 1 second(s). Error installing zip file '/usbstorage/BCR-1.22-release.zip' Updating partition details... I:checking for twrp app I:Can't probe device /dev/block/sda24 I:Unable to mount '/data' I:Actual block device: '/dev/block/sda24', current file system: 'f2fs' ...done I:Set page: 'flash_done' I:operation_end - status=1 I:Set overlay: 'slideout' I:Set overlay: '' I:Set page: 'clear_vars' I:Set page: 'main2' I:Set page: 'advanced' I:Set page: 'copylog' I:Set page: 'action_page' I:operation_start: 'Copy Log'

tdas777 avatar Oct 26 '22 05:10 tdas777

unzip: couldn't extract directory /system_root/system/addon.d/: No space left on device

Unfortunately, I don't think there's anything I can do to work around that. The file it's trying to create in that folder is only 277 bytes.

chenxiaolong avatar Oct 26 '22 12:10 chenxiaolong