Chief Justice Cheung: 1. I agree with the judgment of Mr Justice Fok PJ. Mr Justice Fok PJ: A. Introduction 2. This is an appeal against a decision by Campbell-Moffat J to grant a permanent stay of criminal proceedings. The prosecution related to a charge of trafficking in a dangerous drug arising out of the facts outlined below in Section B of this judgment. Consequent upon the decision to grant a stay of proceedings, and notwithstanding the prosecution’s indication of an intention to apply for leave to appeal to this Court against the stay, the judge granted bail to the respondent on conditions that permitted him to leave Hong Kong. The respondent then left the jurisdiction. Thereafter, leave to appeal was granted by the Appeal Committee for this appeal on the terms more fully described in Section C.4 below. 3. This appeal is primarily against the judge’s decision to grant a permanent stay of proceedings. As will be seen, however, it also raises questions as to the correctness of a prior decision of the judge relating to the admissibility of the contents of the respondent’s mobile phone, identified as exhibit P60. From that “iPhone” mobile phone, photographs of certain WhatsApp messages had been taken by officers of the Customs and Excise Department. Finally, this judgment also addresses the correct approach that should be taken in relation to the grant of bail when a stay of criminal proceedings has been ordered but the prosecutor seeks to appeal against that stay and to proceed with the prosecution. B. The facts relating to the trafficking charge 4. The respondent (defendant below) was indicted on one count of trafficking in a dangerous drug contrary to s.4(1)(a) and (3) of the Dangerous Drugs Ordinance (Cap.134). He had arrived at the Hong Kong International Airport on 10 September 2019 on a flight from São Paulo, Brazil via Zurich, Switzerland. He was intercepted by Customs officers on arrival. His two suitcases, when searched, were found to contain false compartments in which 3,941 grammes of a solid containing 3,312 grammes of cocaine were found. The estimated market value of the drugs was HK$4.97 million. 5. The respondent was arrested. Under caution, he said he had come from Europe to Hong Kong for real estate business. He said he was asked by someone called Jimmy to go to Brazil to bring the suitcases to Zurich and then to Hong Kong where someone would contact him at the Mira Hotel to collect them. A controlled delivery was attempted in order to apprehend the intended recipient of the drugs but was unsuccessful. 6. The respondent was later interviewed on video under caution. In the course of the video-recorded interview (“VRI”), he stated that he had become acquainted, through the Internet, with a woman called Yolanda, with whom he had a developing romantic relationship, who asked him to collect some confidential documents from Brazil so that she could claim an inheritance of US$10 million from her great-grandfather. The respondent said he had undertaken one journey from Brazil to London previously and his trip from Brazil to Hong Kong was the second such journey. Both trips were organised by two individuals, Jimmy Roland and Anthony Campbell, said to be working for the “United Nations Association” and responsible for handling Yolanda’s inheritance claim. The two suitcases the respondent was travelling with to Hong Kong, into which he packed his own belongings, had been provided by Jimmy and Anthony. He understood he was collecting confidential documents in the nature of bearer bonds for Yolanda, which could be used to obtain funds. He thought they had been hidden in the suitcases because they were not approved by the Brazilian authorities to be taken out of the country. He denied knowledge of the drugs in the suitcases and said that he did not think the suitcases contained drugs because he did not believe someone could take drugs through customs nowadays. He had received US$900 and €200 from Jimmy and Anthony as reimbursement of his costs in Brazil. He was not going to be paid for carrying the documents, which he did as a favour for Yolanda. But he was to be paid US$2,500 once he delivered the documents to pay for his hotel and return journey to the airport and for meals. He never met Yolanda, Jimmy or Anthony in person and only communicated with Yolanda and Jimmy by WhatsApp messages and with Anthony by email. 7. The above is a brief summary of the circumstances of the respondent’s arrest and his explanation for how he came to be in possession of the drugs in the two suitcases. It is clear that, in relation to the charge of trafficking in a dangerous drug, the critical issue is one of the respondent’s knowledge. Did he know he was transporting dangerous drugs or might he have believed he was not carrying drugs with him but, instead, confidential documents? The issue of knowledge is a commonly encountered issue in a prosecution for drug trafficking and, in a trial on indictment, an issue determined by a jury upon a consideration of the evidence. C. The procedural history C.1 The voire dire ruling 8. After he was charged with the offence of trafficking in a dangerous drug, the respondent was remanded in custody pending trial. Case management hearings were held before the judge on 15 October 2021 and 2 November 2021 respectively. The parties had prepared and submitted draft admitted facts for the judge’s consideration at those hearings. Those admitted facts recorded, amongst other matters, that: (1) the respondent’s mobile phone was seized from him by Customs Officer Cheung Sin-ying on 11 September 2019 as exhibit P60; (2) a search warrant in respect of the phone was obtained on 11 September 2019 to inspect its contents; (3) on 11 September 2019, between 1757 hours and 2040 hours, Customs Inspector Chau Kin-lung, Customs Inspector Leung Hok-pan and Customs Officer Kwok Sze-lok carried out a video recorded interview with the respondent in English, the transcript of which was exhibit 78A and the video of which was exhibit 78B; (4) on 15 and 17 September 2019, Customs Officer Cheung took photographs of the WhatsApp messages in the phone, some of which were produced as exhibits P80, P81 and P82, being exchanges between the respondent, on the one hand, and Yolanda and Jimmy, on the other, on various dates; and (5) on 2 November 2019, Acting Chief Customs Officer Chan Tsz-lai examined the phone, during which process the contents of the phone had not been interfered with or tampered with, and confirmed that it contained the messages in exhibits P80, P81 and P82. 9. The judge, of her own motion, raised a question as to the admissibility of the photographs of the WhatsApp messages found on the phone. She directed that a voire dire hearing be conducted in respect of the photographs of those WhatsApp messages and the digital evidence recovered from the phone by Acting Chief Customs Officer Chan. 10. The respondent was then arraigned on 16 December 2021 and a voire dire conducted before the judge on 16 and 17 December 2021 at which Acting Chief Customs Officer Chan was the only witness. On 17 December 2021, the judge gave a ruling on the voire dire.[1] She was critical of what she considered to be the mishandling of the mobile phone by Customs and Excise and concluded, for reasons that will be examined further below, that: “None of the data recovered from the mobile phone P60 may be adduced. It follows that the prosecution must now liaise with the defence to consider the effect of this ruling upon the content of the video recorded interview where photoshots and the contents of the phone have been put to the defendant without any proper record being made and after insecure access to the phone prior to interview.”[2] C.2 The grant of a permanent stay 11. Following the voire dire ruling, the parties prepared a revised draft of the admitted facts, deleting references to the WhatsApp evidence. The transcript of the VRI was also redacted to remove references to the content of the WhatsApp messages. 12. The respondent then applied to permanently stay the proceedings on the basis that he could not receive a fair trial as he was unable to adduce the WhatsApp evidence consequent upon the voire dire ruling. The judge heard the stay application on 14 March 2022 and acceded to the respondent’s application on that date, indicating that she intended to order the release of the respondent who had hitherto been remanded in custody. 13. The written reasons for the judge’s decision to stay the proceedings were then handed down on 18 March 2022.[3] The judge concluded that, as a result of her voire dire ruling, the respondent was deprived of the ability to adduce in evidence the WhatsApp messages on his mobile phone in support of his defence as to knowledge. She cited the principles in HKSAR v Lee Ming Tee & Another[4] and concluded that the respondent had discharged his burden of showing a fair trial was not possible in the light of her ruling.[5] She rejected the suggestion that the respondent could refer to the documents when giving evidence, and therefore concluded there was no way to mitigate what she considered to be the mishandling of the mobile phone. For these reasons, the judge ordered a permanent stay of proceedings against him. C.3 The prosecution’s intention to appeal and the judge’s grant of bail 14. On 15 March 2022, the prosecution served a notice of intended application for leave to appeal to the Court of Final Appeal against the judge’s decision to stay proceedings and sought the continued remand of the respondent in custody. At a hearing on 15 March 2022, without objection from the prosecution and as foreshadowed the previous day, the judge ordered the release of the respondent on bail subject to conditions, including a prohibition on his leaving Hong Kong pending the handing down of her written reasons for her decision to stay proceedings. 15. Thereafter, at an adjourned hearing on 18 March 2022 following the handing down of those reasons, the prosecution confirmed that it wished to appeal her stay decision and asked that the respondent’s existing bail conditions be extended, upon its undertaking to apply to the Court of Final Appeal for an expedited hearing in light of the respondent’s status as a foreign defendant. The judge declined to do so and made an order varying the respondent’s bail terms so that he was permitted to leave the jurisdiction of Hong Kong but that he should reside at a specified address in Aberdeenshire, Scotland, and remain in contact with his instructing solicitors. 16. Following the judge’s variation of his bail conditions, the respondent left Hong Kong on 20 March 2022. As at the date of this appeal, he remains outside the jurisdiction. C.4 The grant of leave to appeal to this Court 17. On 31 May 2022, the Appeal Committee granted the prosecution leave to appeal against the judge’s decision to grant a permanent stay of the proceedings against the respondent on the substantial and grave injustice ground. 18. In addition, the Appeal Committee granted leave to appeal on the following question of law, namely: “When a judge of the Court of First Instance grants a final stay of criminal proceedings against a foreign defendant with little connection to Hong Kong but the prosecution wishes to appeal against that stay to the Court of Final Appeal, when considering the question of bail terms, should the judge ever impose or vary bail conditions in such a way that might render the intended appeal nugatory, in the sense that, if the stay were set aside, the prosecution could not proceed due to the absence of the defendant from the jurisdiction?” C.5 The issues arising on this appeal 19. The issues arising on this appeal are: first, as a preliminary matter, whether it is open to the prosecution to challenge the correctness of the voire dire ruling (Section D); secondly, whether, if the prosecution can challenge that ruling, it was flawed (Section E); thirdly, whether, if the voire dire ruling was flawed, the judge’s exercise of discretion to grant the stay of proceedings miscarried or was wrong in any event (Section F); fourthly, how the judge should have approached the question of bail and whether she erred in her approach to bail (Section G). D. Is it open to the prosecution to challenge the judge’s ruling on admissibility? 20. In appealing against the judge’s grant of a permanent stay of proceedings, the prosecution seeks to challenge the correctness of the judge’s underlying ruling on the voire dire.[6] The respondent contends, however, that it is not open to the prosecution to challenge the ruling on the voire dire and that the correctness of the stay decision has to be determined on the basis of the judge’s ruling that the WhatsApp messages are inadmissible.[7] The respondent’s contention is based on the premise that the judge’s ruling on the voire dire in the present case, being interlocutory, is not a final decision and so not appealable to the Court of Final Appeal. 21. For the following reasons, the respondent’s contention cannot be accepted. 22. It is correct that the Court of Final Appeal’s jurisdiction in a criminal cause or matter is circumscribed by s.31 of the Hong Kong Court of Final Appeal Ordinance (Cap.484) (“HKCFAO”)[8] such that appeals only lie against final decisions. It is also correct that rulings in the course of a trial on the admissibility of evidence are almost invariably interlocutory rather than final. The limitation on interlocutory appeals to the Court of Final Appeal in s.31 of the HKCFAO is a reflection of the policy against the fragmentation of the criminal appellate process, a matter to which Lam PJ recently referred in HKSAR v Chen Keen (No 2).[9] The policy aims to avoid the disruption and delay that would inevitably follow if interlocutory decisions could be appealed to a higher court, whether the Court of Appeal or this Court, in the course of a criminal trial. Instead, erroneous judicial decisions made in the course of a trial should normally be corrected, if necessary, by way of an appeal against conviction. 23. It follows that, in a criminal trial resulting in the defendant’s conviction, a judge’s interlocutory ruling on the admissibility of certain evidence will not be appealable until after the trial when the conviction is appealed as a final decision. At that point, on the appeal against conviction, it is open to the defendant to challenge the correctness of the interlocutory ruling on the admissibility of the evidence in question. The Respondent’s Case acknowledges and accepts this.[10] 24. But appeals in a criminal cause or matter are not limited to appeals by a convicted defendant. The prosecution, being “a party to the proceedings”, has standing under s.31 to apply for leave to appeal against a final decision,[11] including a decision to grant a permanent stay of proceedings.[12] Where it does so, an interlocutory decision which is the basis of the final decision appealed against will be open to challenge, since the correctness of the final decision will depend in turn on the correctness of the preceding interlocutory decision.[13] This is the case in respect of an appeal against conviction where the ground of appeal is that an interlocutory ruling admitting certain evidence was wrong. On the appeal, it will be open to the convicted appellant to challenge that interlocutory evidentiary ruling. The position is no different in the present case, albeit that it is the prosecution which seeks to challenge the correctness of the judge’s ruling on the voire dire, which in turn was the basis of her decision to grant a permanent stay of proceedings. 25. It follows that, since the prosecution’s appeal against the grant of the permanent stay of proceedings is an appeal against a final decision and that appeal takes issue squarely with the judge’s ruling on the voire dire, on which that final decision was in substance based, it is open to the prosecution to challenge the correctness of that earlier evidentiary ruling as part of this appeal. E. The judge’s voire dire ruling 26. The judge identified the relevant evidence to which the voire dire ruling related as being: (i) “photoshots” (i.e. photographs) of WhatsApp messages[14] found within the memory of the respondent’s iPhone X (exhibit P60) and taken on 15 and 17 September 2019; and (ii) digital evidence recovered from exhibit P60 by Acting Chief Customs Officer Chan at the Customs and Excise Computer Forensics Laboratory.[15] In addition, the judge also analysed the evidence under “two separate methods of investigation and two separate periods of time”: first, the seizure and handling of exhibit P60 from the respondent’s arrest to when the phone was handed over for forensic examination; and secondly, when it was held by the laboratory and thereafter forensically examined.[16] 27. At the outset of the voire dire ruling, the judge expressed her concern as to the practice of prosecuting authorities relying upon “short cuts”, as she put it, to digital evidence and seeking to agree evidence which is or might be, in her view, inadmissible and the use of such shorts cuts in relation to criminal prosecutions, especially the omission in witness statements of “large gaps in the handling of exhibits”.[17] In the course of her ruling, the judge focused on the integrity of the phone as an exhibit and the manner in which the Customs and Excise had accessed and stored it. In particular, she noted that the “hash value”[18] of the phone would be altered whenever the phone was accessed but that the respondent’s phone was accessed on multiple occasions without a record of when and in what manner it had been accessed being kept and made available to the defence.[19] She also noted, in particular, that the phone had a storage capacity of 64GB (gigabytes) of which approximately 40GB had been used but of which only 19.7GB of data was able to be extracted when examined forensically by Customs and Excise.[20] 28. The judge’s concerns led to the following material conclusions in the voire dire ruling: “The provenance of the physical iPhone P60 is questionable. There is no proper record of when a sealed exhibit is retrieved and unsealed and what occurs to it over several days when that has occurred. … The taking of photoshots from the phone at this stage has not been properly documented nor exhibited and they may not be adduced in trial. The prosecution has been given fair warning that there was a problem and it is now too late to correct what has been a poor supervision of evidence. In any event, the reality is that the prosecution seeks to rely upon the content of such shots as evidence of the truth of their contents and the prosecution has provided no admissible route to place these before the Court given that the information relied upon is derived from a computer. … My findings in that respect are in any event overtaken by the subsequent handling of the phone and its contents. There is no system in place to secure the data on a mobile phone which preserves the integrity of the data within. No secure and unassailable copy is made of the data retrieved and, in any event, a significant amount of data is not and cannot be retrieved. This results in a substantial prejudice to the defence who have little idea of these shortcomings until a long way into the investigation by which time the harm has been done and the costs of seeking to unravel that harm would be significant. …”[21] 29. There are, with respect, a number of fundamental flaws in the judge’s approach and her analysis of the admissibility of the relevant evidence. 30. The starting point for a correct analysis is to examine the nature and purpose of the evidence forming the subject matter of the judge’s voire dire inquiry. As already indicated, the evidence consisted of photographs of WhatsApp messages recorded on the respondent’s mobile phone. Some of those messages had also been referred to and read into the VRI and so, being part of the transcript of that interview, existed in the form of a written record of those messages. Whilst it is not clear to what extent the prosecution would need to rely on the WhatsApp messages, it is clear that the defence case would rely heavily on them to support the respondent’s defence “that he was groomed online, and was tricked into bringing the drugs into Hong Kong”.[22] Clearly, the WhatsApp messages in question would, if believed, be relevant to the respondent’s state of mind, in particular his state of knowledge of the contents of the suitcases he was carrying: did he know they were drugs (the prosecution case) or might he have believed they were just confidential documents (the defence case)? 31. The judge appears to have misapplied two separate principles of the law of evidence in her voire dire ruling: first, she misapplied the hearsay rule as regards the WhatsApp messages; and secondly, she confused the issue of their admissibility with that of their weight and reliability. E.1 The hearsay rule was inapplicable 32. A clear formulation of the hearsay rule which this Court has previously adopted as a workable definition is that “an oral or written assertion, express or implied, other than one made by a person in giving oral evidence in court proceedings is inadmissible as evidence of any fact or opinion so asserted”: Oei Hengky Wiryo v HKSAR (No 2).[23] 33. But this does not mean that the rule always forbids evidence of what somebody has declared, orally or in writing, out of court. As Stock NPJ, writing for the Court in HKSAR v Lau Shing Chung Simon, stated, that is not the rule.[24] As his Lordship there elaborated, the rationale of the rule is a concern for the probative value of out-of-court statements: “Sometimes the circumstances in which an out-of-court declaration is made are deemed to confer sufficient inherent reliability as to render the declaration admissible to prove the truth of what is declared and it is upon that reasoning that the common law and statutory exceptions are based. In other circumstances, however, the probative value of evidence of a fact in issue is said to be materially undermined where it cannot be tested by cross-examination and it is the inability to cross-examine the declarant to test the accuracy of his out-of-court statement that lies at the heart of the general rule.”[25] 34. It is necessary, however, to contrast statements tendered solely to show the fact that they were made by another person. That is not evidence which is rendered inadmissible by the hearsay rule. On the contrary, the witness tendering the statement is giving direct evidence of a fact to which he can speak directly and which can be tested in cross-examination. This demonstrates the importance of ascertaining the purpose to which an out-of-court statement is tendered, a factor which was emphasised by McHugh NPJ in Oei Hengky Wiryo v HKSAR (No 2), since: “[a]s long as its contents are not relied on to prove a fact recited or asserted, it will be admissible if it tends to prove a fact in issue or a fact relevant to a fact in issue.”[26] 35. Similarly, in the case of the production of a document which expressly or impliedly contains a statement, Lord Hoffmann NPJ in Secretary for Justice v Lui Kin Hong noted: “The hearsay rule never makes a document as such inadmissible. It is only inadmissible for a particular purpose, namely, as evidence that a statement which [it] contains is true. If it is relevant to an issue in some other way, it is admissible for that purpose.”[27] 36. The above passages from both Oei Hengky Wiryo v HKSAR (No 2) and Secretary for Justice v Lui Kin Hong were cited by Stock NPJ in the Court’s judgment in HKSAR v Lau Shing Chung Simon.[28] 37. In the voire dire ruling at [17], quoted above, the judge clearly misconceived, with respect, the purpose for which either party was wishing to rely upon the content of the photographs of the WhatsApp messages on the respondent’s phone. Neither the prosecution nor the defence case was relying on those messages for a testimonial purpose, that is to say, to prove the truth of the underlying facts conveyed in the messages. It was certainly no part of the prosecution case that the messages emanating from Yolanda or Jimmy or referring to Anthony were true in the sense that they showed the reason for the respondent’s journey from Brazil to Hong Kong. Nor was it part of the defence case that those messages were necessarily true. Rather, the respondent was relying on those messages as real evidence showing the content of communications received by him at material times to support his case as to his state of mind that, having received them, he was or might have been misled as to the contents of the suitcases he was carrying. 38. A further indication that the judge misapprehended the purpose of the WhatsApp evidence is her reference to s.22A of the Evidence Ordinance (Cap.8). That section provides a specific statutory exception to the common law rule against hearsay in respect of a statement contained in a document produced by a computer in these terms: “(1) Subject to this section and section 22B, a statement contained in a document produced by a computer shall be admitted in any criminal proceedings as prima facie evidence of any fact stated therein if – (a) direct oral evidence of that fact would be admissible in those proceedings; and (b) it is shown that the conditions in subsection (2) are satisfied in relation to the statement and computer in question.” Sub-s.(2) stipulates the conditions which have to be satisfied. The judge noted in the voire dire ruling that the respondent’s mobile phone was “a computer for the purposes of s22A of the Evidence Ordinance”.[29] This reference was later picked up in her conclusion in the voire dire ruling, quoted above, where she stated that “the prosecution has provided no admissible route to place these before the Court given that the information relied upon is derived from a computer.”[30] Subsequently, in the stay decision, the judge again referred to s.22A when she concluded: “There is no proper digital copy of what was on the phone at the material time for the purpose of a s22A certificate by an independent expert. That error cannot be remedied. S22A(3) precludes the defendant from adducing it himself.”[31] 39. Since, in this case, it was not intended to adduce the WhatsApp messages as prima facie evidence of any fact stated in them, s.22A did not apply. This misapprehension on the part of the judge in respect of s.22A of the Evidence Ordinance reflects a similar misapprehension sometimes manifested in other cases. In HKSAR v Lau Shing Chung Simon, the magistrate made the same error in thinking that s.22A was engaged when, in fact, the WhatsApp evidence in that case was not being relied upon for the purpose of proving the content of the messages but instead merely to show that the statement in the messages had been made and that the defendant had believed them and acted as he did in the light of that belief. Stock NPJ illustrated the point neatly when he said: “If we take as an example the message which read: ‘When you push her, pay attention to me’, the appellant wished to adduce that in evidence to show that the statement had been made by Ms Yau and that, in reliance upon it and other matters, he, rightly or wrongly, but nonetheless honestly, believed that he had Ms Yau’s consent to use limited violence upon her whenever she appeared to him to be ‘possessed’. On his view of it, the statement amounted to a request as to the future and there was no assertion of fact in it upon the truth of which he sought to rely.”[32] 40. Similarly, in the recent Court of Appeal decision in HKSAR v Fung Hoi Yeung,[33] a photograph taken from a mobile phone was sought to be used to challenge the evidence of the complainant that she had only seen a pair of boxer shorts in a laundry basket but had not handled or moved them. The Court of Appeal cited paragraphs [23] to [33] of this Court’s judgment in HKSAR v Lau Shing Chung Simon in support of the true scope and purpose of s.22A of the Evidence Ordinance and observed: “… if we ask for what purpose, or to prove what fact, was [the photograph of the boxer shorts] tendered, the answer would surely be in order to ask Ms X whether she had a photograph on her telephone of some red-chequered boxer shorts lying on a computer keyboard, why it was there, why she should have sent that photograph to another person, and when she did so; given her evidence that she had never touched the applicant’s red-chequered boxer shorts in the linen basket. We do not see how s.22A, assuming it was even applicable, was conceivably engaged by this line of enquiry.”[34] 41. In the same way the rule against hearsay was not engaged in relation to the WhatsApp messages in HKSAR v Lau Shing Chung Simon or the photograph in HKSAR v Fung Hoi Yeung, neither was it engaged in relation to the WhatsApp messages extracted from exhibit P60 in the present case. Their admissibility did not depend on compliance with the conditions stipulated by s.22A of the Evidence Ordinance and reference to that statutory exception to the hearsay rule was simply irrelevant. E.2 The admissibility of exhibit P60 was not affected by questions as to its weight or reliability 42. At the stage of the case management hearings, the judge was made aware of the parties’ intention to adduce the WhatsApp messages by way of admitted facts. The purpose of their doing so has been addressed above. Leaving aside the possibility of excluding any evidence on a discretionary basis on the ground that its prejudicial effect outweighed its probative value (which was not suggested to be the case here), at that stage of the proceedings, the only issues as regards admissibility were relevance and, because they were in a recorded form, authenticity. 43. As to relevance, it is clear that the WhatsApp messages in the present case are relevant to a fact in issue in the proceedings, namely the true state of mind of the respondent as regards the contents of the suitcases he was carrying and whether he knew they contained dangerous drugs or might have believed that they were just confidential documents. 44. In Hong Kong, the proper legal standard to which any issue of authenticity is to be determined in the context of admissibility is the “prima facie evidence” standard. If the evidence satisfies the judge to that standard, it justifies the issue going forward to the jury for determination of the general issue of guilt. The Appeal Committee of this Court so held in refusing leave to appeal in HKSAR v Chan Siu Tan,[35] concerning convictions for assault based on disputed video footage. 45. In so holding, the Appeal Committee cited[36] with approval the distinction between the voire dire stage and the determination of the general issue of guilt drawn by Shaw J in R v Robson, namely: “... in a recent criminal trial, Reg. v Stevenson [1971] 1 WLR 1, ... it was contended that the standard of proof of originality was that which applied to any issue which had to be resolved by the jury in such a trial, namely, proof beyond reasonable doubt. This is, of course, right if and when the issue does come before the jury as a matter they have to decide as going to weight and cogency. In the first stage, when the question is solely that of admissibility — ie whether the evidence is competent to be considered by the jury at all — the judge, it seems to me, would be usurping their function if he purported to deal with not merely the primary issue of admissibility but what is the ultimate issue of cogency. My own view is that in considering that limited question the judge is required to do no more than to satisfy himself that a prima facie case of originality has been made out by evidence which defines and describes the provenance and history of the recordings up to the moment of production in court. If that evidence appears to remain intact after cross-examination it is not incumbent on him to hear and weigh other evidence which might controvert the prima facie case. To embark on such an inquiry seems to me to trespass on the ultimate function of the jury.”[37] 46. That statement of principle has been endorsed by the Northern Irish Court of Appeal in R v Murphy[38] and by the English Court of Appeal in R v Gibbins (Martin).[39] Similarly, the Court of Appeal in this jurisdiction has endorsed Shaw J’s “prima facie authentic” test in HKSAR v Lee Chi Fai.[40] 47. In the present case, neither party had raised any question as to the authenticity of the WhatsApp messages or the contents of exhibit P60. It was the judge, it will be remembered, who raised the issue of admissibility of the evidence of her own motion. 48. Furthermore, this was not a case in which the respondent has ever suggested, even at the stage of the hearing of this appeal, either (i) that the WhatsApp messages which he was shown during the VRI were not genuine in that their content had been altered from their original form, or (ii) that the WhatsApp messages were incomplete and that there were other messages conveying certain information on which he wished to rely that were no longer accessible on the mobile phone due to any alleged mishandling. Indeed, the parties had informed the judge that they proposed formally to agree that the contents of the mobile phone were authentic (see paragraph [8(5)] above). 49. Finally, the only technical evidence before the judge, from Acting Chief Customs Officer Chan, was that although each time the phone was accessed the data on it would be altered in some way, he believed that it would not affect the WhatsApp messages to be relied upon. The judge noted this evidence,[41] but despite the absence of any contrary evidence, concluded that the contents of exhibit P60 as a whole, including the WhatsApp messages, could not be adduced in evidence. 50. It is established that authenticity may be proved circumstantially.[42] In this case, the circumstantial evidence readily established a prima facie case of authenticity of the WhatsApp messages. Such circumstantial evidence included: the fact that over 3,900 messages between June and September had been downloaded from the mobile phone[43] and appeared to form a chain of communications flowing naturally from preceding messages forming a comprehensive whole; the admissions made by the respondent in the VRI with regard to the messages found on the mobile phone; and the content of the messages retrieved, which appeared generally consistent with the respondent’s account in the VRI. 51. With respect, none of the concerns raised by the judge would have suggested the prima facie authentic test was not satisfied in the present case. As such, there was no warrant for the judge holding the voire dire hearing to inquire into the authenticity of the WhatsApp messages or the contents of exhibit P60, let alone ruling against the admissibility of such evidence. Her expressed conclusions as to the securing of the data on the mobile phone, the preservation of the integrity of the data within, the absence of a secure and unassailable copy of the data retrieved and the inability to retrieve a significant amount of data (at [18] of the voire dire ruling, quoted above) clearly demonstrate that the judge trespassed into the function of the jury in deciding the weight and reliability of the contents of the mobile phone and went far beyond any prima facie inquiry as to authenticity. E.3 Conclusion on the voire dire ruling 52. For the above reasons, the judge should not have directed the holding of a voire dire into the admissibility of the WhatsApp messages and her ruling that the contents of exhibit P60 were inadmissible as evidence was wrong. 53. In reaching the above conclusion as to the voire dire ruling, it has been sufficient to focus on the matters discussed above. It has not been necessary to consider wider issues that might arise in relation to the adducing of digital evidence from a mobile phone. There are various technical questions which might arise in that regard, including the forensic exercises of digital imaging and digital cloning.[44] 54. It is conceivable that cases might arise where the manner in which a mobile phone or other mobile device is accessed and data retrieved from it might be material to the prima facie authenticity or weight or reliability of the evidence in question. However, that is clearly not the case here, nor was it the case in HKSAR v Lau Shing Chung Simon, HKSAR v Fung Hoi Yeung or HKSAR v Chan Siu Tan. Given the proliferation of mobile messaging applications, it is highly likely that evidence will be sought to be tendered in the form of WhatsApp messages in other cases in future. As discussed above, where such messages are tendered as real evidence or for a non-testimonial purpose, the hearsay rule is not engaged and no question of reliance on any statutory exception to that rule (such as s.22A of the Evidence Ordinance) arises. But where a party seeks to rely on WhatsApp messages to prove the content of those communications and so tenders the messages for a testimonial purpose, the hearsay rule will be engaged and the admissibility of the evidence will depend on compliance with the relevant statutory regime. 55. More detailed consideration of other technical aspects of the forensic exercises mentioned will, therefore, need to await another case in which those aspects are relevant to questions of admissibility at the prima facie authentic threshold or as to weight and reliability at the trial threshold. It is likely in that context that it will be necessary to consider technical evidence of a nature not adduced, nor fully argued, in this case. F. The judge’s exercise of discretion to grant the stay of proceedings 56. As Sir Anthony Mason NPJ stated, in HKSAR v Lee Ming Tee & Securities and Futures Commission (Intervener): “The order for the grant of a permanent stay proceeded from the exercise of a judicial discretion by the Judge. An appeal from the exercise of such a discretion is governed by well-settled principles. It must appear that the exercise of discretion was based upon a misunderstanding of the law or of the evidence or upon evidentially unsupported inferences that particular facts existed or did not exist. Alternatively, it must appear that the exercise of discretion miscarried because it was based upon an irrelevant consideration or it failed to take into account a relevant consideration or it was plainly wrong in the sense that it was so unreasonable that it must have proceeded from some undisclosed error of principle or erroneous application of the principle. See Owners of the Las Mercedes v Owners of the Abidin Daver (The Abidin Daver) [1984] AC 398 at p.420A-C where Lord Brandon’s statement is confined to a situation where there is no challenge to the facts on which the exercise of the discretion is based.”[45] 57. The judge’s decision to grant a stay of proceedings, being an exercise of judicial discretion, was squarely based on the voire dire ruling. (1) In the stay decision, the judge stated: “The defendant is charged with one count of trafficking in a dangerous drug … This is an application for a permanent stay of those proceedings as a result of my Ruling dated 17 December 2021 (‘the Ruling’), under which I ruled inadmissible the digital evidence from the defendant’s mobile phone [P60]. That Ruling should be read in conjunction with this Decision.”[46] (2) The respondent’s counsel relied on the voire dire ruling as the basis of his submission that it would be impossible to give the respondent a fair trial and that for the trial to continue would amount to an abuse of process.[47] In turn, the judge framed the issue for her decision in these terms: “The issue now is how the Ruling has affected the defendant and whether it has rendered any trial unfair. The defence cannot adduce it in its current form of its own volition. There is no proper digital copy of what was on the phone at the material time for the purpose of a s22A certificate by an independent expert. That error cannot be remedied. S22A(3) precludes the defendant from adducing it himself.”[48] (3) The judge concluded that what she considered to be failures on the part of Customs and Excise in respect of the processing of evidence from exhibit P60 had led to substantial prejudice to the respondent, which could not be addressed, so that, as a result, he could not receive a fair trial.[49] (4) It is therefore clear that the basis of the judge’s decision to grant a permanent stay of proceedings, being an exercise of judicial discretion, was the voire dire ruling. 58. Since, for the reasons set out in Section E above, the voire dire ruling was erroneous, it follows that the inadmissibility of the WhatsApp messages from the respondent’s mobile phone was not a factor that could properly be taken into account by the judge in the exercise of her discretion as to whether to grant a permanent stay of proceedings. On the contrary, it was an irrelevant consideration. That factor was, however, the sole basis of the judge’s decision to grant a stay of proceedings. 59. But for the erroneous view the judge took of the admissibility of the WhatsApp messages, there would have been no basis for the respondent’s application to permanently stay the proceedings against him. Accordingly, the stay application, if made, should have been dismissed by the judge. 60. By taking an irrelevant factor into consideration in the exercise of her judicial discretion, the judge self-evidently allowed a serious departure from an accepted norm to the disadvantage of the prosecution to occur. Had she not ruled erroneously that the WhatsApp messages in exhibit P60 were inadmissible as evidence, there would have been no basis for the respondent to apply for a permanent stay of the proceedings against him. The trial would have proceeded and the issue of whether the respondent knew the suitcases he was carrying contained dangerous drugs would have been determined by the jury. 61. For the above reasons, the judge’s exercise of discretion in relation to the respondent’s application to stay proceedings miscarried and should be set aside. 62. A permanent stay of criminal proceedings is a highly exceptional course since it is only in very unusual circumstances that a court will conclude that a fair trial is impossible and thus, as a last resort, abort the trial.[50] The prosecution has contended, on this appeal, that in any event, even if the voire dire ruling were correct, a fair trial would still have been possible.[51] However, since the prosecution’s appeal against the stay decision is based on the substantial and grave injustice ground and succeeds on the straightforward basis that the judge took an irrelevant consideration into account, it is unnecessary to burden this judgment by a discussion, on a hypothetical basis, of whether, even if the judge’s voire dire ruling were correct, she should not have granted a permanent stay of proceedings. It is sufficient to record that the arguments advanced by the prosecution as to the practical measures by which any perceived unfairness to the respondent might have been avoided or alternatively adequately mitigated were reasonably arguable. G. The judge’s variation of the respondent’s bail conditions 63. Upon a judge granting a permanent stay of proceedings against a defendant in a criminal prosecution, it is open to the prosecution to apply for leave to appeal to this Court against such an order. The application for leave may or may not be successful. If leave is granted, the appeal may or may not be allowed. If the appeal is allowed, it will follow that the criminal prosecution should proceed to trial. At the trial, the defendant may or may not be convicted. If convicted, the defendant may be liable to punishment by way of custodial sentence. This chain of possible outcomes demonstrates the obvious point that it is possible, notwithstanding a judge’s order permanently to stay criminal proceedings, that a defendant may ultimately be convicted of the offence charged and thereafter be subject to a term of imprisonment. 64. Given those circumstances, what should a judge’s approach to the issue of bail be when, following a grant of a permanent stay of proceedings, the prosecution indicates an intention to apply for leave to appeal to this Court against that stay? 65. The starting point in answering that question is s.35(2) of the HKCFAO, which applies: “… where, immediately after a decision of the Court of Appeal or the Court of First Instance, as the case may be, from which an appeal lies to the Court, the prosecutor is granted or gives notice that he intends to apply for, leave to appeal.”[52] That was the position here, when the prosecution served notice, on 15 March 2022, of its intention to apply for leave to appeal to the Court of Final Appeal from the judge’s decision granting a permanent stay of proceedings. 66. S.35(2) provides: “If, but for the decision of the Court of Appeal or the Court of First Instance, as the case may be, the defendant would be liable to be detained, the Court of Appeal or the Court of First Instance, as the case may be, may, on the application of the prosecutor made within 7 days of that decision, make an order providing for his detention, or directing that he shall not be released except on bail (which may be granted as under section 34), as long as an appeal to the Court is pending.” 67. S.34 of the HKCFAO, referred to in s.35(2), is the statutory provision setting out the jurisdiction to grant bail to a person in custody who is appealing or intending to appeal against a decision to the Court of Final Appeal. The material provisions of s.34 are those set out in sub-ss.(1) and (2) which read: “(1) The Court, the Court of Appeal or the Court of First Instance, as the case may be, may on the application of a person appealing or applying for leave to appeal or on the application of a person in custody pending the determination of the appeal, grant the person in custody bail pending the determination of the appeal. (2) A grant of bail under subsection (1) may be made subject to such conditions as the Court, the Court of Appeal or the Court of First Instance, as the case may be, considers necessary.” 68. It will be apparent that the statutory power under s.35(2) is discretionary. The court whose decision is to be appealed may make an order providing for the defendant’s detention or it may order his release on bail subject to such conditions as the court considers necessary. The power is also conditional on the premise that “but for the decision of the Court of Appeal or the Court of First Instance, as the case may be, the defendant would be liable to be detained”. 69. The context in which the discretion in s.35(2) falls to be exercised is the administration of the criminal justice system in Hong Kong. The statutory purpose of s.35(2) is to assist in the just and efficient administration of that criminal justice system. It is generally in the interests of that system that defendants facing allegations of serious criminal wrongdoing are subject to a fair trial and, if a conviction follows thereafter, subject to such sentence of punishment as is appropriate. Thus, s.35(2) expressly provides that where, but for the decision sought to be appealed from, “the defendant would be liable to be detained”, there is a power to detain in custody or grant bail. As the Appeal Committee explained, in HKSAR v Lai Chee Ying: “Section 35 operates to enable a defendant who has been in custody and who has successfully appealed to the CFI or the Court of Appeal to be ordered by that court, on the application of the prosecutor, to continue to be held in custody where the prosecutor ‘is granted or gives notice that he intends to apply for, leave to appeal’.”[53] This applies equally in the present case, where a defendant, rather than having successfully appealed to the judge below (as was the position in HKSAR v Lai Chee Ying), has succeeded in an application to stay proceedings permanently. 70. When s.35(2) is invoked by the prosecution, the court to whom the application is made must determine whether “but for the decision [appealed against], the defendant would be liable to be detained”. In so determining, the court must ascertain what the position would have been but for the impugned decision as regards the liberty of the defendant. That status quo ante is the starting point from which the discretion in s.35(2) is to be exercised. In the case of a defendant who has been in custody, it does not follow that the court must order his continued detention but, unless there has been some material change in circumstances, the proper exercise of such discretion will generally be to maintain that status quo ante. As explained by the Appeal Committee in HKSAR v Lai Chee Ying: “… the statutory intention is plainly to enable the status quo to be maintained, with the defendant continuing to be held in custody in case the lower court’s decision proves to be wrong and the prosecutor’s intended appeal is successful.”[54] 71. Therefore, in the light of that statutory intention and in the case of a proposed appeal by the prosecution against an order granting a permanent stay of proceedings, it would not normally be a proper exercise of discretion under s.35(2) to make an order which might give rise to a substantial risk of a previously remanded defendant, whether foreign or not, being absent from the jurisdiction when the prosecution, having succeeded on the appeal, then sought to proceed with the prosecution. The defendant’s absence at that stage would frustrate the prosecution’s ability to proceed and would, in that sense, render the appeal nugatory. 72. To that extent, in my view, the answer to the question for which leave to appeal was granted (set out at [18] above) is, clearly, “No”. 73. In the present case, the respondent was in custody pending trial. But for the judge’s decision to stay the proceedings, which was intended to be the subject of an appeal by the prosecution, the defendant would have remained under detention in custody pending his trial. That was the status quo ante in the present case and should have been the judge’s starting point in the exercise of her discretion under s.35(2). But for the decision intended to be appealed from, namely the judge’s stay decision, the respondent was liable to be detained since he had been remanded in custody pending trial. 74. The departure of a criminal defendant from this jurisdiction prior to his trial raises the possibility that he may not return to the jurisdiction, or not be liable to extradition, to face trial. In that event, in the case of a defendant who, if he were to have been tried, would have been convicted, justice will have been frustrated. This does not serve the public interest, which requires that serious crimes are prosecuted and, if a conviction follows, offenders punished. 75. In the present case, if, having left the jurisdiction, the respondent were not voluntarily to return, or could not be brought back to the jurisdiction under compulsion, the appeal against the judge’s stay decision would have been rendered nugatory. That should not have occurred. H. Conclusion and disposition of appeal 76. For the reasons set out in Section F above, the judge’s grant of a permanent stay of proceedings against the respondent was erroneous, being based on her flawed ruling on the voire dire (for the reasons set out in Section E above). It follows that the prosecution’s appeal against the stay must be allowed and the stay granted by the judge set aside. 77. What happened following the judge’s delivery of her decision on the stay application regarding the grant of bail on 15 March 2022 and then the variation of the bail conditions on 18 March 2022 is not the subject of the question of law in relation to bail for which leave to appeal was granted. However, the conclusion that the stay was wrongly granted and must be set aside is that the subsequent grant of bail, on 15 March 2022, and the variation of the conditions of bail thereafter, on 18 March 2022, must also be set aside in consequence. 78. The effect of the judge’s grant of bail and then her subsequent variation of his bail conditions, following her decision to grant a permanent stay of proceedings against him, was that the respondent was free to leave the jurisdiction of Hong Kong and he duly did so. However, for the reasons already explained, the proceedings against the respondent should not have been stayed and he should therefore face a trial on the charge of trafficking in a dangerous drug. If such a trial were to result in his conviction, and that is a matter of speculation at this stage, he would be liable to imprisonment for a lengthy period in light of the quantity of drugs involved. 79. The prosecution is at liberty to list the matter before another judge of the Court of First Instance to make such orders as may be appropriate in order to proceed, if possible, with the prosecution. The grant of bail on 15 March 2022 having been set aside, the respondent is liable to be detained pursuant to the order remanding him in custody pending trial. If he remains at large, a judge of the Court of First Instance may issue a warrant of arrest in respect of the respondent. It may yet be the case that the respondent will return voluntarily to this jurisdiction to face trial for the offence of trafficking. Unfortunately, however, by reason of the judge’s orders in the present case, there is no certainty that this will happen. Mr Justice Lam PJ: 80. I agree with the judgment of Mr Justice Fok PJ. Mr Justice Stock NPJ: 81. I agree with the judgment of Mr Justice Fok PJ. Lord Neuberger of Abbotsbury NPJ: 82. I agree with the judgment of Mr Justice Fok PJ. Chief Justice Cheung: 83. The appeal is therefore unanimously allowed and the question of law for which leave to appeal was granted answered in the manner set out in paragraph [72] above. The Court makes the orders set out in paragraphs [76], [77] and [79] above. Mr Derek Lau SADPP (Ag) and Mr Gary Leung ADPP (Ag), of the Department of Justice, for the Appellant Mr Richard Donald, instructed by Morley Chow Seto, assigned by the Director of Legal Aid, and Ms Nisha Mohamed, instructed by Morley Chow Seto, on a pro bono basis, for the Respondent [1] [2021] HKCFI 3824, HCCC 240/2020, Ruling, 17 December 2021 (“the voire dire ruling”). [2] Ibid. at [19]. [3] [2022] HKCFI 800, HCCC 240/2020, Reasons for Decision, 18 March 2022 (“the stay decision”). [4] (2001) 4 HKCFAR 133. [5] The stay decision at [16]. [6] The Appellant’s Case at [28]. [7] The Respondent’s Case at [6] et seq. [8] “An appeal shall, at the discretion of the Court, lie to the Court in any criminal cause or matter, at the instance of any party to the proceedings, from – (a) any final decision of the Court of Appeal; (b) any final decision of the Court of First Instance (not being a verdict or finding of a jury) from which no appeal lies to the Court of Appeal.” [9] [2022] HKCFA 6, (2022) 25 HKCFAR 34 at [17]. [10] At [11]. [11] HKSAR v To Chak Hang (2015) 18 HKCFAR 541 at [5]. [12] HKSAR v Chen Keen (No 2) [2022] HKCFA 6, (2022) 25 HKCFAR 34 at [23]. [13] See, e.g., HKSAR v Lee Ming Tee & Another (2001) 4 HKCFAR 133, and also HKSAR v Lee Ming Tee & Securities and Futures Commission (Intervener) (2003) 6 HKCFAR 336. [14] There were some 3,923 messages between 14 June and 11 September 2019 downloaded from the phone by Customs and Excise: see the stay decision at [10(i)]. [15] The voire dire ruling at [1]. [16] Ibid. at [5]. [17] Ibid. at [2]-[3]. [18] Referring to the MD5 (Message-Digest algorithm 5), used for digital authentication. [19] The voire dire ruling at [7]. [20] Ibid. at [12]. [21] Ibid. at [17]-[18]. [22] The Respondent’s Case at [14]. [23] (2007) 10 HKCFAR 98 at [35]. The strict common law rule is, of course, now subject to statutory exceptions: see, principally, the Evidence Ordinance (Cap.8), s.22. [24] (2015) 18 HKCFAR 50 at [27]. [25] Ibid. at [28]. [26] (2007) 10 HKCFAR 98 at [39]. [27] (1999) 2 HKCFAR 510 at 526C-D. [28] (2015) 18 HKCFAR 50 at [27]-[32]. [29] The voire dire ruling at [7]. [30] Ibid. at [17]. [31] The stay decision at [25]. [32] (2015) 18 HKCFAR 50 at [25]. [33] [2022] HKCA 1073, [2022] 3 HKLRD 833. [34] Ibid. at [48]. [35] [2020] HKCFA 14, (2020) 23 HKCFAR 153 at [18]. [36] Ibid. at [19]. [37] [1972] 1 WLR 651 at 653-654. [38] [1990] NI 306 at 342-343. [39] [2004] EWCA Crim 311 at [51]-[54]. [40] [2003] 3 HKLRD 751. [41] The voire dire ruling at [9]. [42] HKSAR v Yeung Ka Ho (2013) 16 HKCFAR 609 at [44] and [52]; HKSAR v Chan Siu Tan [2020] HKCFA 14, (2020) 23 HKCFAR 153 at [20] and [22]. [43] See FN14 above. [44] The former (digital imaging) is a forensic process of creating an exact bit-by-bit replica of an original device. This enables forensic examiners to conduct an examination of digital evidence on an exact copy, or image, rather than on the original device. The latter (digital cloning) is a process by which an exact copy of an original device is created. The difference between the two processes is that the copy in the case of digital cloning is stored in a similar device to the original device, whereas with digital imaging the copy is stored in the form of files in any suitable storage device. [45] (2003) 6 HKCFAR 336 at [68]. [46] The stay decision at [6]. [47] Ibid. at [11], [14]. [48] Ibid. at [25]. [49] Ibid. at [29]. [50] HKSAR v Lee Ming Tee & Another (2001) 4 HKCFAR 133 at 150C-G. [51] The Appellant’s Case, Section C.3. [52] HKCFAO, s.35(1); the heading of s.35 is “Detention on appeal by prosecutor”. [53] [2020] HKCFA 45, reported as HKSAR v Lai Chee Ying (No 2) in [2021] 1 HKC 344, at [27]. [54] Ibid. at [28].