Exports the Qr Code generation to an external class and uses a WeakReference for callback to avoid leaking