Add frameworks_base patch && fix logic