8000 idb command for pulling app.csr fails · Issue #2871 · facebook/flipper · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

idb command for pulling app.csr fails #2871

Closed
dejolt opened this issue Sep 16, 2021 · 19 comments
Closed

idb command for pulling app.csr fails #2871

dejolt opened this issue Sep 16, 2021 · 19 comments
Assignees

Comments

@dejolt
Copy link
dejolt commented Sep 16, 2021

🐛 Bug Report

It seems that there's an issues with the certificate pull from the device.

To Reproduce

Flipper uses this command to pull the file:
idb --log DEBUG file pull --udid (device id) --bundle-id (com.xxxxx.xxxxx) 'Library/Application Support /sonar/app.csr' 'destination folder'.

If I use the same command in terminal, the command does not work and fails.

But if use the same command and add a backslash ( \ ) at the end of the Application like below, the file gets copied to the destination folder. Aka the certificate gets copied and there are no IDB errors.
idb --log DEBUG file pull --udid (device id) --bundle-id (com.xxxxx.xxxxx) 'Library/Application\ Support /sonar/app.csr' 'destination folder'.

UPDATE 3 hours later

It seems that the backslash works but only in the terminal, so forget about that.

So I investigated some more and built Flipper from source an found out that the problem is that in the file iOSContainerUtility.tsx, function pull, the idb command it's incomplete. I manually added {dst}/app.csr at the end of the command, built again and the certificate error disappeared. I attached a screenshot of the modification.

Screen Shot 2021-09-16 at 7 25 10 PM

Thanks for reviewing it!

Environment

Mac OS Big Sur 11.6
Iphone X iOS 14.8
Flipper 0.109.0
React Native 0.65.1

@mweststrate
Copy link
Contributor

I suspect your idb / idb_companion is outdated. Which version is reported if you run idb_companion? Could you update to the latest version?

cc @passy

@dejolt
Copy link
Author
dejolt commented Sep 17, 2021

I suspect your idb / idb_companion is outdated. Which version is reported if you run idb_companion? Could you update to the latest version?

cc @passy

Well my idb-companion/idb version is 1.1.5. I even tried with source builds of idb and still the same error.
The interesting part is that, if I modify the Flipper source and build it like I mentioned above by adding /app.csr, I got no problems. But if I download a built version of Flipper I get a certificate error. I'm assuming is something on my machine that is wrong, since nobody else complained about it, but can't figure it out what's wrong.

Thanks.

@mweststrate
Copy link
Contributor

Something did recently change here, so it could have been introduced by D30541778 / 89d7e17

@dejolt
Copy link
Author
dejolt commented Sep 17, 2021

Something did recently change here, so it could have been introduced by D30541778 / 89d7e17

I think you're right, because it's exactly what's happening. The fix you mentioned, specifies that the destination file name is omitted (app.csr) and it's exactly what I was adding to fix the problem.

@mweststrate
Copy link
Contributor

@passy would you mind taking a closer look at this in time?

@passy passy self-assigned this Sep 17, 2021
@passy
Copy link
Member
passy commented Sep 17, 2021

Thanks for the detailed notes! That seems like a pretty clear cut bug. I'll take a look next week.

@mweststrate
Copy link
Contributor

@passy seems there is some more background linked here: D27590885.

@tylercote
Copy link
tylercote commented Oct 6, 2021

Hey @passy, any update on this? I can confirm what @dejolt said, the command does indeed work if you append /app.csr to the end of the destination argument.

@dejolt
Copy link
Author
dejolt commented Oct 6, 2021

Hey @passy, any update on this? I can confirm what @dejolt said, the command does indeed work if you append /app.csr to the end of the destination argument.

Yeah so all you got to do is append /app.csr to the end of the command in the file iOSContainerUtility.tsx on line 203 (just like I pointed out in the image in the bug report). You can find the file by downloading the source code of Flipper 0.113.0, unzip, then the path of the file is desktop/app/src/server/devices/iOS/iOSContainerUtility.tsx. And then you build from source. Hope it helps!

@wilau2
Copy link
wilau2 commented Oct 18, 2021

Indeed reverting to version 0.104.0 fixes this issue for us.

@passy
Copy link
Member
passy commented Oct 19, 2021

Apologies for the delays on this. It's been a few busy weeks. Sadly this week doesn't look much better but if nobody else has a chance to look into this, I should be able to pick this up early next week.

@tomasmozeris
Copy link

Indeed reverting to version 0.104.0 fixes this issue for us.

Thanks, had same issue, none of newer versions worked on real iOS device, but downgrading to 0.104.0 works

@passy passy changed the title Command failed when pulling certificate from device idb command for pulling app.csr fails Oct 27, 2021
@passy
Copy link
Member
passy commented Oct 27, 2021

There have been a bunch of changes to the logic in the recent release as part of @mweststrate's server code refactorings. Could you please check if this still applies?
In case it does, could you please also share your idb version?

@dejolt
Copy link
Author
dejolt commented Oct 27, 2021

There have been a bunch of changes to the logic in the recent release as part of @mweststrate's server code refactorings. Could you please check if this still applies?
In case it does, could you please also share your idb version?

Hi @passy, I just installed the latest version 0.117.0 and it seems that the problem was solved.
I'm using the latest idb version 1.1.5.

Thanks!

@passy
Copy link
Member
passy commented Oct 28, 2021

Amazing! Sorry for the delay and thanks @mweststrate for fixing this. :)

@passy passy closed this as completed Oct 28, 2021
@tylercote
Copy link

@passy I am also using the latest versions (flipper: 0.117.0 and idb: 1.1.5) and the issue still appears to be present.

Appending app.csr to the aforementioned line in iOSContainerUtility.tsx still fixes the issue.
${idbPath} --log ${idbLogLevel} file pull --udid ${udid} --bundle-id ${bundleId} '${src}' '${dst}/app.csr'.

I ran into an additional issue with a fresh build from source where there was no directory flipper/desktop/plugins/fb. When I created the fb directory, it worked again.

I saw you just closed this, but I do believe there are still issues present.

@elliottkember
Copy link
elliottkember commented Oct 31, 2021

I also have this error. Downgrading Flipper doesn't fix it (the change is old, and I also can't determine my IDB version, but I had to install it under Rosetta homebrew (facebook/idb#649)

Update: building from source eventually fixed it. I don't think I'd installed protobuf correctly.

@aigoncharov
Copy link
Contributor

Fixed in 9975aa9
Should be included into the next release

@hlspablo
Copy link

guys, this is related to idb python client, use pip3.9 install fb-idb, and remove any previous installed version that you have.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants
0