This article examines the claims of Dutch East India Company (VOC) officials in the mid-eighteenth century regarding the Islamic source of a legal code prepared for the local population in Semarang, northeast Java. Although the VOC had encountered local legal cultures in Indonesia since the mid-seventeenth century, it preferred to circumvent those in favour of European laws whenever possible. But in the eighteenth century, VOC officials addressed indigenous legal systems more directly when the company sought possibilities for direct control. This resulted in the production of many codes on the legal status of Muslim and Chinese subjects of Indonesia. In the process of codification, some officials claimed to have consulted Islamic legal texts and Muslim jurists. One criminal code that came out of the effort supposedly took its rulings accurately from the Mugharrar, which is possibly the Muḥarrar written by the Islamic jurist ʿAbd al-Karīm al-Rāfiʿī (d. 1226). I argue that this assertion is baseless, and demonstrate that the very pretense is part of a larger colonial project that sought legitimacy from the indigenous subjects at a time of political and economic crises.