modify code with hiapk value to turn on/off advertise