Implement a different callback url for android app


I need to modify rocket chat android app to be authenticated by a personal identity provider ( OpenID Connect standard)

I want to use chrome custom tab (CCT) solution due to it can store cookies for later use.

However, due to security policies, my app can’t read the url on CCT. It ranged from blank page or user must manually choose app to open link.

So I want to create a custom callback(B) follow the first callback(A). B will send a deep link to open the app.

But I don’t know where to start. Or this is a good solution?

Please give me advice.