Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tdas777 opened this issue Aug 2, 2022 · 20 comments · Fixed by #139
Closed

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

tdas777 opened this issue Aug 2, 2022 · 20 comments · Fixed by #139
Assignees
Labels
question Question about BCR

Comments

@tdas777
Copy link

tdas777 commented Aug 2, 2022

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

@chenxiaolong
Copy link
Owner

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 chenxiaolong self-assigned this Aug 2, 2022
@chenxiaolong chenxiaolong added the question Question about BCR label Aug 2, 2022
@tdas777
Copy link
Author

tdas777 commented Aug 3, 2022

Thats great! I will update the results.

Thanks

@tdas777
Copy link
Author

tdas777 commented Aug 3, 2022

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.

@chenxiaolong
Copy link
Owner

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.

@SharmaPawan11
Copy link

SharmaPawan11 commented Sep 30, 2022

image
image

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

@chenxiaolong
Copy link
Owner

@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?

@SharmaPawan11
Copy link

SharmaPawan11 commented Sep 30, 2022

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.

@chenxiaolong
Copy link
Owner

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).

@SharmaPawan11
Copy link

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

@chenxiaolong
Copy link
Owner

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

@SharmaPawan11
Copy link

SharmaPawan11 commented Oct 1, 2022

recovery.log

Here it is

image

This is the issue I think

@chenxiaolong
Copy link
Owner

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 ba47509)

@SharmaPawan11
Copy link

image
A different error

recovery.log

@chenxiaolong
Copy link
Owner

/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 513a91c)

@r4ulill0
Copy link

r4ulill0 commented Oct 2, 2022

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

@SharmaPawan11
Copy link

Flashing works now. Thanks

@tdas777
Copy link
Author

tdas777 commented Oct 25, 2022

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

@chenxiaolong
Copy link
Owner

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

@tdas777
Copy link
Author

tdas777 commented Oct 26, 2022

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'

@chenxiaolong
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about BCR
Projects
None yet
4 participants