See https://github.com/Flowdalic/Smack/commit/9016120d718ef9142cebf16af39009ad4e4be8 9a for my minimal invasive fix for SMACK-605. That's all that's required. You can now retrieve the information from the "query" element within the data form as RosterPacket with
AdHocCommandData data = ...
RosterPacket packet = (RosterPacket) data.getForm().getExtensionElements().get(0);