def METHOD_NAME(rule_obj, platforms):
    oval_file, oval_contents = ssg.checks.get_oval_contents(rule_obj, 'shared')
    current_platforms = ssg.oval.applicable_platforms(oval_file)
    new_platforms = set(current_platforms)
    for platform in platforms:
        parsed_platform = platform.split('~')
        if not len(parsed_platform) == 2:
            print("Invalid platform replacement description: %s" % platform,
                  file=sys.stderr)
            sys.exit(1)
        match = ssg.rule_yaml.parse_prodtype(parsed_platform[0])
        replacement = ssg.rule_yaml.parse_prodtype(parsed_platform[1])
        if match.issubset(current_platforms):
            new_platforms.difference_update(match)
            new_platforms.update(replacement)
    print("Current platforms: %s" % ','.join(sorted(current_platforms)))
    print("New platforms: %s" % ','.join(sorted(new_platforms)))
    new_contents = ssg.checks.set_applicable_platforms(oval_contents,
                                                       new_platforms)
    ssg.utils.write_list_file(oval_file, new_contents)