A star-quake model is proposed to understand X-ray flares of both long and short γ-ray bursts (GRBs) in a solid quark star regime. Two kinds of central engines for GRBs are available if pulsar-like stars are actually (solid) quark stars, i.e., the SNE-type GRBs and the SGR-type GRBs. It is found that a quark star could be solidified about 10 3 to 10 6 s later after its birth if the critical temperature of phase transition is a few Metga-electron-volts, and then a new source of free energy (i.e., elastic and gravitational ones, rather than rotational or magnetic energy) could be possible to power GRB X-ray flares.γ-rays, bursts: X-rays, neutron stars, elementary particles Swift, a multi-wavelength γ-ray burst (GRB) mission [1] , has led to great progress in understanding the nature of the GRB phenomenon (see recent reviews by Meszaros [2] and Zhang [3] ). With its promptly slewing capacity and high sensitivity, it catches the early afterglows and the extended prompt emission in details for the first time.This not only provides an opportunity to examine the conventional models established in the pre-Swift era [4][5][6][7][8] , but also facilitates studies of the transition between the prompt emission and the afterglow [8][9][10] , and even gives insight into the properties of both the progenitors and the GRB central engines [5,11] .The GRB survey with CGRO (Compton γ-ray Observatory)/BATSE identified two types of GRBs, long-soft and short-hard GRBs, separated with burst duration of about 2 s [12] . On one hand, with firmed detections of GRB-supernovae connections for four nearby cases [13][14][15][16][17] , it is now generally accepted that long GRBs are associated with energetic core-collapse supernovae [18,19] (see a recent review by Woosley et al. [20] ). Interestingly, Li [21] found that the peak spectral energy of GRBs is correlated with the peak bolometric luminosity of the underlying supernovae (SNe), based on the four pair GRB-SNe connections. The X-ray transient 080109 associated with a normal core-collapse SN 2008D [22] also complies with this relation [23] . Signatures of long GRB-SNe connection may be also derived from a red bump in late optical afterglow lightcurves [14,24] and a long time lag between the GRB precursor and the main burst observed in some GRBs [25] . On the other hand, short GRBs coincide with the early-type stellar population with no or little current star formation [26][27][28][29][30][31] (see a recent review by Nakar [32] ), favoring mergers of compact object binaries as the progenitors of the short GRBs [33][34][35][36] .Although the progenitors of the long and short GRBs are different, the models for their central engines are similar, and essentially all can be simply classed as a rotating compact object that drives an ultra-relativistic outflow to produce both the prompt γ-rays and afterglows in lower energy bands. These models are highly constrained by the observations of the prompt γ-rays and multi-wavelength afterglows. It is well believed that the prompt γ-rays are produced b...